Kosinkadink / ComfyUI-Advanced-ControlNet

ControlNet scheduling and masking nodes with sliding context support
GNU General Public License v3.0
622 stars 60 forks source link

ControlLLLite refactor + vanilla CN conversion when using sliding context #141

Closed Kosinkadink closed 4 months ago

Kosinkadink commented 4 months ago

This PR serves to fix some long-standing pain points of ControlLLLite usage as well as non-Advanced ControlNet usage with sliding contexts from AnimateDiff-Evolved. The refactor also brings the code closer to what I need to try some things for keeping AnimateDiff contexts more consistent related to reuse of core referencecn code among other tasks I have lined up, so killing multiple birds with one stone here.

  1. The hacky solution to have deepcopy overloaded to avoid the attn patch objects and the controlnet objects losing each other is no longer needed, which will fix behavior with certain helper nodes that pipe certain objects.
  2. Since the patches are now applied at sampling time, SamplerCustomAdvanced will currently not apply ControlLLLite as I'd need to figure out a good way to handle it. I'm not sure if it worked with SamplerCustomAdvanced before. (All other KSamplers should be unaffected as I wrap around the sample and sample_custom functions that pretty much every other KSampler in existence, external or vanilla, uses.)