-
Notifications
You must be signed in to change notification settings - Fork 5.5k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Change step_offset scheduler docstrings #7128
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
thanks!
cc @pcuenca and @patil-suraj here again to see if anyone knows why we recommended to use see more #6931 |
The docs for this PR live here. All of your documentation changes will be reflected on that endpoint. The docs are available until 30 days after the last update. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good to me. Based on the discussion that happened, I think it makes sense.
I would be curious to know the reasons behind the existing recommendation around steps_offset
as well!
I almost wonder if it'd be worth to have an anti-recommendation? Like for
Even if SAI never updates their goofy SDXL config, it might help people looking in the docs on why the outputs might be bad? Between plain Epsilon, Turbo, V-Pred, and ZSNR I haven't observed a single model that would require clipping the final step instead of going straight for zero. Maybe that only applies to certain timestep spacings..? |
I've been checking the history a bit and it look like In #3947, I think we just went through other schedulers and replicated the same logic. IIRC we checked results against the SDXL implementation, but I'm not completely sure if we used DDIM or Euler as a baseline (I think it was DDIM and then changed to Euler). |
@yiyixuxu WDYT of merging this and letting the discussion continue? |
@Beinsezii Thanks a lot for the tests! I don't have an answer unfortunately, maybe a bug was introduced after those PRs, or maybe the problem was always there from the original stable diffusion codebase (I'm pretty sure we compared model outputs when the conversion was made), or maybe the logic in that PR was flawed after all. I did browse the current DDIM code vs the version in the PR and nothing stood out as being obviously wrong. Perhaps we could run generations immediately before and after the change in the PR and see if anything changes. I'd love to help with that, but I'm very time-constrained this week :( Regarding the doc changes in this PR, I'm supportive if you think they'll help reduce the confusion. It'll be a bit puzzling for new users, perhaps we can improve it a bit without mentioning |
An offset added to the inference steps. You can use a combination of `offset=1` and | ||
`set_alpha_to_one=False` to make the last step use step 0 for the previous alpha product like in Stable | ||
Diffusion. | ||
An offset added to the inference steps. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
An offset added to the inference steps. | |
An offset added to the inference steps, as required by some model families. |
How about something like this? Would it still be confusing?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think it's fair. Curious what @yiyixuxu or @sayakpaul think.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ok let's do this?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Updated.
Another idea would be to go back to checking against the reference CompVis codebase, comparing outputs. Our guiding light for integration was to generate 1-to-1 identical results (on CPU using float32), and I think that's the goal we should still have as a library. The test suite should ensure that continues to be the case, though (but it might be imperfect). |
The CompVis repo has a bunch of pinned dependencies that don't work on my GPU so I can't check that myself. Maybe something like ComfyUI could also be a decent benchmark? I believe SAI said they were using it for their Discord image gen bot during the SDXL trial period. |
These ones failed literal S&R because I performed it case-sensitive which is fun.
@yiyixuxu do we wanna merge it? |
@patrickvonplaten maybe we want to update the SAI configs on the hub once this is merged? it's not blocked by it, this is just a documentation fix. but training / inference code still inherits the bad config. |
See #6931 and #6068 for background
Right now it changes all the docstrings from
to simply
Because that really shouldn't apply to any schedulers except DDIM, and in my opinion even that is arguable.
set_alpha_to_one=True
is basicallyfinal_sigmas_type="zero"
for DDIM so I'm unsure why it was ever recommended to be disabled?Whether its from this docstring or otherwise the official SDXL config incorrectly sets
set_alpha_to_one=False
despite using Euler where it doesn't apply resulting in DDIM performing unusably when inheriting the config. Rest in peace @bghira's early Terminus checkpoints."An offset added to the inference steps." isn't very descriptive, but I'm not entirely sure about the motivation behind this value so I'm leaving it as-is for now. Usually if you want to sample later timesteps you'd use a solution like
timestep_spacing="trailing"
instead.