fantaxy commited on
Commit
0dc0c33
โ€ข
1 Parent(s): 744bb8d

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +10 -9
app.py CHANGED
@@ -67,21 +67,22 @@ examples = [
67
  ["A fantasy map of a fictional world, with detailed terrain and cities.", "q19.webp"]
68
  ]
69
 
70
-
71
  with gr.Blocks(theme="Nymbo/Nymbo_Theme", css=css) as demo:
 
72
 
73
  with gr.Row():
74
  input_text = gr.Textbox(label="Enter your prompt for image generation")
75
  output_image = gr.Image(label="Generated Image")
76
 
77
- gr.Examples(
78
- examples,
79
- inputs=input_text,
80
- outputs=output_image,
81
- fn=respond,
82
- cache_examples=False,
83
- label="Example Prompts and Images"
84
- )
 
85
 
86
  input_text.submit(fn=respond, inputs=input_text, outputs=output_image)
87
 
 
67
  ["A fantasy map of a fictional world, with detailed terrain and cities.", "q19.webp"]
68
  ]
69
 
 
70
  with gr.Blocks(theme="Nymbo/Nymbo_Theme", css=css) as demo:
71
+ gr.Markdown("# Image Generation with Examples")
72
 
73
  with gr.Row():
74
  input_text = gr.Textbox(label="Enter your prompt for image generation")
75
  output_image = gr.Image(label="Generated Image")
76
 
77
+ with gr.Row():
78
+ for prompt, image_file in examples:
79
+ with gr.Column():
80
+ gr.Image(image_file, label=prompt[:50] + "...") # ํ”„๋กฌํ”„ํŠธ์˜ ์ฒ˜์Œ 50์ž๋งŒ ํ‘œ์‹œ
81
+ gr.Button("Use this prompt").click(
82
+ fn=lambda p=prompt: input_text.update(value=p),
83
+ inputs=[],
84
+ outputs=[input_text]
85
+ )
86
 
87
  input_text.submit(fn=respond, inputs=input_text, outputs=output_image)
88