Update app.py
Browse files
app.py
CHANGED
@@ -27,7 +27,10 @@ def divisible_by_8(image):
|
|
27 |
return resized_image
|
28 |
|
29 |
|
30 |
-
def generate(image_editor, prompt, neg_prompt):
|
|
|
|
|
|
|
31 |
image = image_editor['background'].convert('RGB')
|
32 |
image.thumbnail((1024, 1024))
|
33 |
image = divisible_by_8(image)
|
@@ -47,7 +50,7 @@ def generate(image_editor, prompt, neg_prompt):
|
|
47 |
|
48 |
final_image = final_image.crop((0, 0, original_image_size[0], original_image_size[1]))
|
49 |
|
50 |
-
return image_editor, image, mask, final_image
|
51 |
|
52 |
with gr.Blocks() as demo:
|
53 |
gr.Markdown("""
|
@@ -72,6 +75,6 @@ with gr.Blocks() as demo:
|
|
72 |
out2 = gr.Image(format='png')
|
73 |
out3 = gr.Image(format='png')
|
74 |
|
75 |
-
generate_button.click(fn=generate, inputs=[sketch_pad,prompt, neg_prompt], outputs=[sketch_pad, out1, out2, out3])
|
76 |
|
77 |
demo.launch()
|
|
|
27 |
return resized_image
|
28 |
|
29 |
|
30 |
+
def generate(image_editor, prompt, neg_prompt, versions):
|
31 |
+
print('versions')
|
32 |
+
print(versions)
|
33 |
+
|
34 |
image = image_editor['background'].convert('RGB')
|
35 |
image.thumbnail((1024, 1024))
|
36 |
image = divisible_by_8(image)
|
|
|
50 |
|
51 |
final_image = final_image.crop((0, 0, original_image_size[0], original_image_size[1]))
|
52 |
|
53 |
+
return image_editor, image, mask, final_image, [final_image]
|
54 |
|
55 |
with gr.Blocks() as demo:
|
56 |
gr.Markdown("""
|
|
|
75 |
out2 = gr.Image(format='png')
|
76 |
out3 = gr.Image(format='png')
|
77 |
|
78 |
+
generate_button.click(fn=generate, inputs=[sketch_pad,prompt, neg_prompt, version_gallery], outputs=[sketch_pad, out1, out2, out3, version_gallery])
|
79 |
|
80 |
demo.launch()
|