LoRA Format Repros
Collection
6 items β’ Updated
Random weights β not a functional adapter. This file reproduces the key layout of a real
Z-Image LoKr trained with an ai-toolkit/LyCORIS-style trainer (ComfyUI diffusion_model. key
format), for reproducing https://github.com/huggingface/diffusers/issues/13221.
ZImagePipeline.load_lora_weights / lora_state_dict fails on it with
ValueError: state_dict should be empty at this point because
_convert_non_diffusers_z_image_lora_to_diffusers has no handling for lokr_w1 / lokr_w2 keys.
from diffusers import ZImagePipeline
from huggingface_hub import hf_hub_download
path = hf_hub_download("scenario-labs/z-image-lokr-repro", "zimage_lokr_dummy.safetensors")
ZImagePipeline.lora_state_dict(path) # raises ValueError on diffusers <= 0.39 / main
Mixed LoKr + plain LoRA:
| module | format | layers | shapes |
|---|---|---|---|
attention.to_q/k/v |
LoKr | all 30 | lokr_w1 [4,4], lokr_w2 [960,960], scalar alpha |
adaLN_modulation.0 |
LoKr | all 30 | lokr_w1 [4,4], lokr_w2 [3840,64], scalar alpha |
attention.to_out.0 |
LoRA | 0β17 | lora_A [32,3840], lora_B [3840,32] |
attention.to_out.0 |
LoKr | 18β29 | lokr_w1 [4,4], lokr_w2 [960,960], scalar alpha |
feed_forward.w1/w2/w3 |
LoRA | all 30 | rank 32 |
The same file loads fine in current ComfyUI (which fuses to_q/k/v into attention.qkv and
supports LoKr via comfy/weight_adapter/lokr.py).
Base model
Tongyi-MAI/Z-Image-Turbo