Spaces:
Runtime error
Runtime error
Update app.py
Browse files
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.
|
| 78 |
-
examples
|
| 79 |
-
|
| 80 |
-
|
| 81 |
-
|
| 82 |
-
|
| 83 |
-
|
| 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 |
|