Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
|
@@ -67,6 +67,9 @@ examples = [
|
|
| 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 |
|
|
@@ -79,9 +82,15 @@ with gr.Blocks(theme="Nymbo/Nymbo_Theme", css=css) as demo:
|
|
| 79 |
with gr.Column():
|
| 80 |
gr.Image(image_file, label=prompt[:50] + "...") # ν둬ννΈμ μ²μ 50μλ§ νμ
|
| 81 |
gr.Button("Use this prompt").click(
|
| 82 |
-
fn=
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 83 |
inputs=[],
|
| 84 |
-
outputs=
|
| 85 |
)
|
| 86 |
|
| 87 |
input_text.submit(fn=respond, inputs=input_text, outputs=output_image)
|
|
|
|
| 67 |
["A fantasy map of a fictional world, with detailed terrain and cities.", "q19.webp"]
|
| 68 |
]
|
| 69 |
|
| 70 |
+
def use_prompt(prompt):
|
| 71 |
+
return prompt
|
| 72 |
+
|
| 73 |
with gr.Blocks(theme="Nymbo/Nymbo_Theme", css=css) as demo:
|
| 74 |
gr.Markdown("# Image Generation with Examples")
|
| 75 |
|
|
|
|
| 82 |
with gr.Column():
|
| 83 |
gr.Image(image_file, label=prompt[:50] + "...") # ν둬ννΈμ μ²μ 50μλ§ νμ
|
| 84 |
gr.Button("Use this prompt").click(
|
| 85 |
+
fn=use_prompt,
|
| 86 |
+
inputs=[],
|
| 87 |
+
outputs=input_text,
|
| 88 |
+
_js="(x) => x",
|
| 89 |
+
api_name=False
|
| 90 |
+
).then(
|
| 91 |
+
fn=lambda: prompt,
|
| 92 |
inputs=[],
|
| 93 |
+
outputs=input_text
|
| 94 |
)
|
| 95 |
|
| 96 |
input_text.submit(fn=respond, inputs=input_text, outputs=output_image)
|