Spaces:
Runtime error
Runtime error
Commit
·
4f3a8eb
1
Parent(s):
9edde8e
update
Browse files
app.py
CHANGED
@@ -90,6 +90,13 @@ def fill_image(prompt, image, model_selection):
|
|
90 |
def clear_result():
|
91 |
return gr.update(value=None)
|
92 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
93 |
|
94 |
#css = """
|
95 |
#.gradio-container {
|
@@ -134,6 +141,7 @@ with gr.Blocks(fill_width=True) as demo:
|
|
134 |
inputs=[prompt, input_image, model_selection],
|
135 |
outputs=result,
|
136 |
)
|
|
|
137 |
|
138 |
|
139 |
demo.launch(share=False)
|
|
|
90 |
def clear_result():
|
91 |
return gr.update(value=None)
|
92 |
|
93 |
+
def resize(image):
|
94 |
+
print(f"resize image={image}")
|
95 |
+
image.thumbnail(size, Image.LANCZOS)
|
96 |
+
print(f"resized image={image}")
|
97 |
+
return image
|
98 |
+
|
99 |
+
|
100 |
|
101 |
#css = """
|
102 |
#.gradio-container {
|
|
|
141 |
inputs=[prompt, input_image, model_selection],
|
142 |
outputs=result,
|
143 |
)
|
144 |
+
input_image.upload(fn=resize, inputs=input_image, outputs=input_image)
|
145 |
|
146 |
|
147 |
demo.launch(share=False)
|