[bug]: Anima kohya LoRAs: layers outside the DiT blocks are not applied
Los mantenedores suelen responder en 2 días
Ya se ha fusionado un pull request relacionado.
- #10059 de @guishiw — fusionado
Evaluación
- Dificultad
- 2/5
- Tiempo estimado
- 1-3 horas
- Aptitud para principiantes
- 85/100
- Tipo de issue
- Error
- Claridad
- Bien especificado
- Estado de actividad
- Activo
- Stack tecnológico
- python, pytorch
- Área
- backend, machine-learning
Línea de trabajo
Comienza en invokeai/backend/patches/lora_conversions/anima_lora_conversion_utils.py en _convert_kohya_unet_key (línea 80). Lee la función y el script repro proporcionado para ver qué claves permanecen aplanadas. Añade mapeo para final_layer_linear, final_layer_adaln_modulation_1, t_embedder_1_linear_1, x_embedder_proj_1 a sus formas punteadas. Ejecuta el snippet para confirmar que la lista de capas coincide con los nombres punteados esperados.
Escrito por el modelo de indexación a partir del texto del issue.
Descripción
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
In an Anima kohya LoRA, the layers outside the DiT blocks are never applied. _convert_kohya_unet_key (invokeai/backend/patches/lora_conversions/anima_lora_conversion_utils.py:80) only un-flattens blocks_N_… (and the llm_adapter_ prefix). Every other key keeps its flattened name: final_layer_linear, final_layer_adaln_modulation_1/2, t_embedder_1_linear_1/2, x_embedder_proj_1. The resulting dotted patch never resolves them, and each one logs "Failed to find module for LoRA layer key".
The LoRA still loads and works, just without those layers. That makes it weaker than trained, and the only signal is the per-layer warnings.
What you expected to happen
Non-block kohya keys map to final_layer.linear, final_layer.adaln_modulation.1, t_embedder.1.linear_1, x_embedder.proj.1 and so on, as the block keys do. A kohya parsing tree like the Krea-2 one (kohya_key_utils) would cover them.
How to reproduce the problem
import torch
import invokeai.backend.model_manager.load # noqa: F401
from invokeai.backend.patches.lora_conversions.anima_lora_conversion_utils import lora_model_from_anima_state_dict
def lora(prefix: str) -> dict:
return {f"{prefix}.lora_down.weight": torch.randn(4, 64), f"{prefix}.lora_up.weight": torch.randn(64, 4)}
sd = {}
for k in ("blocks_0_self_attn_q_proj", "final_layer_linear", "final_layer_adaln_modulation_1", "t_embedder_1_linear_1", "x_embedder_proj_1"):
sd |= lora(f"lora_unet_{k}")
print(list(lora_model_from_anima_state_dict(sd, alpha=None).layers))
Output on main:
['lora_transformer-blocks.0.self_attn.q_proj', 'lora_transformer-final_layer_linear', 'lora_transformer-final_layer_adaln_modulation_1', 'lora_transformer-t_embedder_1_linear_1', 'lora_transformer-x_embedder_proj_1']
Additional context
In a LoRA trained on every layer these are 6 of 454 layers (about 1 % of the trained weights).
Found while checking every LoRA layout OneTrainer writes (b08db37) against main: OneTrainer's own savers run on meta-device models of the real architectures, then identification, LoRALoader and LayerPatcher module resolution on the InvokeAI model.
Discord username
No response
- Lenguaje dominante
- TypeScript
- Estrellas
- 28.9k
- Forks
- 3.1k
- Merge medio
- 4 d 2 h
- PR fusionados (30 d)
- 220
Preparar el entorno
- Sin Dockerfile ni archivo de Docker Compose
- Tiene una plantilla de pull request
- Sin guía de contribución
Primeros pasos
- Lee el issue completo y luego la guía de contribución del proyecto.
- Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
- Haz un fork del repositorio y trabaja en una rama.
- Abre un pull request que haga referencia al número del issue.
Más de invoke-ai/InvokeAI
-
[bug]: upload_image resize_to is documented as a stringified tuple, but only a JSON object with width and height is acceptedPosiblemente ocupada @GuilhermeAAV la tomó hace 5 días. Abierto
Dificultad 1/5 Menos de una hora Aptitud para principiantes 88/100
invoke-ai/InvokeAI#10047 · 1 comentario · 1 asignado ·
Los mantenedores suelen responder en 2 días
-
[enhancement]: Bump PyPatchMatch to latestPosiblemente ocupada @dunkeroni la tomó hace 17 días. Abiertoenhancement
Dificultad 2/5 1-3 horas Aptitud para principiantes 74/100
invoke-ai/InvokeAI#9826 · 2 reacciones · 1 asignado ·
Los mantenedores suelen responder en 2 días
-
bug
Dificultad 1/5 Menos de una hora Aptitud para principiantes 62/100
Los mantenedores suelen responder en 2 días
-
Dificultad 1/5 Menos de una hora Aptitud para principiantes 88/100
Los mantenedores suelen responder en 2 días
-
extract_audio_pcm detects "no audio stream" by matching ffmpeg's stderr text, so a wording change turns silent clips into hard errorsPosiblemente ocupada @wunianze666-netizen la tomó hace 20 días. Abierto
Dificultad 2/5 1-3 horas Aptitud para principiantes 68/100
Los mantenedores suelen responder en 2 días
Todos los issues de invoke-ai/InvokeAI
Issues similares
-
Add: Class TV ModaAbiertocheck:passed streams:add
Dificultad 1/5 Menos de una hora Aptitud para principiantes 65/100
Los mantenedores suelen responder en 1 día
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 62/100
GiganticMinecraft/seichi-playguide#183 ·
Los mantenedores suelen responder en 1 día
-
area: core complexity: easy impact: medium
Dificultad 2/5 1-3 horas Aptitud para principiantes 86/100
ueberdosis/tiptap#8668 ·
Los mantenedores suelen responder en 1 día
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 78/100
Los mantenedores suelen responder en 1 día
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 68/100
longbridge/nsh#804 ·
Los mantenedores suelen responder en 1 día