feat: ancestral sampler implementations for flow models#1374
feat: ancestral sampler implementations for flow models#1374wbruna wants to merge 2 commits intoleejet:masterfrom
Conversation
|
Could you provide some theoretical explanation? That would help me review the related changes more effectively. |
57a1c7d to
6404d53
Compare
This actually came from an observation that "Euler A" worked fine in ComfyUI, but not on sd.cpp. Looking for a reference implementation, I found https://github.com/capitan01R/ComfyUI-ZImageTurbo-FlowSampler , and reimplemented it with adjusts for better numerical stability; but it produced blurry / oversaturated results. Looking at the ComfyUI calculation, it includes an additional ratio that seems to work much better: Comfy-Org/ComfyUI@d605677 . The problem is that it doesn't offer much explanation about where it came from. I've rebased the Euler A implementation for now, with the derivation of the expressions I used, and isolating the additional ratio (it's enough to replace it with 1.0 to change it into the algorithm from the first reference). |
On top of #1364 because it'll conflict with it anyway, and the eta parameter is useful for testing.