Extraltodeus/ComfyUI-AutomaticCFG

Bleed to other sampler nodes

elphamale opened this issue · 1 comments

Greetings,
first I have to say thank you for the idea and the realization thay you made in these nodes. They really add improvement to my workflows.

So I've been using AutomaticCFG for a few weeks but after some update I noticed that samplers that follow the one the AutomaticCFG node is connected to started to produce black images instead of proper output. That includes KSamplers, Detailer nodes from Impact Pack and UltimateSD Upscale nodes.
Googling the problem I found a comment on reddit that said that the problem may be in AutomaticCFG and the problem is solvable by removing the node and restarting ComfyUI. And indeed, after removing the AutomaticCFG and restarting ComfyUI all following samplers produced expected results.

So it seems AutomaticCFG somehow bleeds to following nodes it is not connected in any way.
I am not versed enough in comfy/SD code to point out where the problem originates. But that bleed is not good. And may be a HUGE problem in the workflows that has multiple sampler nodes that have different models as an input.

From what I observed on the KSampler Efficient node (it shows each sampling step realtime) that was impacted by such bleed, the image starts to blackout at later steps of the sampler - it looks to me like the CFG was set to a very high value for that ksampler at later steps.

There is also a workaround:
I solved this bleed yesterday by connecting each ksampler/detailer/ultimatesdupscale nodes with another automaticCFG node.

It should be solved by this PR by making the node act like another patching node.