Skip to content

Fix LCM LoRA SDXL distillation state dict loading and saving - #14562

Open
loulanyue wants to merge 1 commit into
huggingface:mainfrom
loulanyue:fix/14548-lcm-lora-sdxl-peft-state-dict
Open

Fix LCM LoRA SDXL distillation state dict loading and saving#14562
loulanyue wants to merge 1 commit into
huggingface:mainfrom
loulanyue:fix/14548-lcm-lora-sdxl-peft-state-dict

Conversation

@loulanyue

Copy link
Copy Markdown

What does this PR do?

Fixes #14548

In examples/consistency_distillation/train_lcm_distill_lora_sdxl.py, routing the UNet's PEFT state dict through convert_state_dict_to_diffusers causes two issues:

  1. Intermediate validation state dict lacks the expected prefix / format for StableDiffusionXLPipeline.load_lora_weights, causing it to drop the weights and log un-adapted base model outputs.
  2. Saving with convert_state_dict_to_diffusers only renames attention modules to legacy naming while leaving convolutional and projection modules in PEFT naming, resulting in dropped attention adapters when loaded downstream.

This PR removes the unnecessary convert_state_dict_to_diffusers conversion in train_lcm_distill_lora_sdxl.py, keeping PEFT-native keys consistent across saving and loading hooks.

Who can review?

@sayakpaul @linoytsaban

Keep native PEFT state dict without routing through convert_state_dict_to_diffusers,
ensuring both intermediate validation and saved checkpoints preserve all attention
and convolutional adapters when loaded into StableDiffusionXLPipeline.

Fixes huggingface#14548
@github-actions github-actions Bot added fixes-issue size/S PR with diff < 50 LOC examples and removed size/S PR with diff < 50 LOC labels Aug 22, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

1 participant