Compare commits

...

4 Commits

Author SHA1 Message Date
Dhruv Nair
97fc161b13 fix linting 2023-12-04 15:44:55 +00:00
Dhruv Nair
ce19a09051 fix ldm conversion 2023-12-04 06:52:29 +00:00
Dhruv Nair
390ea237ba Merge branch 'main' into ldm-unet-convert-fix 2023-12-04 06:24:40 +00:00
Dhruv Nair
7501b280fb fix 2023-11-27 15:39:09 +00:00

View File

@@ -446,7 +446,7 @@ def convert_ldm_unet_checkpoint(
new_checkpoint["add_embedding.linear_2.bias"] = unet_state_dict["label_emb.0.2.bias"]
# Relevant to StableDiffusionUpscalePipeline
if "num_class_embeds" in config:
if (config["num_class_embeds"] is not None) and ("label_emb.weight" in unet_state_dict):
new_checkpoint["class_embedding.weight"] = unet_state_dict["label_emb.weight"]
new_checkpoint["conv_in.weight"] = unet_state_dict["input_blocks.0.0.weight"]