ComfyUI icon indicating copy to clipboard operation
ComfyUI copied to clipboard

Added wildcard node input support to back-end

Open shadownetdev1 opened this issue 2 years ago • 2 comments

ComfyUI's front-end supports wildcard inputs but the back-end had no way to hand nodes with wildcard inputs. This pull request changes a single line and allows a node to have an type_input of * that matches all other type inputs.

shadownetdev1 avatar Jun 15 '23 16:06 shadownetdev1

I will have to do some testing, but I don't think wildcard output will have many benefits. I'm pretty sure that you can already define any type you want as an output type. So, hypothetically a wildcard node could define the output "*" with the type "*" this would only be readable by other nodes with a wildcard input type. This is probably what you want because a non wildcard node is going to have no understanding of a wildcard output type. There may be a way to implement it that makes sense (maybe detect the actual type of input and automatically change the output type?), but this would probably require edits to both the front and back end and is beyond my current understanding of ComfyUI's internal code

shadownetdev1 avatar Jun 18 '23 12:06 shadownetdev1

I will have to do some testing, but I don't think wildcard output will have many benefits. I'm pretty sure that you can already define any type you want as an output type. So, hypothetically a wildcard node could define the output "" with the type "" this would only be readable by other nodes with a wildcard input type. This is probably what you want because a non wildcard node is going to have no understanding of a wildcard output type. There may be a way to implement it that makes sense (maybe detect the actual type of input and automatically change the output type?), but this would probably require edits to both the front and back end and is beyond my current understanding of ComfyUI's internal code

In fact, I use a lot of wildcard input/output in my custom. Typically, wildcard output is often used to pass through the incoming wildcard input as it is.

You can see an example of me using wildcard input/output here: https://github.com/comfyanonymous/ComfyUI/pull/731/files#diff-b1b2602f05d913fdc42d02d8ed132d1d6b4ed0cfcd5ae9b4d048637f4f27f3d5R77

ltdrdata avatar Jun 18 '23 12:06 ltdrdata

Today I independently discovered this problem/fix with the custom node lib mentioned above. There is also an open issue here relating to it: https://github.com/comfyanonymous/ComfyUI/issues/257

ali1234 avatar Sep 03 '23 01:09 ali1234