Spaces:
Running
Running
Linoy Tsaban
commited on
Commit
•
36d95bc
1
Parent(s):
23c49e0
Update app.py
Browse files
app.py
CHANGED
@@ -294,6 +294,12 @@ with gr.Blocks(css="style.css") as demo:
|
|
294 |
def display_editing_options(run_button, clear_button, sega_tab):
|
295 |
return run_button.update(visible=True), clear_button.update(visible=True), sega_tab.update(visible=True)
|
296 |
|
|
|
|
|
|
|
|
|
|
|
|
|
297 |
# def update_gallery_display(prev_output_image, sega_edited_image):
|
298 |
# if prev_output_image is None:
|
299 |
# return sega_edited_image, gallery.update(visible=True), sega_edited_image
|
@@ -634,6 +640,11 @@ with gr.Blocks(css="style.css") as demo:
|
|
634 |
reconstruct_button],
|
635 |
outputs = [ddpm_edited_image,reconstruction, ddpm_edited_image, do_reconstruction, reconstruct_button])
|
636 |
|
|
|
|
|
|
|
|
|
|
|
637 |
randomize_seed.change(
|
638 |
fn = randomize_seed_fn,
|
639 |
inputs = [seed, randomize_seed],
|
|
|
294 |
def display_editing_options(run_button, clear_button, sega_tab):
|
295 |
return run_button.update(visible=True), clear_button.update(visible=True), sega_tab.update(visible=True)
|
296 |
|
297 |
+
def update_edit_concept(concept, edit_concept, add):
|
298 |
+
if add == "Clear":
|
299 |
+
return edit_concept
|
300 |
+
else:
|
301 |
+
return concept
|
302 |
+
|
303 |
# def update_gallery_display(prev_output_image, sega_edited_image):
|
304 |
# if prev_output_image is None:
|
305 |
# return sega_edited_image, gallery.update(visible=True), sega_edited_image
|
|
|
640 |
reconstruct_button],
|
641 |
outputs = [ddpm_edited_image,reconstruction, ddpm_edited_image, do_reconstruction, reconstruct_button])
|
642 |
|
643 |
+
|
644 |
+
edit_concept_1.change(fn=update_edit_concept, inputs = [concept_1, edit_concept_1, add_1], outputs = [concept_1])
|
645 |
+
edit_concept_2.change(fn=update_edit_concept, inputs = [concept_2, edit_concept_2, add_2], outputs = [concept_2])
|
646 |
+
edit_concept_3.change(fn=update_edit_concept, inputs = [concept_3, edit_concept_3, add_3], outputs = [concept_3])
|
647 |
+
|
648 |
randomize_seed.change(
|
649 |
fn = randomize_seed_fn,
|
650 |
inputs = [seed, randomize_seed],
|