Hacktoberfest 2026: le issue che i maintainer hanno segnato per ottobre, aperte e adatte ai principianti. Sfoglia le issue Hacktoberfest

[bug]: Qwen-Image LoRAs with `diffusion_model.` or `base_model.model.` key prefixes are not identified and apply to no layer

Aperta
#10,031 0 commenti 0 reazioni 0 assegnatari Vedi su GitHub

I maintainer di solito rispondono entro 2 giorni

@tanishqbaweja ci sta già lavorando.

Dal 28/10/2026.

  • #10061 di @tanishqbaweja — aperta

Valutazione

Difficoltà
3/5
Tempo stimato
1-2 giorni
Idoneità per principianti
75/100
Tipo di issue
Bug
Chiarezza
Specificata chiaramente
Stato di attività
Attiva
Stack tecnologico
python, pytorch

Direzione di ricerca

Start in invokeai/backend/model_manager/configs/lora.py at LoRA_LyCORIS_QwenImage_Config._validate_looks_like_lora and accept diffusion_model. and base_model.model. prefixes. Then in invokeai/backend/patches/lora_conversions/qwen_image_lora_conversion_utils.py:124 update _convert_diffusers_format to strip them like the Z-Image converter. Run the issue's reproduction script; done when identified as lora and 0 layers missing.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Descrizione

bug
Is there an existing issue for this problem?
  • I have searched the existing issues
Install method

Manual (dev checkout)

Operating system

Windows

GPU vendor

Not GPU-specific (reproduced on CPU)

GPU model

No response

GPU VRAM

No response

Version number

main at 0ddc9df91b

What happened

Qwen-Image LoRAs whose keys carry a diffusion_model. prefix (the ComfyUI layout) or the raw PEFT prefix base_model.model. (adapter_model.safetensors) install as Unknown. With the base forced to Qwen-Image, every layer keeps its prefix and resolves to no module, so the LoRA has no effect.

  • Identification: LoRA_LyCORIS_QwenImage_Config._validate_looks_like_lora (invokeai/backend/model_manager/configs/lora.py) accepts only keys starting with transformer_blocks., transformer.transformer_blocks. or lora_unet_transformer_blocks_.
  • Conversion: _convert_diffusers_format (invokeai/backend/patches/lora_conversions/qwen_image_lora_conversion_utils.py:124) strips only transformer..

This is the most common Qwen-Image layout on Hugging Face. Of 1,596 safetensors files with Qwen-Image block keys in adapter repos of Qwen/Qwen-Image, Qwen-Image-Edit-2509, Qwen-Image-Edit-2511 and Qwen-Image-2512, 1,051 use diffusion_model. and 7 use base_model.model.. Examples: autoweeb/Qwen-Image-Edit-2509-Photo-to-Anime, lilylilith/AnyPose, Wuli-art/Qwen-Image-2512-Turbo-LoRA-2-Steps.

What you expected to happen

Both prefixes are accepted by identification and stripped by the converter, as the Z-Image and Anima converters already do for theirs.

How to reproduce the problem

With Qwen-Image-Edit-2509-Photo-to-Anime_000001000.safetensors from the first example repo:

import json

import torch
from diffusers import QwenImageTransformer2DModel
from safetensors.torch import load_file

import invokeai.backend.model_manager.load  # noqa: F401
from invokeai.backend.model_manager.configs.factory import ModelConfigFactory
from invokeai.backend.patches.lora_conversions.qwen_image_lora_conversion_utils import lora_model_from_qwen_image_state_dict

path = "Qwen-Image-Edit-2509-Photo-to-Anime_000001000.safetensors"
print("identified as:", ModelConfigFactory.from_model_on_disk(path).config.type.value)

patch = lora_model_from_qwen_image_state_dict(load_file(path), alpha=None)
with torch.device("meta"):
    model = QwenImageTransformer2DModel()  # Qwen-Image geometry
modules = dict(model.named_modules())
missing = [k for k in patch.layers if k.removeprefix("lora_transformer-") not in modules]
print(f"{len(missing)} of {len(patch.layers)} layers resolve to no module, e.g. {missing[0]}")

Output on main:

identified as: unknown
840 of 840 layers resolve to no module, e.g. lora_transformer-diffusion_model.transformer_blocks.0.attn.add_k_proj
Additional context

Some base_model.model. files also carry PEFT DoRA magnitudes as bare lora_magnitude_vector keys, which then fail to load as described in #9558.

Found while checking real Qwen-Image LoRAs from Hugging Face against main (identification, LoRALoader, and LayerPatcher module resolution on the Qwen-Image transformer).

Discord username

No response

Lingua principale
TypeScript
Stelle
28.9k
Fork
3.1k
Merge medio
3g 17h
PR unite (30g)
188

Preparare l'ambiente

  • Nessun Dockerfile né file Docker Compose
  • Ha un modello di pull request
  • Nessuna guida per i contributori

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Altre issue di invoke-ai/InvokeAI

Tutte le issue di invoke-ai/InvokeAI

Issue simili

Altre issue su TypeScript

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.