shiimizu / ComfyUI_smZNodes

Custom nodes for ComfyUI such as CLIP Text Encode++
GNU General Public License v3.0
190 stars 14 forks source link

Settings (smz) Node Retains Configuration After Removal #34

Open dchatel opened 8 months ago

dchatel commented 8 months ago

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_

shiimizu commented 8 months ago

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.

dchatel commented 8 months ago

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?

shiimizu commented 7 months ago

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