linoyts HF staff commited on
Commit
c8a86fe
1 Parent(s): c655f3a

Update app.py

Browse files

add ImageEditor

Files changed (1) hide show
  1. app.py +2 -1
app.py CHANGED
@@ -168,6 +168,7 @@ def edit(input_image,
168
  seed_everything(seed)
169
 
170
  if do_inversion or randomize_seed:
 
171
  zs_tensor, wts_tensor = pipe.invert(
172
  image_path = input_image,
173
  source_prompt =src_prompt,
@@ -472,7 +473,7 @@ with gr.Blocks(css="style.css") as demo:
472
  image_caption = gr.State(value="")
473
 
474
  with gr.Row():
475
- input_image = gr.Image(label="Input Image", interactive=True, elem_id="input_image")
476
  ddpm_edited_image = gr.Image(label=f"Pure DDPM Inversion Image", interactive=False, visible=False)
477
  sega_edited_image = gr.Image(label=f"LEDITS Edited Image", interactive=False, elem_id="output_image")
478
 
 
168
  seed_everything(seed)
169
 
170
  if do_inversion or randomize_seed:
171
+ input_image = input_image["composite"]
172
  zs_tensor, wts_tensor = pipe.invert(
173
  image_path = input_image,
174
  source_prompt =src_prompt,
 
473
  image_caption = gr.State(value="")
474
 
475
  with gr.Row():
476
+ input_image = gr.ImageEditor(label="Input Image", elem_id="input_image", image_mode="RGB")
477
  ddpm_edited_image = gr.Image(label=f"Pure DDPM Inversion Image", interactive=False, visible=False)
478
  sega_edited_image = gr.Image(label=f"LEDITS Edited Image", interactive=False, elem_id="output_image")
479