kadirnar commited on
Commit
b7db3a7
1 Parent(s): 37600fe

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +8 -11
app.py CHANGED
@@ -269,8 +269,8 @@ with gr.Blocks(css=css) as demo:
269
  )
270
  with gr.TabItem("Image to Image"):
271
  with gr.Group():
272
- with gr.Row():
273
- with gr.Column():
274
  img2img_prompt = gr.Text(
275
  label="Prompt",
276
  show_label=False,
@@ -278,13 +278,11 @@ with gr.Blocks(css=css) as demo:
278
  placeholder="Enter your prompt",
279
  container=False,
280
  )
281
- init_image = gr.Image(label="Input Image", type="pil", height=512, width=512)
282
- with gr.Column():
283
- img2img_output = gr.Gallery(label="Result", elem_id="gallery", show_label=False)
284
- with gr.Row():
285
- img2img_run_button = gr.Button("Generate", scale=1)
286
-
287
- strength = gr.Slider(label="Img2Img Strength", minimum=0.0, maximum=1.0, step=0.01, value=0.8)
288
  with gr.Accordion("Advanced options", open=False):
289
  with gr.Row():
290
  img2img_use_negative_prompt = gr.Checkbox(label="Use negative prompt", value=True)
@@ -324,6 +322,7 @@ with gr.Blocks(css=css) as demo:
324
  step=0.1,
325
  value=7.0,
326
  )
 
327
 
328
  img2img_use_negative_prompt.change(
329
  fn=lambda x: gr.update(visible=x),
@@ -354,7 +353,5 @@ with gr.Blocks(css=css) as demo:
354
  outputs=[img2img_output],
355
  api_name="img2img_run",
356
  )
357
-
358
-
359
  if __name__ == "__main__":
360
  demo.queue().launch()
 
269
  )
270
  with gr.TabItem("Image to Image"):
271
  with gr.Group():
272
+ with gr.Row(equal_height=True):
273
+ with gr.Column(scale=1):
274
  img2img_prompt = gr.Text(
275
  label="Prompt",
276
  show_label=False,
 
278
  placeholder="Enter your prompt",
279
  container=False,
280
  )
281
+ init_image = gr.Image(label="Input Image", type="pil", height=512, width=512, interactive=True, source="upload", tool="editor")
282
+ with gr.Row():
283
+ img2img_run_button = gr.Button("Generate", variant="primary", scale=1, full_width=True)
284
+ with gr.Column(scale=1):
285
+ img2img_output = gr.Gallery(label="Result", elem_id="gallery", show_label=False, height=512, width=512).style(grid=[2, 2], height="auto")
 
 
286
  with gr.Accordion("Advanced options", open=False):
287
  with gr.Row():
288
  img2img_use_negative_prompt = gr.Checkbox(label="Use negative prompt", value=True)
 
322
  step=0.1,
323
  value=7.0,
324
  )
325
+ strength = gr.Slider(label="Img2Img Strength", minimum=0.0, maximum=1.0, step=0.01, value=0.8)
326
 
327
  img2img_use_negative_prompt.change(
328
  fn=lambda x: gr.update(visible=x),
 
353
  outputs=[img2img_output],
354
  api_name="img2img_run",
355
  )
 
 
356
  if __name__ == "__main__":
357
  demo.queue().launch()