ComfyUI_smZNodes icon indicating copy to clipboard operation
ComfyUI_smZNodes copied to clipboard

Settings (smz) Node Retains Configuration After Removal

Open dchatel opened this issue 1 year ago • 3 comments

The "Settings (smz)" node in the ComfyUI_smZNodes repository is exhibiting unexpected behavior. When this node is used in a workflow (Workflow A), it changes the overall configuration of the workflow. However, if the node is subsequently removed or disconnected from the workflow, the previous configuration is not restored.

To Reproduce: Steps to reproduce the behavior:

  1. Run Workflow A without the "Settings (smz)" node. The result is R_a.
  2. Add the "Settings (smz)" node to Workflow A and run it. The result is R_b.
  3. Remove or disconnect the "Settings (smz)" node from Workflow A and run it again. The result is still R_b, even though it should revert back to R_a.

Expected behavior: After the "Settings (smz)" node is removed or disconnected from the workflow, the configuration should revert back to its state before the node was added. In other words, running Workflow A without the "Settings (smz)" node should always yield result R_a.

Screenshots: Workflow used: Awithout.json Awith.json First run, workflow A without Settings (smz): ComfyUI_00060_ Second run, workflow A with Settings (smz): ComfyUI_00061_ Third run, workflow A without Settings (smz): ComfyUI_00062_

dchatel avatar Nov 29 '23 05:11 dchatel

Thanks for the detailed report. I had been meaning to fix this a while back, but I didn't have a good way to fix it. Now I think I have an elegant solution to it and it should be fixed in https://github.com/shiimizu/ComfyUI_smZNodes/commit/ba12cbafe261289ae0c40927febd2e7837ee6aef. The connections are important, as it only applies to what it's connected to, like how model patches are applied in ComfyUI (e.g. FreeU, RescaleCFG, etc.). If a Clip Text Encode++ node doesn't get a connection that had a Settings node somewhere beforehand, it'll use the default settings. That may have unintended effects, so make sure to give those connections to however many Clip Text Encode++ nodes are being used.

shiimizu avatar Dec 12 '23 09:12 shiimizu

Let's say, I want to use the settings node for only a part of the workflow. That wouldn't work, right? I mean, I would have to set a second settings node to disable the effects of the first one. Is that right?

dchatel avatar Dec 12 '23 12:12 dchatel

Before it was like that, yes. It should now be local to the links as I initially intended.

shiimizu avatar Jan 03 '24 03:01 shiimizu