From 516d0e3af00de19a57c433a74349daff4ca8326a Mon Sep 17 00:00:00 2001 From: Angelos Katharopoulos Date: Fri, 22 Nov 2024 20:52:50 -0800 Subject: [PATCH] Allow loading from diffusers ckpt --- flux/flux/model.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/flux/flux/model.py b/flux/flux/model.py index 18ea70b0..d8ad9d9b 100644 --- a/flux/flux/model.py +++ b/flux/flux/model.py @@ -85,6 +85,8 @@ def __init__(self, params: FluxParams): def sanitize(self, weights): new_weights = {} for k, w in weights.items(): + if k.startswith("model.diffusion_model."): + k = k[22:] if k.endswith(".scale"): k = k[:-6] + ".weight" for seq in ["img_mlp", "txt_mlp", "adaLN_modulation"]: