Chaoses-Ib / ComfyScript

A Python frontend and library for ComfyUI
https://discord.gg/arqJbtEg7w
MIT License
407 stars 22 forks source link

Case: Unknown output node: lead the following error ----> v = G.nodes[node]['v'] KeyError: 'v' #77

Open cihangoksu opened 2 hours ago

cihangoksu commented 2 hours ago

Hi,

I am trying to transpile a complex ComfyUI workflow. For some nodes in my workflow "node_pos_sum" function in init.py returns to 0 with a warning message. But that leads an error later on in the "visit" function in init.py

image

Is there a way to work around this KeyError caused by an empty node {} in ComfyScript?

Thank you in advance :-)

Cheers, Cihan

Chaoses-Ib commented 1 hour ago

Is the workflow you are transpiling in web UI format? If so, you can try to convert it to API format, i.e. load it in web UI and Save (API format) (enable dev mode in settings first), and then transpile again.

cihangoksu commented 1 hour ago

Hmm sorry how does it work with API format actually? I ran python main.py in ComfyUI folder, and then developed the workflow in my browser at http://127.0.0.1:8188/ , and then Clicked save to 'Save workflow as' Json. Then I transpiled as explained in Comfyscript tutorials: python -m comfy_script.transpile PathToWorkflow.json

Chaoses-Ib commented 1 hour ago

Enable Dev Mode in settings:

image

Then Save (API format):

image

cihangoksu commented 1 hour ago

Oh cool! I did not know that... Thx a lot :-) It solved the problem, but led another (as it' irrelevant, I am opening a new issue).