Spaces:
Sleeping
Sleeping
Upload folder using huggingface_hub
Browse files
app.py
CHANGED
@@ -118,14 +118,20 @@ with gr.Blocks(css=css) as demo:
|
|
118 |
output_quality = gr.Checkbox(label='More Realistic', info='Note: If unchecked, the resulting image will have a more artistic flair.', value=True)
|
119 |
|
120 |
submit_button = gr.Button('Submit', variant='primary')
|
121 |
-
download_button = gr.DownloadButton(label='Download Image',
|
122 |
-
|
|
|
|
|
|
|
|
|
123 |
submit_button.click(
|
124 |
fn=inference,
|
125 |
inputs=[content_and_output, style_dropdown, style_strength_slider, output_quality],
|
126 |
outputs=[content_and_output]
|
127 |
).then(
|
128 |
-
fn=lambda:
|
|
|
|
|
129 |
outputs=[download_button]
|
130 |
)
|
131 |
|
|
|
118 |
output_quality = gr.Checkbox(label='More Realistic', info='Note: If unchecked, the resulting image will have a more artistic flair.', value=True)
|
119 |
|
120 |
submit_button = gr.Button('Submit', variant='primary')
|
121 |
+
download_button = gr.DownloadButton(label='Download Image', visible=False)
|
122 |
+
|
123 |
+
def save_image(img, filename='generated.jpg'):
|
124 |
+
img.save(filename)
|
125 |
+
return filename
|
126 |
+
|
127 |
submit_button.click(
|
128 |
fn=inference,
|
129 |
inputs=[content_and_output, style_dropdown, style_strength_slider, output_quality],
|
130 |
outputs=[content_and_output]
|
131 |
).then(
|
132 |
+
fn=lambda img: save_image(img)
|
133 |
+
).then(
|
134 |
+
fn=lambda: gr.update(visible=True, value='generated.jpg'),
|
135 |
outputs=[download_button]
|
136 |
)
|
137 |
|