Spaces:
Running
Running
root
commited on
Commit
·
d535072
1
Parent(s):
6e776e4
add moveImageFromGallery
Browse files- app.py +8 -8
- ui_functions.py +2 -0
app.py
CHANGED
|
@@ -405,19 +405,19 @@ if __name__ == "__main__":
|
|
| 405 |
)
|
| 406 |
|
| 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",
|
| 414 |
-
toId="img2img_mask")
|
| 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 |
|
| 422 |
output_img2img_copy_to_input_btn.click(
|
| 423 |
uifn.copy_img_to_edit,
|
|
|
|
| 405 |
)
|
| 406 |
|
| 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",
|
| 414 |
+
# toId="img2img_mask")
|
| 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 |
|
| 422 |
output_img2img_copy_to_input_btn.click(
|
| 423 |
uifn.copy_img_to_edit,
|
ui_functions.py
CHANGED
|
@@ -78,6 +78,8 @@ def copy_img_params_to_lab(params):
|
|
| 78 |
return [None, None]
|
| 79 |
def copy_img_to_input(img):
|
| 80 |
try:
|
|
|
|
|
|
|
| 81 |
image_data = re.sub('^data:image/.+;base64,', '', img)
|
| 82 |
processed_image = Image.open(BytesIO(base64.b64decode(image_data)))
|
| 83 |
tab_update = gr.update(selected='img2img_tab')
|
|
|
|
| 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')
|