Skip to content

regression - vae load sets inccorect scaling factor #6923

@vladmandic

Description

@vladmandic

Describe the bug

code added via this pr (refactor update from single file)
forces scaling factor to fixed value regardless of what is being loaded

code reference:

newly added code in: https://github.com/huggingface/diffusers/blame/7c8cab313e4c66a813d146bcf92023b0489a2369/src/diffusers/loaders/single_file_utils.py#L1177

this results in washed out images when sdxl model is used with additionally loaded vae.

correct values should be:

  • LDM VAE (sd-15) uses scaling_factor 0.18125
  • SGM VAE (sd-xl) uses scaling factor 0.13025

looking at code before this pr, no scaling_factor was enforced on vae load and it worked just fine - so this is a regression in diffusers 0.26 compared to 0.25.

reference issue: vladmandic/sdnext#2824

Reproduction

n/a

Logs

No response

System Info

diffusers==0.26.2

Who can help?

@yiyixuxu @sayakpaul @DN6 @patrickvonplaten

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions