zero01101 / openOutpaint

local offline javascript and html canvas outpainting gizmo for stable diffusion webUI API 🐠
MIT License
503 stars 44 forks source link

[bug] Copy and paste not working for system clipboard-supporting browsers #124

Closed toyxyz closed 1 year ago

toyxyz commented 1 year ago

As of now, to add the image I want to the canvas, I need to go through the process of Stamp image > Upload Image. Conversely, to export the image I worked on on the canvas, I have to download it by clicking Save canvas. I don't know if it's technically possible, but if possible, it would be nice to have a function to paste and copy image layers using ctrl + c / ctrl + v like in Photoshop. PaintHua supports a similar feature. https://github.com/BlinkDL/Hua

https://user-images.githubusercontent.com/8006000/209550170-33358154-e599-46f7-8b24-441ea07d358a.mp4

seijihariki commented 1 year ago

There already is, with the marquee tool (select and transform tool). Give it a look and report back if there is any more functionality that you would like to add to it!

It does not work with firefox, as the API is locked behind a 'about:config' setting. In this case, copy pasting still works but uses internal state to achieve the same.

toyxyz commented 1 year ago

There already is, with the marquee tool (select and transform tool). Give it a look and report back if there is any more functionality that you would like to add to it!

It does not work with firefox, as the API is locked behind a 'about:config' setting. In this case, copy pasting still works but uses internal state to achieve the same.

Thanks for the quick reply! Copying to the Clipboard using 'Use clipboard' of Select Image(S) as you explained works fine. How to paste from clipboard to canvas?

20221226220047602
seijihariki commented 1 year ago

Ctrl v should also work... If it is not, we can look into what is happening.

toyxyz commented 1 year ago

Ctrl v should also work... If it is not, we can look into what is happening.

I tried ctrl+v in all tools but nothing worked. Could I be missing something?

seijihariki commented 1 year ago

Can you open devtools and check if there are any errors there when copy-pasting?

toyxyz commented 1 year ago

Can you open devtools and check if there are any errors there when copy-pasting?

Here is the Devtool console log: image

seijihariki commented 1 year ago

Okay, so select.js has an error there, and from what I see, it is definitely something that is an issue. Will send a fix today. For now, disable clipboard from the select tool, that it should work flawlessly (though it will not interact with the system clipboard)

seijihariki commented 1 year ago

Will also be moving this issue to the main openOutpaint repo.

seijihariki commented 1 year ago

If you could test the fix deployed to the testing branch (go to webui/extensions/<webui-openOutpaint-ext>/app and run git checkout origin/testing)

@toyxyz

toyxyz commented 1 year ago

If you could test the fix deployed to the testing branch (go to webui/extensions/<webui-openOutpaint-ext>/app and run git checkout origin/testing)

@toyxyz

I tested it by changing the branch. The Devtools log is:

image

image

seijihariki commented 1 year ago

Can you clean site data and reload? file variable shouldn't exist anymore in line 599.

toyxyz commented 1 year ago

Can you clean site data and reload? test variable shouldn't exist anymore in line 599.

I cleared the site data and tested again. Here's the Devtools log:

image

seijihariki commented 1 year ago

Are you in commit 100829298ced8dab2aa1020e80866b16856e8d5d?

zero01101 commented 1 year ago

image here's what line 599 should be on the current testing branch; did you refresh the page without cache? (ctrl+f5)

toyxyz commented 1 year ago

image here's what line 599 should be on the current testing branch; did you refresh the page without cache? (ctrl+f5)

Oh, I checked, and when I typed git checkout origin/testing, it was 1008292, but when I restarted webui, it was returning to main. When I changed the branch and tested it without exiting the webui, ctrl+v worked well. thanks!

image image