root commited on
Commit
c88fef3
1 Parent(s): 4362651

add moveImageFromGallery

Browse files
Files changed (2) hide show
  1. app.py +2 -2
  2. ui_functions.py +3 -3
app.py CHANGED
@@ -407,7 +407,7 @@ if __name__ == "__main__":
407
 
408
  output_txt2img_copy_to_input_btn.click(
409
  uifn.copy_img_to_input,
410
- gallery,
411
  [img2img_image_editor, img2img_image_mask, tabs],
412
  _js=call_JS("moveImageFromGallery",
413
  fromId="txt2img_gallery_output",
@@ -415,7 +415,7 @@ if __name__ == "__main__":
415
  )
416
  output_txt2img_copy_to_input_btn.click(
417
  uifn.copy_img_to_input,
418
- gallery,
419
  [img2img_image_editor, img2img_image_mask, tabs],
420
  )
421
 
 
407
 
408
  output_txt2img_copy_to_input_btn.click(
409
  uifn.copy_img_to_input,
410
+ [gallery],
411
  [img2img_image_editor, img2img_image_mask, tabs],
412
  _js=call_JS("moveImageFromGallery",
413
  fromId="txt2img_gallery_output",
 
415
  )
416
  output_txt2img_copy_to_input_btn.click(
417
  uifn.copy_img_to_input,
418
+ [gallery],
419
  [img2img_image_editor, img2img_image_mask, tabs],
420
  )
421
 
ui_functions.py CHANGED
@@ -78,9 +78,9 @@ def copy_img_params_to_lab(params):
78
  return [None, None]
79
  def copy_img_to_input(img):
80
  try:
81
- print(img)
82
- print(type(img))
83
- image_data = re.sub('^data:image/.+;base64,', '', img)
84
  processed_image = Image.open(BytesIO(base64.b64decode(image_data)))
85
  tab_update = gr.update(selected='img2img_tab')
86
  img_update = gr.update(value=processed_image)
 
78
  return [None, None]
79
  def copy_img_to_input(img):
80
  try:
81
+ # print(img)
82
+ print(type(img[0]))
83
+ image_data = re.sub('^data:image/.+;base64,', '', img[0])
84
  processed_image = Image.open(BytesIO(base64.b64decode(image_data)))
85
  tab_update = gr.update(selected='img2img_tab')
86
  img_update = gr.update(value=processed_image)