Update app.py
Browse files
app.py
CHANGED
@@ -30,6 +30,11 @@ def divisible_by_8(image):
|
|
30 |
return resized_image
|
31 |
|
32 |
|
|
|
|
|
|
|
|
|
|
|
33 |
def generate(image_editor, prompt, neg_prompt, versions):
|
34 |
print('versions')
|
35 |
print(versions)
|
@@ -89,5 +94,6 @@ with gr.Blocks() as demo:
|
|
89 |
|
90 |
version_gallery.select(get_select_index, None, selected)
|
91 |
generate_button.click(fn=generate, inputs=[sketch_pad,prompt, neg_prompt, version_gallery], outputs=[sketch_pad, out1, out2, out3, version_gallery])
|
|
|
92 |
|
93 |
demo.launch()
|
|
|
30 |
return resized_image
|
31 |
|
32 |
|
33 |
+
def restore_version(index, versions):
|
34 |
+
final_dict = {'background': versions[index], 'layers': None, 'composite': versions[index]}
|
35 |
+
return final_dict
|
36 |
+
|
37 |
+
|
38 |
def generate(image_editor, prompt, neg_prompt, versions):
|
39 |
print('versions')
|
40 |
print(versions)
|
|
|
94 |
|
95 |
version_gallery.select(get_select_index, None, selected)
|
96 |
generate_button.click(fn=generate, inputs=[sketch_pad,prompt, neg_prompt, version_gallery], outputs=[sketch_pad, out1, out2, out3, version_gallery])
|
97 |
+
restore_button.click(fn=restore_version, inputs=[selected, version_gallery], outputs=sketch_pad)
|
98 |
|
99 |
demo.launch()
|