AlekPet / ComfyUI_Custom_Nodes_AlekPet

Custom nodes that extend the capabilities of Comfyui
MIT License
868 stars 59 forks source link

Can painter node support drag-and-drop image import? #81

Open LAOGOU-666 opened 2 months ago

LAOGOU-666 commented 2 months ago

image This error occurred when I directly dragged and dropped to import, Is it also possible to support the right-click output of the painter node? sometime we should use it to ensure the img is right

AlekPet commented 2 months ago

Hi, everything is possible! :) I'll see what I can do.

LAOGOU-666 commented 2 months ago

image image When the switch is turned on from off, the execution queue will report an error like this, but it can work when the queue is executed again.

AlekPet commented 2 months ago

I don't know what node FastMutter is and how it works, maybe it uses isoimage, this error looks like access to the image or it is empty. About copying, if you copy Copy(Clipspace) and paste Paste(Clipspace), then the ability to open and other options will appear.

LAOGOU-666 commented 2 months ago

This is a switch that controls the input terminal. Because there is a switch for update image in the setting of the painter node itself, but repeated operations will cause too many steps, so I set a switch that controls the input image. When it is turned on, image input is available. When off ,image input is none I found many nodes that can cache images, but only this one meets my requirements. I have to say that this node has great potential.

AlekPet commented 2 months ago

This is a switch that controls the input terminal. Because there is a switch for update image in the setting of the painter node itself, but repeated operations will cause too many steps, so I set a switch that controls the input image. When it is turned on, image input is available. When off ,image input is none I found many nodes that can cache images, but only this one meets my requirements. I have to say that this node has great potential.

It could be that I have a limited time to get the image, so if the image fails to get, it aborts. I can look at what FastMuter does and how it works, but that could take time.

LAOGOU-666 commented 2 months ago

录制_2024_09_02_00_23_19_429 it's just a switch to turn on or off the updating image function

AlekPet commented 2 months ago

The errors are not visible yet.

LAOGOU-666 commented 2 months ago

The painter node seems to need to be activated the first time it is run, otherwise any operation will be invalid. 录制_2024_09_02_00_55_09_811

AlekPet commented 2 months ago

The painter node seems to need to be activated the first time it is run, otherwise any operation will be invalid. 录制_2024_09_02_00_55_09_811

Ok, I'll try to fix it, you just need to call the method to save the canvas to server (file not exist yet) when creating a node.

AlekPet commented 2 months ago

Fixed bugs and possibly added new ones😃 !

LAOGOU-666 commented 2 months ago

can this code be added? image

so that i can excute the selected painter node on right click to ensure the img is right image

LAOGOU-666 commented 2 months ago

image the paste problem has been solved, but the size seems to be wrong

AlekPet commented 2 months ago

can this code be added? image

so that i can excute the selected painter node on right click to ensure the img is right image

OUTPUT_NODE is a little different, it gives access to the onExecuted method and the return of the python function is a little different, it is more for updating the UI after node executed,

AlekPet commented 2 months ago

image the paste problem has been solved, but the size seems to be wrong

When inserting, a question pops up asking resize image, if YES, then it is adjusted to the Painter size, if not, it is inserted as image(shape element) in accordance with the image size. PS: Maybe we need to add another way to change the size of Painter when inserting.

LAOGOU-666 commented 2 months ago

image image when i opened the mask editor,the image didn't update and save canvas function is really good,but when restart,the mask will be missing Sorry to bother you so many times THX for your great work

AlekPet commented 2 months ago

mask_film_not_comfyui The mask is updated because the canvas is updated, for this I added the option not to update for piping, but this is also a so-so solution, it would be good to have a separate mask editor inside the Painter node, but I don’t know if I’ll get around to it.

LAOGOU-666 commented 2 months ago

t

today i saw your updated version,you really solve those problem, thx very much for your optimization, i really love your nodes! And you can really consider to add output node= true ,without it i need to connect other nodes to confirm img is updated

AlekPet commented 2 months ago

t

today i saw your updated version,you really solve those problem, thx very much for your optimization, i really love your nodes! And you can really consider to add output node= true ,without it i need to connect other nodes to confirm img is updated

Regarding OUTPUT_NODE, it probably won't help much here, since the check is in the IS_CHANGED function, if you return float("nan") in it, the node will be updated at each launch, just what value should be returned if OUTPUT_NODE = True, in the onExecuted method and where, if the node has already worked? Simply the is_changed method is launched before the main function and checks for changes, and if there are changes, it launches the node.