kevinwang676
commited on
Commit
•
dffb787
1
Parent(s):
eac5393
Update app.py
Browse files
app.py
CHANGED
@@ -45,20 +45,20 @@ def add_random_noise(prompt, noise_level=0.00):
|
|
45 |
return "".join(prompt_list)
|
46 |
|
47 |
|
48 |
-
def send_it1(inputs, noise_level,
|
49 |
prompt_with_noise = add_random_noise(inputs, noise_level)
|
50 |
while queue.qsize() >= queue_threshold:
|
51 |
time.sleep(2)
|
52 |
queue.put(prompt_with_noise)
|
53 |
-
output1 = proc1(prompt_with_noise
|
54 |
return output1
|
55 |
|
56 |
-
def send_it2(inputs, noise_level,
|
57 |
prompt_with_noise = add_random_noise(inputs, noise_level)
|
58 |
while queue.qsize() >= queue_threshold:
|
59 |
time.sleep(2)
|
60 |
queue.put(prompt_with_noise)
|
61 |
-
output2 = proc1(prompt_with_noise
|
62 |
return output2
|
63 |
|
64 |
#def send_it3(inputs, noise_level, proc1=proc1):
|
@@ -124,8 +124,7 @@ with gr.Blocks(css='style.css') as demo:
|
|
124 |
|
125 |
with gr.Row():
|
126 |
with gr.Row():
|
127 |
-
noise_level = gr.Slider(minimum=0.0, maximum=3, step=0.1,
|
128 |
-
neg_prompts = gr.Textbox(label="negative prompt", lines=1)
|
129 |
with gr.Row():
|
130 |
with gr.Row():
|
131 |
output1=gr.Image(label="Dreamlike-photoreal-2.0",show_label=False)
|
@@ -135,8 +134,8 @@ with gr.Blocks(css='style.css') as demo:
|
|
135 |
#output1=gr.Image()
|
136 |
|
137 |
see_prompts.click(get_prompts, inputs=[input_text], outputs=[prompt], queue=False)
|
138 |
-
run.click(send_it1, inputs=[prompt, noise_level
|
139 |
-
run.click(send_it2, inputs=[prompt, noise_level
|
140 |
|
141 |
|
142 |
|
|
|
45 |
return "".join(prompt_list)
|
46 |
|
47 |
|
48 |
+
def send_it1(inputs, noise_level, proc1=proc1):
|
49 |
prompt_with_noise = add_random_noise(inputs, noise_level)
|
50 |
while queue.qsize() >= queue_threshold:
|
51 |
time.sleep(2)
|
52 |
queue.put(prompt_with_noise)
|
53 |
+
output1 = proc1(prompt_with_noise)
|
54 |
return output1
|
55 |
|
56 |
+
def send_it2(inputs, noise_level, proc1=proc1):
|
57 |
prompt_with_noise = add_random_noise(inputs, noise_level)
|
58 |
while queue.qsize() >= queue_threshold:
|
59 |
time.sleep(2)
|
60 |
queue.put(prompt_with_noise)
|
61 |
+
output2 = proc1(prompt_with_noise)
|
62 |
return output2
|
63 |
|
64 |
#def send_it3(inputs, noise_level, proc1=proc1):
|
|
|
124 |
|
125 |
with gr.Row():
|
126 |
with gr.Row():
|
127 |
+
noise_level = gr.Slider(minimum=0.0, maximum=3, step=0.1, label="Noise Level")
|
|
|
128 |
with gr.Row():
|
129 |
with gr.Row():
|
130 |
output1=gr.Image(label="Dreamlike-photoreal-2.0",show_label=False)
|
|
|
134 |
#output1=gr.Image()
|
135 |
|
136 |
see_prompts.click(get_prompts, inputs=[input_text], outputs=[prompt], queue=False)
|
137 |
+
run.click(send_it1, inputs=[prompt, noise_level], outputs=[output1])
|
138 |
+
run.click(send_it2, inputs=[prompt, noise_level], outputs=[output2])
|
139 |
|
140 |
|
141 |
|