Spaces:
Build error
Build error
Update app.py
Browse files
app.py
CHANGED
|
@@ -29,8 +29,8 @@ def infer(source_img, prompt, steps, seed, strength):
|
|
| 29 |
return image
|
| 30 |
|
| 31 |
# ฟังก์ชันสำหรับการอัปเดต prompt จากการคลิกปุ่ม
|
| 32 |
-
def update_prompt_textbox(
|
| 33 |
-
return
|
| 34 |
|
| 35 |
# เริ่มต้น context ของ Gradio Blocks
|
| 36 |
with gr.Blocks() as demo:
|
|
@@ -46,8 +46,8 @@ with gr.Blocks() as demo:
|
|
| 46 |
prompt_input = gr.Textbox(label="Prompt Input Text. 77 Token (Keyword or Symbol) Maximum")
|
| 47 |
|
| 48 |
# การกำหนดการทำงานเมื่อคลิกปุ่ม
|
| 49 |
-
button1.click(fn=update_prompt_textbox, inputs=[
|
| 50 |
-
button2.click(fn=update_prompt_textbox, inputs=[
|
| 51 |
|
| 52 |
# อินเทอร์เฟซสำหรับทำงานร่วมกับโมเดล
|
| 53 |
gr.Interface(
|
|
@@ -66,4 +66,3 @@ with gr.Blocks() as demo:
|
|
| 66 |
|
| 67 |
# แสดงผลในหน้าเว็บ
|
| 68 |
demo.launch()
|
| 69 |
-
|
|
|
|
| 29 |
return image
|
| 30 |
|
| 31 |
# ฟังก์ชันสำหรับการอัปเดต prompt จากการคลิกปุ่ม
|
| 32 |
+
def update_prompt_textbox(prompt_text):
|
| 33 |
+
return prompt_text
|
| 34 |
|
| 35 |
# เริ่มต้น context ของ Gradio Blocks
|
| 36 |
with gr.Blocks() as demo:
|
|
|
|
| 46 |
prompt_input = gr.Textbox(label="Prompt Input Text. 77 Token (Keyword or Symbol) Maximum")
|
| 47 |
|
| 48 |
# การกำหนดการทำงานเมื่อคลิกปุ่ม
|
| 49 |
+
button1.click(fn=update_prompt_textbox, inputs=[], outputs=prompt_input)
|
| 50 |
+
button2.click(fn=update_prompt_textbox, inputs=[], outputs=prompt_input)
|
| 51 |
|
| 52 |
# อินเทอร์เฟซสำหรับทำงานร่วมกับโมเดล
|
| 53 |
gr.Interface(
|
|
|
|
| 66 |
|
| 67 |
# แสดงผลในหน้าเว็บ
|
| 68 |
demo.launch()
|
|
|