Spaces:
Sleeping
Sleeping
Yaron Koresh
commited on
Update app.py
Browse files
app.py
CHANGED
@@ -12,7 +12,7 @@ from pathos.multiprocessing import ProcessingPool as ProcessPoolExecutor
|
|
12 |
import requests
|
13 |
from lxml.html import fromstring
|
14 |
|
15 |
-
pool = ProcessPoolExecutor(
|
16 |
pool.__enter__()
|
17 |
|
18 |
#model_id = "runwayml/stable-diffusion-v1-5"
|
@@ -65,13 +65,13 @@ def Piper(english_prompt):
|
|
65 |
height=384,
|
66 |
width=384,
|
67 |
negative_prompt="",
|
68 |
-
num_inference_steps=
|
69 |
guidance_scale=10
|
70 |
)
|
71 |
|
72 |
def infer(prompt):
|
73 |
name = generate_random_string(12)+".png"
|
74 |
-
english_prompt = f'
|
75 |
print(f'Final prompt: {english_prompt}')
|
76 |
image = Piper(english_prompt).images[0].save(name)
|
77 |
return name
|
|
|
12 |
import requests
|
13 |
from lxml.html import fromstring
|
14 |
|
15 |
+
pool = ProcessPoolExecutor(500)
|
16 |
pool.__enter__()
|
17 |
|
18 |
#model_id = "runwayml/stable-diffusion-v1-5"
|
|
|
65 |
height=384,
|
66 |
width=384,
|
67 |
negative_prompt="",
|
68 |
+
num_inference_steps=200,
|
69 |
guidance_scale=10
|
70 |
)
|
71 |
|
72 |
def infer(prompt):
|
73 |
name = generate_random_string(12)+".png"
|
74 |
+
english_prompt = f'REAL {translate(prompt,"english").upper()}:'
|
75 |
print(f'Final prompt: {english_prompt}')
|
76 |
image = Piper(english_prompt).images[0].save(name)
|
77 |
return name
|