Skip to content

feat: ancestral sampler implementations for flow models#1374

Open
wbruna wants to merge 2 commits intoleejet:masterfrom
wbruna:sd_samplers_rf_ancestral
Open

feat: ancestral sampler implementations for flow models#1374
wbruna wants to merge 2 commits intoleejet:masterfrom
wbruna:sd_samplers_rf_ancestral

Conversation

@wbruna
Copy link
Copy Markdown
Contributor

@wbruna wbruna commented Mar 30, 2026

Euler A, 8 steps DPM++2S A, 5 steps
test_1774838182 test_1774838083

On top of #1364 because it'll conflict with it anyway, and the eta parameter is useful for testing.

@leejet
Copy link
Copy Markdown
Owner

leejet commented Mar 30, 2026

Could you provide some theoretical explanation? That would help me review the related changes more effectively.

@wbruna wbruna force-pushed the sd_samplers_rf_ancestral branch from 57a1c7d to 6404d53 Compare April 1, 2026 02:01
@wbruna
Copy link
Copy Markdown
Contributor Author

wbruna commented Apr 1, 2026

Could you provide some theoretical explanation? That would help me review the related changes more effectively.

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).

@wbruna wbruna mentioned this pull request Apr 1, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants