WonwoongCho commited on
Commit
dda2a27
·
1 Parent(s): f52c90a

debugging app.py

Browse files
Files changed (1) hide show
  1. app.py +7 -7
app.py CHANGED
@@ -23,7 +23,7 @@ pipe = pipe.to("cuda")
23
 
24
 
25
  @spaces.GPU
26
- def process_image_and_text(image, text, seed, scale):
27
  set_seed(seed)
28
  image = resize_and_add_margin(image, target_size=512)
29
  image_list = [image]
@@ -131,13 +131,13 @@ def create_app():
131
  gr.Markdown(header, elem_id="header")
132
  with gr.Row(equal_height=False):
133
  with gr.Column(variant="panel", elem_classes="inputPanel"):
134
- original_image = gr.Image(
135
  type="pil", label="Condition Image", width=300, elem_id="input"
136
  )
137
 
138
- scale = gr.Slider(minimum=0.0, maximum=1.0, step=0.01, value=0.6, label="Guidance Scale")
139
- seed = gr.Number(value=42, label="seed", precision=0)
140
- text = gr.Textbox(
141
  lines=2,
142
  label="Text Prompt",
143
  value="A photo of a dragon, imaginative, creative, design",
@@ -153,13 +153,13 @@ def create_app():
153
  with gr.Row():
154
  examples = gr.Examples(
155
  examples=get_samples(),
156
- inputs=[original_image, text, seed, scale],
157
  label="Examples",
158
  )
159
 
160
  submit_btn.click(
161
  fn=process_image_and_text,
162
- inputs=[original_image, text, seed, scale],
163
  outputs=output_image,
164
  )
165
 
 
23
 
24
 
25
  @spaces.GPU
26
+ def process_image_and_text(image, scale, seed, text):
27
  set_seed(seed)
28
  image = resize_and_add_margin(image, target_size=512)
29
  image_list = [image]
 
131
  gr.Markdown(header, elem_id="header")
132
  with gr.Row(equal_height=False):
133
  with gr.Column(variant="panel", elem_classes="inputPanel"):
134
+ original_image_input = gr.Image(
135
  type="pil", label="Condition Image", width=300, elem_id="input"
136
  )
137
 
138
+ scale_input = gr.Slider(minimum=0.0, maximum=1.0, step=0.01, value=0.6, label="Guidance Scale")
139
+ seed_input = gr.Number(value=42, label="seed", precision=0)
140
+ text_input = gr.Textbox(
141
  lines=2,
142
  label="Text Prompt",
143
  value="A photo of a dragon, imaginative, creative, design",
 
153
  with gr.Row():
154
  examples = gr.Examples(
155
  examples=get_samples(),
156
+ inputs=[original_image_input, scale_input, seed_input, text_input],
157
  label="Examples",
158
  )
159
 
160
  submit_btn.click(
161
  fn=process_image_and_text,
162
+ inputs=[original_image_input, scale_input, seed_input, text_input],
163
  outputs=output_image,
164
  )
165