celinah HF Staff commited on
Commit
dcebda0
·
1 Parent(s): b50cf46
Files changed (1) hide show
  1. app.py +11 -5
app.py CHANGED
@@ -172,11 +172,17 @@ with gr.Blocks(css=css) as demo:
172
  outputs=[download_btn],
173
  )
174
 
175
- gr.Interface(
176
- fn=download_image_locally,
177
- inputs=[gr.Text(label="Image URL"), gr.Text(label="Filename")],
178
- outputs=[gr.File()],
179
- )
 
 
 
 
 
 
180
 
181
 
182
  if __name__ == "__main__":
 
172
  outputs=[download_btn],
173
  )
174
 
175
+ with gr.Accordion("Download Image from URL", open=False):
176
+ image_url_input = gr.Text(label="Image URL", placeholder="Enter image URL (e.g., http://.../image.png)")
177
+ filename_input = gr.Text(label="Filename (optional)", placeholder="downloaded_image.png")
178
+ download_from_url_btn = gr.Button("Download Image")
179
+ downloaded_file_output = gr.File(label="Downloaded File")
180
+
181
+ download_from_url_btn.click(
182
+ fn=download_image_locally,
183
+ inputs=[image_url_input, filename_input],
184
+ outputs=[downloaded_file_output],
185
+ )
186
 
187
 
188
  if __name__ == "__main__":