mcmonkeyprojects / sd-dynamic-thresholding

Dynamic Thresholding (CFG Scale Fix) for Stable Diffusion (eSwarmUI, ComfyUI, and Auto WebUI)
MIT License
1.1k stars 103 forks source link

About the advanced use of this extension #73

Closed Charlotte-Macbeth closed 11 months ago

Charlotte-Macbeth commented 11 months ago

I've seen your README and Usage Tips, but today this extension has been updated with many new parameters, such as Interpolate Phi, Separate Feature Channels, Scaling Startpoint and Variability Measure. What do these parameters mean? And there are some new Scale Scheduler for mimic and CFG too. How should I choose them for the best effect? Can we only test and do experimentation with different checkpoints at different parameters to generate pics?

mcmonkey4eva commented 11 months ago

Those new options originate from this paper https://arxiv.org/abs/2305.08891 and this repo: https://github.com/ashen-sensored/sd-dynamic-thresholding-rcfg They are, frankly imo, not all that useful. The paper oversold the value and/or was unaware of dynamic thresholding as an option and went for a (worse) way of doing it. The "Interpolate Phi" option is the hallmark of that: what it does is literally just turn off the effects of the rescaling/thresholding. At 1.0 it runs as normal, at 0.0 it's gone entirely, for RCFG to work you need a value somewhere in the middle, as being 100% on just produces corrupted results.


And there are some new Scale Scheduler for mimic and CFG too. yeah, the new Repeating scheduler has some interesting effects (reminiscent of "cosine annealing" or similar LR schedulers used in training) and can potentially produce better results, especially for high-step-count images.

Testing is absolutely a good idea, see not only what works but what gets the results you personally like for your style of images. I highly recommend generating grids with the parameters shifted to see the results.

A bit outdated but this grid has a demo of many of the core options on SDv1.5 (I need to redo it with the new options on SDXL at some point)

Charlotte-Macbeth commented 11 months ago

Alright, thank you for your answer!