Skip to content

Commit 862a7d5

Browse files
authored
[Single File] Add single file support for Flux Canny, Depth and Fill (huggingface#10288)
update
1 parent 8304adc commit 862a7d5

File tree

1 file changed

+9
-1
lines changed

1 file changed

+9
-1
lines changed

src/diffusers/loaders/single_file_utils.py

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -151,6 +151,8 @@
151151
"animatediff_scribble": {"pretrained_model_name_or_path": "guoyww/animatediff-sparsectrl-scribble"},
152152
"animatediff_rgb": {"pretrained_model_name_or_path": "guoyww/animatediff-sparsectrl-rgb"},
153153
"flux-dev": {"pretrained_model_name_or_path": "black-forest-labs/FLUX.1-dev"},
154+
"flux-fill": {"pretrained_model_name_or_path": "black-forest-labs/FLUX.1-Fill-dev"},
155+
"flux-depth": {"pretrained_model_name_or_path": "black-forest-labs/FLUX.1-Depth-dev"},
154156
"flux-schnell": {"pretrained_model_name_or_path": "black-forest-labs/FLUX.1-schnell"},
155157
"ltx-video": {"pretrained_model_name_or_path": "Lightricks/LTX-Video"},
156158
"autoencoder-dc-f128c512": {"pretrained_model_name_or_path": "mit-han-lab/dc-ae-f128c512-mix-1.0-diffusers"},
@@ -587,7 +589,13 @@ def infer_diffusers_model_type(checkpoint):
587589
if any(
588590
g in checkpoint for g in ["guidance_in.in_layer.bias", "model.diffusion_model.guidance_in.in_layer.bias"]
589591
):
590-
model_type = "flux-dev"
592+
if checkpoint["img_in.weight"].shape[1] == 384:
593+
model_type = "flux-fill"
594+
595+
elif checkpoint["img_in.weight"].shape[1] == 128:
596+
model_type = "flux-depth"
597+
else:
598+
model_type = "flux-dev"
591599
else:
592600
model_type = "flux-schnell"
593601

0 commit comments

Comments
 (0)