Skip to content

Conversation

@lukas-kuhn
Copy link
Contributor

What does this PR do?

Previously the download_from_original_stable_diffusion_ckpt function, when run with a SDXL model, would default to a StableDiffusionPipeline pipeline class. This would lead to downstream errors because the SDXL model has a text_encoder_2 which is not recognized in the StableDiffusionPipeline.

A few lines below, the function checks if the model is a SDXL or SDXL-Refiner and sets the model_type variable accordingly.

I moved the initialization of the default pipeline (when None is set specifically) below this detection if the model is SDXL or SDXL-Refiner and initialize the correct default pipeline. This makes it easier for users who for example run the convert_original_stable_diffusion_to_diffusers.py script.

Before submitting

  • This PR fixes a typo or improves the docs (you can dismiss the other checks if that's the case).
  • Did you read the contributor guideline?
  • Did you read our philosophy doc (important for complex PRs)?
  • Was this discussed/approved via a Github issue or the forum? Please add a link to it if that's the case.
    This issue came to my attention only a few hours ago and I immediately fixed it but it was part of a discussion at Issue#4488. It basically adds a better default to MR#4461
  • Did you make sure to update the documentation with your changes? Here are the
    documentation guidelines, and
    here are tips on formatting docstrings. No changes needed
  • Did you write any new necessary tests? Not necessary imo

Who can review?

Anyone in the community is free to review the PR once the tests have passed. Feel free to tag
members/contributors who may be interested in your PR.

@patrickvonplaten @yiyixuxu

@HuggingFaceDocBuilderDev
Copy link

HuggingFaceDocBuilderDev commented Nov 13, 2023

The documentation is not available anymore as the PR was closed or merged.

Copy link
Contributor

@patrickvonplaten patrickvonplaten left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice refactor!

@patrickvonplaten patrickvonplaten merged commit c9c5436 into huggingface:main Nov 14, 2023
@lukas-kuhn lukas-kuhn deleted the feat/autodetect-sdxl branch November 14, 2023 10:36
yoonseokjin pushed a commit to yoonseokjin/diffusers that referenced this pull request Dec 25, 2023
…ult pipeline for SDXL (huggingface#5784)

* feat: sdxl will be automatically detected as pipeline_class

* fix: formatting

* fix: formatting with black

* fix: import pipeline wrongly sorted
AmericanPresidentJimmyCarter pushed a commit to AmericanPresidentJimmyCarter/diffusers that referenced this pull request Apr 26, 2024
…ult pipeline for SDXL (huggingface#5784)

* feat: sdxl will be automatically detected as pipeline_class

* fix: formatting

* fix: formatting with black

* fix: import pipeline wrongly sorted
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.

3 participants