Skip to content

Commit

Permalink
Allow loading from diffusers ckpt (#1117)
Browse files Browse the repository at this point in the history
  • Loading branch information
angeloskath authored Dec 2, 2024
1 parent 2a9294a commit eb9277f
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions flux/flux/model.py
Original file line number Diff line number Diff line change
Expand Up @@ -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"]:
Expand Down

0 comments on commit eb9277f

Please sign in to comment.