akhaliq HF Staff commited on
Commit
b63acaf
·
verified ·
1 Parent(s): c031c97

Update app.py from anycoder

Browse files
Files changed (1) hide show
  1. app.py +5 -5
app.py CHANGED
@@ -351,7 +351,7 @@ textarea:focus-visible {
351
  }
352
  """
353
 
354
- # Create the Gradio interface
355
  with gr.Blocks() as demo:
356
 
357
  # Hero Section
@@ -379,14 +379,13 @@ with gr.Blocks() as demo:
379
  size="lg"
380
  )
381
 
382
- # Output Card
383
  with gr.Column(elem_classes="output-card"):
384
  output_image = gr.Image(
385
  label="Generated Image",
386
  type="pil",
387
  show_label=False,
388
- show_download_button=True,
389
- show_share_button=True,
390
  container=False
391
  )
392
 
@@ -399,7 +398,7 @@ with gr.Blocks() as demo:
399
  </div>
400
  """)
401
 
402
- # Event handlers
403
  generate_btn.click(
404
  fn=generate_image,
405
  inputs=[prompt],
@@ -414,6 +413,7 @@ with gr.Blocks() as demo:
414
  api_visibility="public"
415
  )
416
 
 
417
  if __name__ == "__main__":
418
  demo.launch(
419
  theme=gr.themes.Soft(
 
351
  }
352
  """
353
 
354
+ # Create the Gradio interface - Gradio 6 syntax: NO parameters in gr.Blocks()!
355
  with gr.Blocks() as demo:
356
 
357
  # Hero Section
 
379
  size="lg"
380
  )
381
 
382
+ # Output Card - Gradio 6: Use 'buttons' parameter instead of show_download_button/show_share_button
383
  with gr.Column(elem_classes="output-card"):
384
  output_image = gr.Image(
385
  label="Generated Image",
386
  type="pil",
387
  show_label=False,
388
+ buttons=["download", "share"], # Gradio 6 syntax
 
389
  container=False
390
  )
391
 
 
398
  </div>
399
  """)
400
 
401
+ # Event handlers - Gradio 6: use api_visibility parameter
402
  generate_btn.click(
403
  fn=generate_image,
404
  inputs=[prompt],
 
413
  api_visibility="public"
414
  )
415
 
416
+ # Gradio 6: ALL app parameters go in demo.launch()!
417
  if __name__ == "__main__":
418
  demo.launch(
419
  theme=gr.themes.Soft(