ComfyUI icon indicating copy to clipboard operation
ComfyUI copied to clipboard

wildcard inputs broken

Open WASasquatch opened this issue 3 years ago • 7 comments

Wildcard inputs allow you to input to anything as they should, but ComfyUI is trying to validate them, where * won't equal the nodes type.

WASasquatch avatar Mar 25 '23 06:03 WASasquatch

Can you give me an example where it would make sense to have wildcard inputs in the backend?

comfyanonymous avatar Mar 25 '23 06:03 comfyanonymous

Can you give me an example where it would make sense to have wildcard inputs in the backend?

Conversion of types, debug anything and pass it along as already noted, nodes that handle multiple types of input such as saving stuff to disk, etc.

And the fact it's already in there by design and should be completed on both ends...

For node and API dev it's pretty common thing to have without programming it into every function call too. I could output everything in my chains and monitor it as it manipulates.

WASasquatch avatar Mar 25 '23 06:03 WASasquatch

One of the most important facets is I am incorporating logic, and conditions, and that means they should be able to handle, and output any type.

I could fork and distribute a new UI but I'd like to keep working on ComfyUI.

An optional hacky solution is to allow the node to update after it's been ran, it runs, sets a new RETURN_TYPE or uses a method, and outputs that new node type, and UI updates output label accordingly.

WASasquatch avatar Mar 25 '23 06:03 WASasquatch

Ok I see then that makes sense.

comfyanonymous avatar Mar 25 '23 07:03 comfyanonymous

Ok I see then that makes sense.

Thinking further, and I'm not positive if it's positive, but a method to dynamically change the output type seems like a better option. My reasoning is this: it simply eliminates a lot of the risk of unintentional user error. Cause then, say, my logic node could have a mode output_type and they can select their desired input/out, or input + output conversion. This would prevent hooking up the wrong nodes and triggering possibly catastrophic errors.

Having * for power users is still greatly welcomes, but dawned on me to be thinking of end-users too. Duh :P

WASasquatch avatar Mar 25 '23 07:03 WASasquatch

This would be very useful, i was making a list iterator, and having to make separate node for every type of list isn't very flexible. NumberListIterator,TextListIterator, ImageListIterator, LatentListIterator etc etc

kenjiqq avatar Jul 09 '23 12:07 kenjiqq

Yeah we should be able to assume we know what we're doing and handle wildcards types with is instance checking or type(input) == list etc

WASasquatch avatar Jul 09 '23 17:07 WASasquatch