Analysis of Classifier-Free Guidance Weight Schedulers · Issue #7756 · huggingface/diffusers · GitHub
Skip to content

Analysis of Classifier-Free Guidance Weight Schedulers #7756

Open

Description

@rootonchair

Model/Pipeline/Scheduler description

The paper's authors performs an analysis and proposes 1 line change in order to make Classifier-Free Guidance looks better
cfg

I personally run some test to confirm

SD1.5 DDIM scheduler, 50 steps, "a photograph of an astronaut riding a horse", seed: 1024
guidance scale: 7.5
static
sd_default

linear (proposed)
sd_default_linear

guidance scale: 14.0
static
sd_org

linear (proposed)
sd_linear

Open source status

  • The model implementation is available.
  • The model weights are available (Only relevant if addition is not a scheduler).

Provide useful links for the implementation

Paper: https://arxiv.org/abs/2404.13040

Activity

  1. rootonchair commented on Apr 23, 2024

    @rootonchair
    ContributorAuthor

    Update SDXL result
    guidance scale: 14.0
    static
    sdxl_org
    linear
    sdxl_org_linear

  2. DN6 commented on Apr 24, 2024

    @DN6
    Collaborator

    cc: @yiyixuxu and @asomoza for visibility.

  3. bghira commented on Apr 26, 2024

    @bghira
    Contributor

    what a neat way to make use of the knowledge already in the model!

  4. yiyixuxu commented on Apr 26, 2024

    @yiyixuxu
    Collaborator

    cc @asomoza can we make a callback for this?

  5. asomoza commented on Apr 26, 2024

    @asomoza
    Member

    yes but there's a lot of techniques about manipulating the CFG, most of them without papers, I added the cutout one because I know it's really popular, makes the generations faster, and as a kind of example on how to manipulate the CFG

    Maybe we should let the community add these ones later on? Other more popular ones are automatic cfg and Dynamic Thresholding

  6. YunhoKim21 commented on May 16, 2024

    @YunhoKim21

    Hi, interested on your work. Is there an explanation of WHY this phenomena happens?

  7. bghira commented on May 16, 2024

    @bghira
    Contributor

    i'm not an expert on this, but on a cursory glance it seems to be basing the strength of guidance by the position in the timestep schedule. this also likely works because there's two types of attention being used by the model, with earlier timesteps being cross-attn (heavily relying on text conditional input) and later timesteps being self-attn (practically ignoring the prompt)

  8. github-actions commented on Sep 14, 2024

    @github-actions
    Contributor

    This issue has been automatically marked as stale because it has not had recent activity. If you think this still needs to be addressed please comment on this thread.

    Please note that issues that do not follow the contributing guidelines are likely to be ignored.

  9. added
    consider-for-modular-diffusersThings to consider adding support for in Modular Diffusers (with the help of community)
    on Nov 30, 2024
  10. sayakpaul commented on Nov 30, 2024

    @sayakpaul
    Member

    @yiyixuxu @asomoza @a-r-r-o-w this could be a good candidate for modular diffusers no?

  11. bghira commented on Nov 30, 2024

    @bghira
    Contributor

    modular diffusers?

  12. asomoza commented on Nov 30, 2024

    @asomoza
    Member

    this could be a good candidate for modular diffusers no?

    yes, actually all kind of variations the the CFG and also all the techniques that use the callbacks are the best initial candidates for the modular diffusers.

  13. github-actions commented on Dec 25, 2024

    @github-actions
    Contributor

    This issue has been automatically marked as stale because it has not had recent activity. If you think this still needs to be addressed please comment on this thread.

    Please note that issues that do not follow the contributing guidelines are likely to be ignored.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    consider-for-modular-diffusersThings to consider adding support for in Modular Diffusers (with the help of community)staleIssues that haven't received updates

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions