feat: add logit-normal scheduler#1669
Conversation
|
I played around with the formula a bit, by carefully chosing the Examples:
https://www.desmos.com/calculator/t8ji3ml3aq
|
6bc8091 to
9dd0471
Compare
|
@leejet @Green-Sky @rmatif @daniandtheweb or anyone who actualy understand this stuff, could you take a look? I'm a bit confused by some things, like why is t_to_sigma not the inverse of sigma_to_t for Flow denoisers, and why some schedulers ignore t_to_sigma but others use it etc... |
|
https://github.com/Comfy-Org/ComfyUI/blob/master/comfy_extras/nodes_ideogram4.py Looks like they flip the order and do 1-x here, I will try that and see how it looks lilke. Edit: yeah, that's it. I must have missed something when looking at the original reference implementation. |
4bc40ce to
f4a1966
Compare
| // which one is corrrect ? | ||
| float sigma = timestep; | ||
| // float sigma = t_to_sigma(timestep * TIMESTEPS); | ||
| // float sigma = t_to_sigma(timestep * (TIMESTEPS - 1)); | ||
| // float sigma = t_to_sigma(timestep * TIMESTEPS - 1); |
There was a problem hiding this comment.
PR is pretty much ready to merge, only thing I'd still like a second opinion on is part.
There was a problem hiding this comment.
As far as I know in flow denoisers time = noise so there should be no need to be using any t_to_sigma to calculate the values.
It may not be the best explanation as I'm not really an expert on it but I'll try. For your first question t_to_sigma is not the inverse of sigma_to_t for flow denoisers because of the need to add a shift during the denoising phase. If they were exact inverses they'd cancel the shift out. About t_to_sigma being ignored by some schedulers I think it's mostly because some schedulers need to lookup the noise level while others calculate the noise curve independently. |
I see, but even when there is no shifting, there's an off-by-one difference. I guess it's close enough?
Hmm. When the scheduler is calculating the noise curve independantly, doesn't it break compatibility with the different kinds of denoisers (or settings like flow shift)? |
|
I had notice that difference before (#1372). Note they are called in very different contexts; I suspect they are not really intended to be inverses of each other, despite their names.
Hm. Yeah, I believe the schedulers should always call |
From what I understand: yes, it's close enough.
I haven't tested it but in theory not all schedulers should work for flow models. |
Summary
Adds support for the logit-normal schedule that supposed to be the default noise schedule for Ideogram4 (see https://github.com/ideogram-oss/ideogram4/blob/main/docs/pipeline.md#noise-schedule).
It's now set as default scheduler when running an Ideogram4 model.
Related Issue / Discussion
N/A
Additional Information
Uses Acklam's Algorithm to approximate the Inverse Normal CDF to avoid adding a boost dependency.
This scheduler has two tweakable parameters:
muandstd. Here are the values recommended for Ideogram (source: https://github.com/ideogram-oss/ideogram4/blob/main/src/ideogram4/sampler_configs.py)They are set via the
--extra-sample-argsparameter. For example, for 12 steps generations, you should add--extra-sample-args "mu=0.5,std=1.75"to the cli args.12 steps
20 steps
48 steps
Checklist