andrewharp / ComfyUI-EasyNodes

Makes creating new nodes for ComfyUI a breeze.
MIT License
82 stars 11 forks source link

Boolean widget? #11

Open scruffynerf opened 3 weeks ago

scruffynerf commented 3 weeks ago

You added Choice, but no boolean? True False please? So the widget is a switch?

trojblue commented 3 weeks ago

+1 looking for booleans

andrewharp commented 1 week ago

You should be able to just use bool:

e.g.:

@ComfyNode()
def maybe_invert_image(image: ImageTensor, invert: bool):
  if invert:
    image = 1 - image
  return image

Will add this to the example nodes soon

andrewharp commented 1 week ago

Ok, so that example works on an older ComfyUI, but seems to be acting up in the newer updates. I think the underlying format for the input in the node definition isn't quite right and ComfyUI is a bit more particular about it now.