Yaron Koresh commited on
Commit
694a055
·
verified ·
1 Parent(s): 0e7bcb8

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +5 -4
app.py CHANGED
@@ -104,6 +104,7 @@ def limiter(txt):
104
  return txt[:38]
105
 
106
  with gr.Blocks(theme=gr.themes.Soft(),css=css) as demo:
 
107
  with gr.Column(elem_id="col-container"):
108
  gr.Markdown(f"""
109
  # Image Generator
@@ -111,6 +112,7 @@ with gr.Blocks(theme=gr.themes.Soft(),css=css) as demo:
111
  """)
112
  with gr.Row():
113
  prompt = gr.Textbox(
 
114
  placeholder="Describe the photo",
115
  container=False,
116
  rtl=True,
@@ -119,11 +121,10 @@ with gr.Blocks(theme=gr.themes.Soft(),css=css) as demo:
119
  with gr.Row():
120
  run_button = gr.Button("Run")
121
  result = gr.Image(elem_id="image-container", label="Result", show_label=False, type='filepath')
122
- prompt.input(
123
  fn = limiter,
124
- inputs = [prompt],
125
- outputs = [prompt],
126
- concurrency_limit = None,
127
  show_progress = "hidden"
128
  )
129
  run_button.click(
 
104
  return txt[:38]
105
 
106
  with gr.Blocks(theme=gr.themes.Soft(),css=css) as demo:
107
+ prompt_value = gr.State("")
108
  with gr.Column(elem_id="col-container"):
109
  gr.Markdown(f"""
110
  # Image Generator
 
112
  """)
113
  with gr.Row():
114
  prompt = gr.Textbox(
115
+ value=prompt_value,
116
  placeholder="Describe the photo",
117
  container=False,
118
  rtl=True,
 
121
  with gr.Row():
122
  run_button = gr.Button("Run")
123
  result = gr.Image(elem_id="image-container", label="Result", show_label=False, type='filepath')
124
+ prompt_value.input(
125
  fn = limiter,
126
+ inputs = [prompt_value],
127
+ outputs = [prompt_value],
 
128
  show_progress = "hidden"
129
  )
130
  run_button.click(