richinsley / comfy2go

A Go-based API that acts as a bridge to the ComfyUI backend
MIT License
49 stars 13 forks source link

cannot unmarshal array into Go struct field NodeObject.output of type string #1

Closed foobarhe closed 9 months ago

foobarhe commented 10 months ago

Throws an error when call client.Init(): cannot unmarshal array into Go struct field NodeObject.output of type string

seems the format upgraded? some of the output value includes embed list not only list of string https://github.com/richinsley/comfy2go/blob/main/graphapi/nodeobjects.go#L16C60-L16C60

richinsley commented 10 months ago

It's most likely a custom node with a type that I've not seen yet. If you do an object info dump and attach it, I can look into what custom node is causing the issue:

curl http://localhost:8188/object_info > object_info.json

gongdaoqi-ola commented 9 months ago

the same err: object.json

gongdaoqi-ola commented 9 months ago

the output contains []string

"KSampler Config (rgthree)": { "input": { "required": { "steps_total": [ "INT", { "default": 30, "min": 1, "max": 8192, "step": 1 } ], "refiner_step": [ "INT", { "default": 24, "min": 1, "max": 8192, "step": 1 } ], "cfg": [ "FLOAT", { "default": 8, "min": 0, "max": 100, "step": 0.5 } ], "sampler_name": [ [ "euler", "euler_ancestral", "heun", "heunpp2", "dpm_2", "dpm_2_ancestral", "lms", "dpm_fast", "dpm_adaptive", "dpmpp_2s_ancestral", "dpmpp_sde", "dpmpp_sde_gpu", "dpmpp_2m", "dpmpp_2m_sde", "dpmpp_2m_sde_gpu", "dpmpp_3m_sde", "dpmpp_3m_sde_gpu", "ddpm", "lcm", "ddim", "uni_pc", "uni_pc_bh2" ] ], "scheduler": [ [ "normal", "karras", "exponential", "sgm_uniform", "simple", "ddim_uniform" ] ] } }, "output": [ "INT", "INT", "FLOAT", [ "euler", "euler_ancestral", "heun", "heunpp2", "dpm_2", "dpm_2_ancestral", "lms", "dpm_fast", "dpm_adaptive", "dpmpp_2s_ancestral", "dpmpp_sde", "dpmpp_sde_gpu", "dpmpp_2m", "dpmpp_2m_sde", "dpmpp_2m_sde_gpu", "dpmpp_3m_sde", "dpmpp_3m_sde_gpu", "ddpm", "lcm", "ddim", "uni_pc", "uni_pc_bh2" ], [ "normal", "karras", "exponential", "sgm_uniform", "simple", "ddim_uniform" ] ], "output_is_list": [ false, false, false, false, false ], "output_name": [ "STEPS", "REFINER_STEP", "CFG", "SAMPLER", "SCHEDULER" ], "name": "KSampler Config (rgthree)", "display_name": "KSampler Config (rgthree)", "description": "", "category": "rgthree", "output_node": false }

richinsley commented 9 months ago

Looks like the NodeObject/Output slice can be other types than string (in this case, another slice of strings). Thanks for reporting this one.

https://github.com/richinsley/comfy2go/commit/6aa8889ea8f7ed8df150ee484e302b927f66d980