Fix validation for generic type
The litegraph already accepts the generic type * this PR makes the backend validation accepts it too.
Generic types are useful for custom nodes for things like math and item selection and more, below is an illustrative example:
This example generates images with random sizes at each generation and compose a side by side image (more useful with horizontal tiling generation but I didn't want to over complicate this example).
The Select Item node accepts the type * and outputs the type * and select one item using the index input, that in this example is connected to a random value, this node uses a % operation to ensure the index is not out of boundary.
The Math Operation node perform math operations with INT and FLOAT on the same node.
The generic type allows a wide range of dynamic nodes making it possible to create very useful nodes without duplication for different types.
Very useful, please merge
Very useful, please merge
This can already be done with AnyType from pythongosssss that we all already use. Most likely why it was never incorporated as this is almost a 10 month old PR
i.e.
# wildcard trick is 100% stolen from pythongossss's
class AnyType(str):
def __ne__(self, __value: object) -> bool:
return False
JOV_TYPE_ANY = AnyType("*")
Also, you should make sure this works with PR 26666.
frontend is replaced by https://github.com/Comfy-Org/ComfyUI_frontend now
Let's be honest, no one cared about this PR in this repo, and no one will care about it if I redo the PR in the other repo, so I won't waste my time.
see reply at https://github.com/comfyanonymous/ComfyUI/pull/2015#issuecomment-2376050796