Skip to content

Add diffusers model handler#2279

Merged
xiaoyu-work merged 6 commits intomainfrom
xiaoyu/diffusers
Dec 18, 2025
Merged

Add diffusers model handler#2279
xiaoyu-work merged 6 commits intomainfrom
xiaoyu/diffusers

Conversation

@xiaoyu-work
Copy link
Collaborator

Describe your changes

Add diffusers model handler. It is used to load diffusers model for diffusers pass (sd lora etc.)

Checklist before requesting a review

  • Add unit tests for this change.
  • Make sure all tests can pass.
  • Update documents if necessary.
  • Lint and apply fixes to your code by running lintrunner -a
  • Is this a user-facing change? If yes, give a description of this change to be included in the release notes.

(Optional) Issue link

xiaoyu-work and others added 2 commits December 8, 2025 16:43
Co-authored-by: Copilot Autofix powered by AI <62310815+github-advanced-security[bot]@users.noreply.github.com>
@xieofxie
Copy link
Contributor

xieofxie commented Dec 9, 2025

could we use it with other passes like ConvertToOnnx, Quantization?

@xiaoyu-work
Copy link
Collaborator Author

could we use it with other passes like ConvertToOnnx, Quantization?

Not for now. I'm still exploring how to make Olive existing passes work best with diffuser model. Will improve this more soon.

from diffusers import FluxTransformer2DModel

FluxTransformer2DModel.load_config(self.model_path, subfolder="transformer")
return DiffusersModelType.FLUX
Copy link
Collaborator

Choose a reason for hiding this comment

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

Don't we want to update self.model_type also here to avoid repeated detection?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Makes sense. Upadated!

@xiaoyu-work xiaoyu-work merged commit 12856e8 into main Dec 18, 2025
11 checks passed
@xiaoyu-work xiaoyu-work deleted the xiaoyu/diffusers branch December 18, 2025 19:18
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