Skip to content

[Bug] Wan2.2 LightX2V LoRA Merge Fails to Match cross_attn.k_img and cross_attn.v_img Keys #1246

Description

@xuansu-genmo

Description

When merging the Wan2.2-I2V-A14B LightX2V distillation LoRA into the Wan2.2-I2V-A14B low-noise model, some LoRA keys related to image conditioning (k_img, v_img, and img_emb) cannot be matched with the base model keys.

The LightX2V LoRA checkpoint contains additional modules such as:

  • cross_attn.k_img
  • cross_attn.v_img
  • cross_attn.norm_k_img
  • img_emb.proj

However, the official Wan-AI/Wan2.2-I2V-A14B checkpoint only contains:

  • cross_attn.k
  • cross_attn.v
  • cross_attn.q
  • cross_attn.o

without the corresponding image-specific projection modules.

As a result, only part of the LoRA weights are applied during merging.

Steps to Reproduce

  1. Download the official Wan2.2-I2V-A14B low-noise model:
    Wan-AI/Wan2.2-I2V-A14B

  2. Download the LightX2V 4-step distillation LoRA:
    lightx2v/Wan2.2-Distill-Loras
    wan2.2_i2v_A14b_low_noise_lora_rank64_lightx2v_4step_1022.safetensors

  3. Run the LightX2V LoRA conversion/merging tool:
    python converter.py
    --source <Wan2.2-I2V-A14B-low-noise-model>
    --lora_path
    ...

  4. Observe that the LoRA loader reports missing model keys for image-specific attention modules.

Expected Result

All LoRA weights in the LightX2V distillation LoRA should be successfully matched and merged into the Wan2.2-I2V-A14B low-noise model.

The expected behavior is that all LoRA updates, including:

  • cross_attn.k
  • cross_attn.v
  • cross_attn.k_img
  • cross_attn.v_img
  • img_emb.proj

are applied.

Actual Result

Only a subset of LoRA weights are applied.

The converter reports missing keys such as:

Model key not found: blocks.0.cross_attn.k_img.weight
Model key not found: blocks.0.cross_attn.v_img.weight
...
Model key not found: img_emb.proj.1.weight

and:

Found 290 unused LoRA weights - this may indicate key mismatch
Applied 1054 LoRA weight adjustments out of 1262 possible

The missing weights are mainly related to image-conditioning pathways:

  • cross_attn.k_img
  • cross_attn.v_img
  • cross_attn.norm_k_img
  • img_emb.proj

Environment Information

  • Operating System: Ubuntu 22.04
  • Python Version: 3.12
  • PyTorch Version: 2.11.0+cu128
  • CUDA Version: 12.8
  • GPU: NVIDIA A100
  • Commit ID: [Please fill in the LightX2V commit ID]

Log Information

Relevant logs:

Loading LoRA from:
wan2.2_i2v_A14b_low_noise_lora_rank64_lightx2v_4step_1022.safetensors

Model key not found:
blocks.23.cross_attn.k_img.weight

Model key not found:
blocks.23.cross_attn.v_img.weight

Model key not found:
blocks.23.cross_attn.norm_k_img.weight

Found 290 unused LoRA weights - this may indicate key mismatch

Applied 1054 LoRA weight adjustments out of 1262 possible

Additional Information

The LightX2V LoRA checkpoint appears to expect an architecture containing separate image-conditioning attention projections:

cross_attn.k_img
cross_attn.v_img
img_emb.proj

However, the official Wan2.2-I2V-A14B checkpoint only exposes:

cross_attn.k
cross_attn.v

with no image-specific projection modules.

It is unclear whether:

  1. the LightX2V LoRA was trained on a converted Wan2.2 architecture,
  2. the official model requires a different conversion step before applying the LoRA, or
  3. additional key mapping logic is required in the LoRA loader.

A comparison between lightx2v/Wan2.2-Official-Models and Wan-AI/Wan2.2-I2V-A14B weight structures may help identify the intended conversion path.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    Status
    Todo

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions