fix(diffusers): pin diffusers and transformers to a known-good pair (#9979) - #10442
Merged
mudler merged 1 commit intoJun 22, 2026
Merged
Conversation
The diffusers backend tracked git+https://github.com/huggingface/diffusers (main) with an unpinned transformers. transformers v5 restructured CLIPTextModel and removed the .text_model attribute that diffusers' single -file loader reads, so loading any single-file Stable Diffusion checkpoint fails: create_diffusers_clip_model_from_ldm (single_file_utils.py) position_embedding_dim = model.text_model.embeddings.position_embedding... AttributeError: 'CLIPTextModel' object has no attribute 'text_model' No released diffusers (<=0.38.0) supports transformers v5 - only unreleased diffusers main does. Because the requirements tracked main plus an unpinned transformers, every backend image froze whichever pair existed at build time, and images built once transformers v5 shipped but before diffusers main caught up are permanently broken. Pin the last known-good released pair across all requirements files: diffusers==0.38.0 and transformers==4.57.6. 0.38.0 still exposes every pipeline backend.py imports (Flux, Wan, Sana, LTX2, Qwen, GGUF), so no functionality is lost, and builds become reproducible instead of drifting into the broken window. Fixes mudler#9979 Assisted-by: Claude:claude-opus-4-8 [Claude Code] Signed-off-by: Adira Denis Muhando <dennisadira@gmail.com>
mudler
approved these changes
Jun 22, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Closes #9979 (consolidates #9082). The diffusers / Stable Diffusion backend has been broken since ~v4.2.3: loading any single-file SD checkpoint fails with
AttributeError: 'CLIPTextModel' object has no attribute 'text_model'.Root cause
backend/python/diffusers/requirements-*.txttrackedgit+…/diffusers(main) with an unpinnedtransformers. transformers v5 restructuredCLIPTextModeland removed the.text_modelattribute that diffusers' single-file loader reads:No released diffusers (≤ 0.38.0) supports transformers v5 — only unreleased diffusers
maindoes. Because the requirements trackedmain+ an unpinnedtransformers, every backend image froze whichever pair existed at build time, and images built once transformers v5 shipped but before diffusersmaincaught up are permanently broken.Fix
Pin the last known-good released pair across all 8
requirements-*.txt:diffusers==0.38.0transformers==4.57.6Verified 0.38.0 still exposes every pipeline
backend.pyimports (Flux, Wan, Sana, LTX2, Qwen, GGUF), so no functionality is lost — builds just become reproducible instead of drifting into the broken window. The compel comment block is updated to explain the pin.Local GPU testing (RTX 4060 Laptop, 8GB, driver 580 / CUDA)
Reproduced with the exact checkpoint from the report (
DreamShaper_8_pruned.safetensors, SD1.5 single-file), using the backend's load pathStableDiffusionPipeline.from_single_file(..., torch_dtype=fp16)on CUDA.Version bisect (transformers 5.12.1 unless noted):
text_modelAttributeErrorBefore → After on the GPU:
Also verified the full
requirements-cublas12.txt(incl.sd_embed,optimum-quanto) resolves cleanly in a fresh env — no dependency conflict, no resolver backtracking storm.Test plan
requirements-cublas12.txtresolves without conflict in a clean envdiffusersclasses used bybackend.pyexist in 0.38.0