vivax3794 / ComfyUI-Sub-Nodes

Finally sub nodes in comfy!
120 stars 4 forks source link

how to customize the names of the inputs and outputs of a subgraph? #9

Closed xueqing0622 closed 1 month ago

xueqing0622 commented 1 month ago

how to customize the names of the inputs and outputs of a subgraph?

MoonMoon82 commented 1 month ago

@xueqing0622 I did not find an easy and reliable way to rename the in- and output sockets. For inputs it seems, its always depending on the name of the slot and the name of the node.

For example, I renamed cliptextencoder nodes in the node properties panel to "Pos.Prompt" and "Neg.Prompt" and text input sockets to "PosText" and "NegText": grafik In the subgraph node then, it appears like this: grafik So for input sockets it is always NameOfTheInputSocket.NameOfTheNode.SomeInteger

For output sockets I haven't figured out how to influence the name by customizing any node or socket name. The only way I figured out is by opening the .json file and search for the socket name and change it manually. But that way seems not to be reliable, because if you open this .json file in ComfyUI and change anything in the workflow, you need to redo all the renaming in the new .json file again.

vivax3794 commented 1 month ago

You are correct in how the input names are determined, (idr how the output names are set at the top of my head). Supporting renaming the sockets directly is something I am gonna add when I get back home (on vacation, I released this thing at a good time xD). Honestly idk how supporting that completely slipped my mind during the first iterations of this

vivax3794 commented 1 month ago

You can now rename the slots on both inputs and outputs and those names will be respected when using the subgraph

xueqing0622 commented 1 month ago

how to change name, I even change the json file, but still not work. Do you have tutor.

xueqing0622 commented 1 month ago

ok, re name the slot input output in json file, and must rename to save another name. but it only work in subnode json, image not in subnode node image

vivax3794 commented 1 month ago

You should use the builtin comfyui slot rename feature, right click on the slot (the circle) to rename stuff.

xueqing0622 commented 1 month ago

Yes, Thx your tips! have a nice day!