Skip to content

Commit 4c05f78

Browse files
authored
Ldm unet convert fix (#6038)
* fix * fix ldm conversion * fix linting
1 parent bbd3572 commit 4c05f78

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/diffusers/pipelines/stable_diffusion/convert_from_ckpt.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -446,7 +446,7 @@ def convert_ldm_unet_checkpoint(
446446
new_checkpoint["add_embedding.linear_2.bias"] = unet_state_dict["label_emb.0.2.bias"]
447447

448448
# Relevant to StableDiffusionUpscalePipeline
449-
if "num_class_embeds" in config:
449+
if (config["num_class_embeds"] is not None) and ("label_emb.weight" in unet_state_dict):
450450
new_checkpoint["class_embedding.weight"] = unet_state_dict["label_emb.weight"]
451451

452452
new_checkpoint["conv_in.weight"] = unet_state_dict["input_blocks.0.0.weight"]

0 commit comments

Comments
 (0)