Spaces:
Sleeping
Sleeping
Yaron Koresh
commited on
Update app.py
Browse files
app.py
CHANGED
@@ -11,7 +11,7 @@ from pathos.multiprocessing import ProcessingPool as ProcessPoolExecutor
|
|
11 |
import requests
|
12 |
from lxml.html import fromstring
|
13 |
|
14 |
-
pool = ProcessPoolExecutor(
|
15 |
pool.__enter__()
|
16 |
|
17 |
#model_id = "runwayml/stable-diffusion-v1-5"
|
@@ -57,13 +57,15 @@ def generate_random_string(length):
|
|
57 |
characters = string.ascii_letters + string.digits
|
58 |
return ''.join(random.choice(characters) for _ in range(length))
|
59 |
|
60 |
-
@spaces.GPU(duration=
|
61 |
def infer(prompt):
|
62 |
name = generate_random_string(12)+".png"
|
63 |
english_prompt = f'TRUE {translate(prompt,"english").upper()}:'
|
64 |
print(f'Final prompt: {english_prompt}')
|
65 |
image = pipe(
|
66 |
english_prompt,
|
|
|
|
|
67 |
negative_prompt="",
|
68 |
num_inference_steps=50,
|
69 |
guidance_scale=9.0
|
|
|
11 |
import requests
|
12 |
from lxml.html import fromstring
|
13 |
|
14 |
+
pool = ProcessPoolExecutor(64)
|
15 |
pool.__enter__()
|
16 |
|
17 |
#model_id = "runwayml/stable-diffusion-v1-5"
|
|
|
57 |
characters = string.ascii_letters + string.digits
|
58 |
return ''.join(random.choice(characters) for _ in range(length))
|
59 |
|
60 |
+
@spaces.GPU(duration=120)
|
61 |
def infer(prompt):
|
62 |
name = generate_random_string(12)+".png"
|
63 |
english_prompt = f'TRUE {translate(prompt,"english").upper()}:'
|
64 |
print(f'Final prompt: {english_prompt}')
|
65 |
image = pipe(
|
66 |
english_prompt,
|
67 |
+
height=4096,
|
68 |
+
width=4096,
|
69 |
negative_prompt="",
|
70 |
num_inference_steps=50,
|
71 |
guidance_scale=9.0
|