Linoy Tsaban
commited on
Commit
•
033681c
1
Parent(s):
e2d7d01
Update app.py
Browse files
app.py
CHANGED
@@ -73,10 +73,9 @@ def get_example():
|
|
73 |
100,
|
74 |
36,
|
75 |
15,
|
76 |
-
'
|
77 |
5.5,
|
78 |
1,
|
79 |
-
'examples/ddpm_watercolor_painting_a_cat_sitting_next_to_a_mirror.png',
|
80 |
'examples/ddpm_sega_watercolor_painting_a_cat_sitting_next_to_a_mirror_plus_dog_minus_cat.png'
|
81 |
],
|
82 |
[
|
@@ -86,10 +85,9 @@ def get_example():
|
|
86 |
100,
|
87 |
36,
|
88 |
15,
|
89 |
-
'
|
90 |
10,
|
91 |
1,
|
92 |
-
'examples/ddpm_a_robot_wearing_a_brown_hoodie_in_a_crowded_street.png',
|
93 |
'examples/ddpm_sega_painting_of_a_robot_wearing_a_brown_hoodie_in_a_crowded_street.png'
|
94 |
],
|
95 |
[
|
@@ -99,10 +97,9 @@ def get_example():
|
|
99 |
100,
|
100 |
36,
|
101 |
15,
|
102 |
-
'
|
103 |
10,
|
104 |
1,
|
105 |
-
'examples/ddpm_wall_with_framed_photos.png',
|
106 |
'examples/ddpm_sega_plus_pink_drawings_of_muffins.png'
|
107 |
],
|
108 |
[
|
@@ -112,10 +109,9 @@ def get_example():
|
|
112 |
100,
|
113 |
36,
|
114 |
17,
|
115 |
-
'
|
116 |
10,
|
117 |
1,
|
118 |
-
'examples/ddpm_glass_walls.png',
|
119 |
'examples/ddpm_sega_glass_walls_gian_elephant.png'
|
120 |
]]
|
121 |
return case
|
@@ -248,7 +244,7 @@ with gr.Blocks(css='style.css') as demo:
|
|
248 |
# tar_prompt = gr.Textbox(lines=1, label="Target Prompt", interactive=True, placeholder="")
|
249 |
neg_guidance_1 = gr.Checkbox(
|
250 |
label='Negative Guidance')
|
251 |
-
warmup_1 = gr.Slider(label='Warmup', minimum=0, maximum=50, value=
|
252 |
guidnace_scale_1 = gr.Slider(label='Scale', minimum=1, maximum=10, value=5, step=0.25, interactive=True)
|
253 |
threshold_1 = gr.Slider(label='Threshold', minimum=0.5, maximum=0.99, value=0.95, steps=0.01, interactive=True)
|
254 |
edit_concept_1 = gr.Textbox(
|
@@ -263,8 +259,8 @@ with gr.Blocks(css='style.css') as demo:
|
|
263 |
# tar_prompt = gr.Textbox(lines=1, label="Target Prompt", interactive=True, placeholder="")
|
264 |
neg_guidance_2 = gr.Checkbox(
|
265 |
label='Negative Guidance',visible=True)
|
266 |
-
warmup_2 = gr.Slider(label='Warmup', minimum=0, maximum=50, value=
|
267 |
-
guidnace_scale_2 = gr.Slider(label='Scale', minimum=1, maximum=10, value=
|
268 |
threshold_2 = gr.Slider(label='Threshold', minimum=0.5, maximum=0.99, value=0.95, steps=0.01,visible=True, interactive=True)
|
269 |
edit_concept_2 = gr.Textbox(
|
270 |
label="Edit Concept",
|
@@ -278,8 +274,8 @@ with gr.Blocks(css='style.css') as demo:
|
|
278 |
# tar_prompt = gr.Textbox(lines=1, label="Target Prompt", interactive=True, placeholder="")
|
279 |
neg_guidance_3 = gr.Checkbox(
|
280 |
label='Negative Guidance',visible=True)
|
281 |
-
warmup_3 = gr.Slider(label='Warmup', minimum=0, maximum=50, value=
|
282 |
-
guidnace_scale_3 = gr.Slider(label='Scale', minimum=1, maximum=10, value=
|
283 |
threshold_3 = gr.Slider(label='Threshold', minimum=0.5, maximum=0.99, value=0.95, steps=0.01,visible=True, interactive=True)
|
284 |
edit_concept_3 = gr.Textbox(
|
285 |
label="Edit Concept",
|
@@ -361,23 +357,24 @@ with gr.Blocks(css='style.css') as demo:
|
|
361 |
outputs = [do_inversion]
|
362 |
)
|
363 |
|
364 |
-
|
365 |
-
|
366 |
-
|
367 |
-
|
368 |
-
|
369 |
-
|
370 |
-
|
371 |
-
|
372 |
-
|
373 |
-
|
374 |
-
|
375 |
-
|
376 |
-
|
377 |
-
|
378 |
-
|
379 |
-
|
380 |
-
|
|
|
381 |
|
382 |
|
383 |
|
|
|
73 |
100,
|
74 |
36,
|
75 |
15,
|
76 |
+
'Schnauzer dog', 'cat',
|
77 |
5.5,
|
78 |
1,
|
|
|
79 |
'examples/ddpm_sega_watercolor_painting_a_cat_sitting_next_to_a_mirror_plus_dog_minus_cat.png'
|
80 |
],
|
81 |
[
|
|
|
85 |
100,
|
86 |
36,
|
87 |
15,
|
88 |
+
'painting','',
|
89 |
10,
|
90 |
1,
|
|
|
91 |
'examples/ddpm_sega_painting_of_a_robot_wearing_a_brown_hoodie_in_a_crowded_street.png'
|
92 |
],
|
93 |
[
|
|
|
97 |
100,
|
98 |
36,
|
99 |
15,
|
100 |
+
'pink drawings of muffins','',
|
101 |
10,
|
102 |
1,
|
|
|
103 |
'examples/ddpm_sega_plus_pink_drawings_of_muffins.png'
|
104 |
],
|
105 |
[
|
|
|
109 |
100,
|
110 |
36,
|
111 |
17,
|
112 |
+
'giant elephant','',
|
113 |
10,
|
114 |
1,
|
|
|
115 |
'examples/ddpm_sega_glass_walls_gian_elephant.png'
|
116 |
]]
|
117 |
return case
|
|
|
244 |
# tar_prompt = gr.Textbox(lines=1, label="Target Prompt", interactive=True, placeholder="")
|
245 |
neg_guidance_1 = gr.Checkbox(
|
246 |
label='Negative Guidance')
|
247 |
+
warmup_1 = gr.Slider(label='Warmup', minimum=0, maximum=50, value=1, step=1, interactive=True)
|
248 |
guidnace_scale_1 = gr.Slider(label='Scale', minimum=1, maximum=10, value=5, step=0.25, interactive=True)
|
249 |
threshold_1 = gr.Slider(label='Threshold', minimum=0.5, maximum=0.99, value=0.95, steps=0.01, interactive=True)
|
250 |
edit_concept_1 = gr.Textbox(
|
|
|
259 |
# tar_prompt = gr.Textbox(lines=1, label="Target Prompt", interactive=True, placeholder="")
|
260 |
neg_guidance_2 = gr.Checkbox(
|
261 |
label='Negative Guidance',visible=True)
|
262 |
+
warmup_2 = gr.Slider(label='Warmup', minimum=0, maximum=50, value=1, step=1, visible=True,interactive=True)
|
263 |
+
guidnace_scale_2 = gr.Slider(label='Scale', minimum=1, maximum=10, value=10, step=0.25,visible=True, interactive=True)
|
264 |
threshold_2 = gr.Slider(label='Threshold', minimum=0.5, maximum=0.99, value=0.95, steps=0.01,visible=True, interactive=True)
|
265 |
edit_concept_2 = gr.Textbox(
|
266 |
label="Edit Concept",
|
|
|
274 |
# tar_prompt = gr.Textbox(lines=1, label="Target Prompt", interactive=True, placeholder="")
|
275 |
neg_guidance_3 = gr.Checkbox(
|
276 |
label='Negative Guidance',visible=True)
|
277 |
+
warmup_3 = gr.Slider(label='Warmup', minimum=0, maximum=50, value=1, step=1, visible=True,interactive=True)
|
278 |
+
guidnace_scale_3 = gr.Slider(label='Scale', minimum=1, maximum=10, value=10, step=0.25,visible=True, interactive=True)
|
279 |
threshold_3 = gr.Slider(label='Threshold', minimum=0.5, maximum=0.99, value=0.95, steps=0.01,visible=True, interactive=True)
|
280 |
edit_concept_3 = gr.Textbox(
|
281 |
label="Edit Concept",
|
|
|
357 |
outputs = [do_inversion]
|
358 |
)
|
359 |
|
360 |
+
gr.Examples(
|
361 |
+
label='Examples',
|
362 |
+
examples=get_example(),
|
363 |
+
inputs=[input_image, src_prompt, tar_prompt, steps,
|
364 |
+
# src_cfg_scale,
|
365 |
+
skip,
|
366 |
+
tar_cfg_scale,
|
367 |
+
edit_concept1,
|
368 |
+
edit_concept2,
|
369 |
+
guidnace_scale_1,
|
370 |
+
warmup_1,
|
371 |
+
# neg_guidance,
|
372 |
+
sega_edited_image
|
373 |
+
],
|
374 |
+
outputs=[sega_edited_image],
|
375 |
+
# fn=edit,
|
376 |
+
# cache_examples=True
|
377 |
+
)
|
378 |
|
379 |
|
380 |
|