Skip to content

Commit e5ca3a6

Browse files
committed
feat: support loading diffusers format gguf checkpoints.
1 parent 6c7fad7 commit e5ca3a6

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

src/diffusers/loaders/single_file_utils.py

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2145,6 +2145,12 @@ def convert_flux_transformer_checkpoint_to_diffusers(checkpoint, **kwargs):
21452145
if "model.diffusion_model." in k:
21462146
checkpoint[k.replace("model.diffusion_model.", "")] = checkpoint.pop(k)
21472147

2148+
original_flux = any(k.startswith("double_blocks.") for k in checkpoint) or any(
2149+
k.startswith("single_blocks.") for k in checkpoint
2150+
)
2151+
if not original_flux:
2152+
return checkpoint
2153+
21482154
num_layers = list(set(int(k.split(".", 2)[1]) for k in checkpoint if "double_blocks." in k))[-1] + 1 # noqa: C401
21492155
num_single_layers = list(set(int(k.split(".", 2)[1]) for k in checkpoint if "single_blocks." in k))[-1] + 1 # noqa: C401
21502156
mlp_ratio = 4.0

0 commit comments

Comments
 (0)