ComfyUI-EasyNodes icon indicating copy to clipboard operation
ComfyUI-EasyNodes copied to clipboard

Boolean widget?

Open scruffynerf opened this issue 1 year ago • 3 comments

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

scruffynerf avatar Aug 26 '24 00:08 scruffynerf

+1 looking for booleans

trojblue avatar Aug 26 '24 12:08 trojblue

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 avatar Sep 07 '24 01:09 andrewharp

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.

andrewharp avatar Sep 10 '24 22:09 andrewharp