vinavfx / ComfyUI-for-Nuke

API to be able to use ComfyUI nodes within nuke, only using the ComfyUI server
GNU General Public License v3.0
193 stars 17 forks source link

Creating ComfyuiBase for MaskBlur in Comfyui_Essentials #10

Closed timriopelle closed 3 months ago

timriopelle commented 3 months ago

Hey Francisco,

Firstly, thanks for these amazing nodes. Having a lot of fun with them.

I am trying to create a Mask Blur (Using the ComfyuiBase) which accesses the Comfyui_Essentials custom node folder. Here is the class of the script in the folder:

class MaskBlur: @classmethod def INPUT_TYPES(s): return { "required": { "mask": ("MASK",), "amount": ("INT", { "default": 6, "min": 0, "max": 256, "step": 1, }), "device": (["auto", "cpu", "gpu"],), } }

And then here is my script in the ComfyuiBase:

{ 'class_type': 'MaskBlur', 'inputs': [ {'name': 'mask', 'outputs': ['mask'], 'opt': False} ], 'outputs': ['mask'] }

comfyui.nodes.update_input_nodes(nuke.thisNode())

I have 2 user knobs for the amount (amount) and device (device), however when I add this node to my workflow and execute, I get the:

JSONDecodeError("Expecting value", s, err.value) from None json.decoder.JSONDecodeError: Expecting value: line 1 column 1 (char 0)

You noted this is something with an empty result and not something you can fix. But I was just curious if the Essentials folder may not be getting recognized, or if I am missing something. My workflow works without this node, then when I add it, it's broken. No worries if you can't do anything, I was just curious if you had any advice. Thanks!

timriopelle commented 3 months ago

Just an update: I tried creating a node (InvertMask) from the ComfyuiBase that I knew was in the same script / location as other nodes you created, and I am still getting this same JSONDecodeError.

{ 'class_type': 'InvertMask', 'inputs': [ {'name': 'mask', 'outputs': ['mask'], 'opt': False} ], 'outputs': ['mask'] } comfyui.nodes.update_input_nodes(nuke.thisNode())

timriopelle commented 3 months ago

Closing this. I've found a work around. Breaking was related to chaining nodes together. When isolating the ComfyUIBase to function independently, I seem to be having things work correctly.