Update app.py
Browse files
app.py
CHANGED
@@ -206,21 +206,7 @@ def process_and_show_prompt(image1, image2, image3, prompt):
|
|
206 |
logger.exception("์ฒ๋ฆฌ ์ค ์ค๋ฅ ๋ฐ์:")
|
207 |
return None, f"์ค๋ฅ ๋ฐ์: {str(e)}", prompt
|
208 |
|
209 |
-
#
|
210 |
-
gr.Markdown("## Try these examples", elem_classes="gr-examples-header")
|
211 |
-
|
212 |
-
examples = [
|
213 |
-
["down/1_in-1.png", "#1 ์ด๋ฏธ์ง์ [์ฒญ์ ์์ด๋ ๊ณ ๋ฅผ ๊ฒ์ ๊ณ ๋๋ ๊ณ ]์ผ๋ก ๋ณ๊ฒฝํ๋ผ.", ""],
|
214 |
-
["down/2_in-1.png", "#1 ์ด๋ฏธ์ง์ [์ค๊ตญ์ด๋ฅผ ๋ชจ๋]๋ฅผ ์ ๊ฑฐํ๋ผ.", ""],
|
215 |
-
]
|
216 |
-
|
217 |
-
gr.Examples(
|
218 |
-
examples=examples,
|
219 |
-
inputs=[image_input, prompt_input],
|
220 |
-
elem_id="examples-grid"
|
221 |
-
)
|
222 |
-
|
223 |
-
# ๊ธฐ์กด Gradio ์ธํฐํ์ด์ค ๊ตฌ์ฑ (์์ ์ ์ฉ ์ธ ๋ค๋ฅธ ์ฝ๋๋ ๊ทธ๋๋ก ์ ์ง)
|
224 |
with gr.Blocks() as demo:
|
225 |
gr.HTML(
|
226 |
"""
|
@@ -256,7 +242,9 @@ with gr.Blocks() as demo:
|
|
256 |
label="Gemini Output",
|
257 |
placeholder="Text response will appear here if no image is generated."
|
258 |
)
|
|
|
259 |
|
|
|
260 |
gr.Markdown("## Try these examples", elem_classes="gr-examples-header")
|
261 |
|
262 |
examples = [
|
@@ -269,5 +257,11 @@ with gr.Blocks() as demo:
|
|
269 |
inputs=[image_input, prompt_input],
|
270 |
elem_id="examples-grid"
|
271 |
)
|
|
|
|
|
|
|
|
|
|
|
|
|
272 |
|
273 |
demo.queue(max_size=50).launch()
|
|
|
206 |
logger.exception("์ฒ๋ฆฌ ์ค ์ค๋ฅ ๋ฐ์:")
|
207 |
return None, f"์ค๋ฅ ๋ฐ์: {str(e)}", prompt
|
208 |
|
209 |
+
# Gradio ์ธํฐํ์ด์ค๋ฅผ ํ๋์ Blocks()๋ก ๊ตฌ์ฑ
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
210 |
with gr.Blocks() as demo:
|
211 |
gr.HTML(
|
212 |
"""
|
|
|
242 |
label="Gemini Output",
|
243 |
placeholder="Text response will appear here if no image is generated."
|
244 |
)
|
245 |
+
prompt_display = gr.Textbox(label="Used Prompt (English)", visible=True)
|
246 |
|
247 |
+
# ์์ ์คํ ์ ์๋์ผ๋ก image_input ๋ฐ prompt_input์ ๊ฐ ์ฑ์์ง
|
248 |
gr.Markdown("## Try these examples", elem_classes="gr-examples-header")
|
249 |
|
250 |
examples = [
|
|
|
257 |
inputs=[image_input, prompt_input],
|
258 |
elem_id="examples-grid"
|
259 |
)
|
260 |
+
|
261 |
+
submit_btn.click(
|
262 |
+
fn=process_and_show_prompt,
|
263 |
+
inputs=[image_input, None, None, prompt_input],
|
264 |
+
outputs=[output_gallery, output_text, prompt_display],
|
265 |
+
)
|
266 |
|
267 |
demo.queue(max_size=50).launch()
|