ComfyUI icon indicating copy to clipboard operation
ComfyUI copied to clipboard

Bypassing an instance of linked subgraphs break the other instance

Open leonero-h opened this issue 1 year ago • 4 comments

Custom Node Testing

Expected Behavior

There should be a way to bypass subgraph instances without bypassing inner nodes. Or setting a subgraph mode to never should pass the values to output if number of inputs and outputs and their types match.

Actual Behavior

Edit: welp, subgraph in a subgraph being linked is also broken now. Here's my other bug report since it was a great feature and it is ultimately required. https://github.com/Comfy-Org/ComfyUI_frontend/issues/5138

Right now there's no way to bypass a subgraph without bypassing its inner nodes. So disabling one of the instances of a subgraph ends up bypassing every instance of that subgraph. I think recursive bypass shouldnt be a thing for subgraphs. if you want to bypass things inside, one should simply go in and select everything to bypass. otherwise inner nodes should not execute when the outer node is bypassed regardless of their own state.

Steps to Reproduce

  1. create a subgraph in a subgraph.
  2. copy/paste outer subgraph, now the inner subgraphs are linked (which is a perfect feature)
  3. go into one of the outer subgraphs and bypass the inner subgraph.
  4. go into other outer subgraph. it doesnt look bypassed but nodes inside are. as of now there is no way to disable only one of the inner subgraph instances (there was before)

Debug Logs

-

Other

Subgraph in a subgraph becomes linked when the outher subgraph is copied. It is defined only once in the json file and is used as instances in both of the outer subgraphs. I have built a feature over this and it is very practical.

However someone opened a bug report; https://github.com/comfyanonymous/ComfyUI/issues/9282

After the patch if I wanted to disable a linked subgraph in one of the outer subgraphs but keep it enabled in other it wont work. There's simply no way to bypass one instance of an inner subgraph without breaking the other.

Example workflow where I have ksampler and many other subgraphs used as methods/functions common between T2V and I2V subgraphs and when user wants to disable T2V to start generation without using T2V and bypasses T2V all inner subgraphs and their nodes get bypassed and workflow breaks. I've tried setting mode of subgraph to Never and that gives an error since the values are not passed directly to output.

I'm at loss here, having linked subgraphs is a very optimized feature.

leonero-h avatar Aug 20 '25 21:08 leonero-h

I experienced exactly the same, bypassing one instance of a subgraph then disables all of them

stef654547 avatar Aug 21 '25 20:08 stef654547

Sad thing is linked subgraphs also became unstable/buggy so there's no way to prove this is a big issue. I have no idea if dev team support subgraphs to be used as methods/functions to actually make workflows more efficient and optimized or they only exist to viusally encapsulate same spagetti we had before.

leonero-h avatar Aug 21 '25 21:08 leonero-h

If I was designing the UX, if you bypass a subgraph, and an input and an output share the same value name, it should pass that value through the subgraph.

That way you can actually use them and turn them on and off in a modular way, because right now, Group Bypassing is better. And if I have to make a Group INSIDE of a subgraph just so I can have a working bypass solution....

I shouldn't have to explain how that's bad design.

Konkss avatar Aug 25 '25 23:08 Konkss

This issue has been transferred to the frontend repository: https://github.com/Comfy-Org/ComfyUI_frontend/issues/6407

Please continue the discussion there.

comfy-pr-bot avatar Oct 30 '25 04:10 comfy-pr-bot