Spaces:
Runtime error
Runtime error
phenomenon1981
commited on
Commit
·
46fdd14
1
Parent(s):
bae581b
Update app.py
Browse files
app.py
CHANGED
@@ -7,7 +7,6 @@ import string
|
|
7 |
import time
|
8 |
from queue import Queue
|
9 |
from threading import Thread
|
10 |
-
from concurrent.futures import ThreadPoolExecutor
|
11 |
|
12 |
text_gen=gr.Interface.load("spaces/Omnibus/MagicPrompt-Stable-Diffusion")
|
13 |
def get_prompts(prompt_text):
|
@@ -45,8 +44,7 @@ def send_it1(inputs, noise_level, proc1=proc1):
|
|
45 |
while queue.qsize() >= queue_threshold:
|
46 |
time.sleep(2)
|
47 |
queue.put(prompt_with_noise)
|
48 |
-
|
49 |
-
output1 = executor.submit(proc1, prompt_with_noise).result()
|
50 |
return output1
|
51 |
|
52 |
def send_it2(inputs, noise_level, proc1=proc1):
|
@@ -54,8 +52,7 @@ def send_it2(inputs, noise_level, proc1=proc1):
|
|
54 |
while queue.qsize() >= queue_threshold:
|
55 |
time.sleep(2)
|
56 |
queue.put(prompt_with_noise)
|
57 |
-
|
58 |
-
output2 = executor.submit(proc1, prompt_with_noise).result()
|
59 |
return output2
|
60 |
|
61 |
def send_it3(inputs, noise_level, proc1=proc1):
|
@@ -136,10 +133,10 @@ with gr.Blocks() as myface:
|
|
136 |
output8=gr.Image(label="Dreamlike-photoreal-2.0")
|
137 |
|
138 |
see_prompts.click(get_prompts, inputs=[input_text], outputs=[prompt], queue=False)
|
139 |
-
run.click(send_it1, inputs=[prompt, noise_level], outputs=[output1])
|
140 |
-
run.click(send_it2, inputs=[prompt, noise_level], outputs=[output2])
|
141 |
-
run.click(send_it3, inputs=[prompt, noise_level], outputs=[output3])
|
142 |
-
run.click(send_it4, inputs=[prompt, noise_level], outputs=[output4])
|
143 |
run.click(send_it5, inputs=[prompt, noise_level], outputs=[output5])
|
144 |
run.click(send_it6, inputs=[prompt, noise_level], outputs=[output6])
|
145 |
run.click(send_it7, inputs=[prompt, noise_level], outputs=[output7])
|
|
|
7 |
import time
|
8 |
from queue import Queue
|
9 |
from threading import Thread
|
|
|
10 |
|
11 |
text_gen=gr.Interface.load("spaces/Omnibus/MagicPrompt-Stable-Diffusion")
|
12 |
def get_prompts(prompt_text):
|
|
|
44 |
while queue.qsize() >= queue_threshold:
|
45 |
time.sleep(2)
|
46 |
queue.put(prompt_with_noise)
|
47 |
+
output1 = proc1(prompt_with_noise)
|
|
|
48 |
return output1
|
49 |
|
50 |
def send_it2(inputs, noise_level, proc1=proc1):
|
|
|
52 |
while queue.qsize() >= queue_threshold:
|
53 |
time.sleep(2)
|
54 |
queue.put(prompt_with_noise)
|
55 |
+
output2 = proc1(prompt_with_noise)
|
|
|
56 |
return output2
|
57 |
|
58 |
def send_it3(inputs, noise_level, proc1=proc1):
|
|
|
133 |
output8=gr.Image(label="Dreamlike-photoreal-2.0")
|
134 |
|
135 |
see_prompts.click(get_prompts, inputs=[input_text], outputs=[prompt], queue=False)
|
136 |
+
run.click(send_it1, inputs=[prompt, noise_level], outputs=[output1], queue=False)
|
137 |
+
run.click(send_it2, inputs=[prompt, noise_level], outputs=[output2], queue=False)
|
138 |
+
run.click(send_it3, inputs=[prompt, noise_level], outputs=[output3], queue=False)
|
139 |
+
run.click(send_it4, inputs=[prompt, noise_level], outputs=[output4], queue=False)
|
140 |
run.click(send_it5, inputs=[prompt, noise_level], outputs=[output5])
|
141 |
run.click(send_it6, inputs=[prompt, noise_level], outputs=[output6])
|
142 |
run.click(send_it7, inputs=[prompt, noise_level], outputs=[output7])
|