NimaNzrii / comfyui-photoshop

ComfyUi inside of your Photoshop! you can install the plugin and enjoy free ai genration
243 stars 15 forks source link

Masks are "out of sync" #64

Open ackermann92 opened 1 month ago

ackermann92 commented 1 month ago

When sending a selection to use as a mask, ComfyUI is actually sampling with the mask that was sent in the previous request. It seems that the mask information is being updated inside the main node only after the sampling process takes place. I tested on an empty workflow with only the main node and previews and noticed that when hitting "render" in Photoshop, the main node "image" output updates its preview automatically, but the "mask" preview updates only when hitting the Queue Prompt button.

https://github.com/NimaNzrii/comfyui-photoshop/assets/153829556/48b1f6cb-d279-401f-87ce-ae7ccd64fd03

NimaNzrii commented 1 month ago

hi thank you for your report this bug will fix on next version💖

ackermann92 commented 1 month ago

Thank you for taking notice, and also thank you for developing this :) After more testing in your provided workflow, I couldn't find any reliable pattern: the masks sometimes work, other times they don't, but it seems to be related to the image size. Small 512px work as expected, and the bigger, the more unreliable.

I somehow managed to find a workaround by pure chance. I loaded the old version of the node and set up remote connection on Photoshop. I set its canvas output to a simple preview and somehow the masks from the new version of your node are working perfectly. image However, just changing the Preview Image node from the "Photoshop RemoteConnection" to another (similar) Preview node is enough to break the masks again. Maybe it has to do with the order of creation/execution of the nodes in comfy. Here is the workflow from the screenshot above where this workaround is working fine Photoshop Link - 3.json I tested the above with a 5000px canvas size and the mask output from the new version of the node worked well and consistently. The image output from the old version of the node also worked as expected, but the image output from the new version of the node dind't update correctly. Unfortunately I'm not a developer, so I can't help much more than this. Hopefully it's an easy fix for the next version, but meanwhile maybe this helps someone else as well.

huameiwei-vc commented 1 month ago

你好,谢谢你的报告 这个bug会在下个版本修复💖

image

Old nodes work, new nodes don't, can you take a look at this? Thank you for your help.