fofr / cog-comfyui

Run ComfyUI with an API
https://replicate.com/fofr/any-comfyui-workflow
MIT License
495 stars 109 forks source link

Issue with Switch (Any) from Impact Pack #102

Closed crimpproduction closed 2 months ago

crimpproduction commented 3 months ago

The Switch (Any) nodes is not working properly in replicate, but it works fine on comfyui. The following is a demo project image

here is the workflow API json: { "3": { "inputs": { "seed": 40617622417432, "steps": 20, "cfg": 8, "sampler_name": "euler", "scheduler": "normal", "denoise": 1, "model": [ "4", 0 ], "positive": [ "6", 0 ], "negative": [ "7", 0 ], "latent_image": [ "5", 0 ] }, "class_type": "KSampler", "_meta": { "title": "KSampler" } }, "4": { "inputs": { "ckpt_name": "dreamshaper_8.safetensors" }, "class_type": "CheckpointLoaderSimple", "_meta": { "title": "Load Checkpoint" } }, "5": { "inputs": { "width": 512, "height": 512, "batch_size": 1 }, "class_type": "EmptyLatentImage", "_meta": { "title": "Empty Latent Image" } }, "6": { "inputs": { "text": [ "17", 0 ], "clip": [ "4", 1 ] }, "class_type": "CLIPTextEncode", "_meta": { "title": "CLIP Text Encode (Prompt)" } }, "7": { "inputs": { "text": "text, watermark", "clip": [ "4", 1 ] }, "class_type": "CLIPTextEncode", "_meta": { "title": "CLIP Text Encode (Prompt)" } }, "8": { "inputs": { "samples": [ "3", 0 ], "vae": [ "4", 2 ] }, "class_type": "VAEDecode", "_meta": { "title": "VAE Decode" } }, "9": { "inputs": { "filename_prefix": "ComfyUI", "images": [ "8", 0 ] }, "class_type": "SaveImage", "_meta": { "title": "Save Image" } }, "11": { "inputs": { "text": "Sunflower" }, "class_type": "Text Multiline", "_meta": { "title": "Text Multiline" } }, "12": { "inputs": { "text": "basketball" }, "class_type": "Text Multiline", "_meta": { "title": "Text Multiline" } }, "13": { "inputs": { "images": [ "8", 0 ] }, "class_type": "PreviewImage", "_meta": { "title": "Preview Image" } }, "16": { "inputs": { "select": 1, "sel_mode": false, "input1": [ "11", 0 ], "input2": [ "12", 0 ] }, "class_type": "ImpactSwitch", "_meta": { "title": "Switch (Any)" } }, "17": { "inputs": { "string": [ "16", 0 ] }, "class_type": "String to Text", "_meta": { "title": "String to Text" } } }

here is the log:

Checking inputs
====================================
Checking weights
✅ dreamshaper_8.safetensors exists in ComfyUI/models/checkpoints
====================================
Randomising seed to 967642536
Running workflow
got prompt
!!! Exception during processing!!! 'NoneType' object is not subscriptable
Traceback (most recent call last):
File "/src/ComfyUI/execution.py", line 151, in recursive_execute
output_data, output_ui = get_output_data(obj, input_data_all)
File "/src/ComfyUI/execution.py", line 81, in get_output_data
return_values = map_node_over_list(obj, input_data_all, obj.FUNCTION, allow_interrupt=True)
File "/src/ComfyUI/execution.py", line 74, in map_node_over_list
results.append(getattr(obj, func)(**slice_dict(input_data_all, i)))
File "/src/ComfyUI/custom_nodes/ComfyUI-Impact-Pack/modules/impact/util_nodes.py", line 35, in doit
nodelist = kwargs['extra_pnginfo']['workflow']['nodes']
TypeError: 'NoneType' object is not subscriptable
Prompt executed in 0.00 seconds
Executing node 16, title: Switch (Any), class type: ImpactSwitch
outputs:  {}
====================================

on that demo, we can see node ID 16 is the switch (any):

Using "select_on_prompt" or "select_on_execution" gave me the same error. It works fine on comfy that I run locally or using runpod. Only error on replicate.

could you take a look and maybe help me solve it? The switch any nodes is quite useful to control combination predefined settings using index/select.

fofr commented 3 months ago

I think this might be because I need to update the Impact custom node. It's on my todo list but I have a conflicting branch with upstream so it's not happened yet.

crimpproduction commented 3 months ago

I think this might be because I need to update the Impact custom node. It's on my todo list but I have a conflicting branch with upstream so it's not happened yet.

Hi fofr, thank you for the quick response. Could we get an estimation of when will it gets updated and resolved? is it in a couple of days, weeks, or not in the near future?

fofr commented 2 months ago

I've hit this bug again today, given it's just a UI switch, can it be factored out when running an API call?

fofr commented 2 months ago

I've updated Impact-Pack and Switch (Any) now works