Skip to content

Commit a9d3f6c

Browse files
authored
[Single File] Fix SD3.5 single file loading (huggingface#10077)
update
1 parent cd34439 commit a9d3f6c

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

src/diffusers/loaders/single_file_utils.py

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -127,6 +127,9 @@
127127
"sd35_large": {
128128
"pretrained_model_name_or_path": "stabilityai/stable-diffusion-3.5-large",
129129
},
130+
"sd35_medium": {
131+
"pretrained_model_name_or_path": "stabilityai/stable-diffusion-3.5-medium",
132+
},
130133
"animatediff_v1": {"pretrained_model_name_or_path": "guoyww/animatediff-motion-adapter-v1-5"},
131134
"animatediff_v2": {"pretrained_model_name_or_path": "guoyww/animatediff-motion-adapter-v1-5-2"},
132135
"animatediff_v3": {"pretrained_model_name_or_path": "guoyww/animatediff-motion-adapter-v1-5-3"},
@@ -527,7 +530,10 @@ def infer_diffusers_model_type(checkpoint):
527530
model_type = "stable_cascade_stage_b"
528531

529532
elif CHECKPOINT_KEY_NAMES["sd3"] in checkpoint and checkpoint[CHECKPOINT_KEY_NAMES["sd3"]].shape[-1] == 9216:
530-
model_type = "sd3"
533+
if checkpoint["model.diffusion_model.pos_embed"].shape[1] == 36864:
534+
model_type = "sd3"
535+
elif checkpoint["model.diffusion_model.pos_embed"].shape[1] == 147456:
536+
model_type = "sd35_medium"
531537

532538
elif CHECKPOINT_KEY_NAMES["sd35_large"] in checkpoint:
533539
model_type = "sd35_large"

0 commit comments

Comments
 (0)