This commit is contained in:
Haoming 2026-05-18 23:00:47 +08:00
parent cc6c641b10
commit 472309ff2d
2 changed files with 9 additions and 2 deletions

View File

@ -31,6 +31,8 @@ def process_anima(lora: dict[str, torch.Tensor]):
for k in keys:
if k.startswith("diffusion_model.llm_adapter"):
lora[k.replace("diffusion_model", "text_encoders.qwen3_06b")] = lora.pop(k)
elif k.startswith("lora_unet_llm_adapter"):
lora[k.replace("lora_unet_llm_adapter", "lora_te_llm_adapter")] = lora.pop(k)
def load_lora_for_models(model: "UnetPatcher", clip: "CLIP", lora: dict[str, torch.Tensor], strength_model: float, strength_clip: float, filename: str = "default", online_mode: bool = False):

View File

@ -165,10 +165,15 @@ def model_lora_keys_clip(model, key_map={}):
key_map["lora_te{}_{}".format(t5_index, l_key.replace(".", "_"))] = k
for k in sdk:
if k.endswith(".weight") and k.startswith("qwen3_06b."): # Anima
for k in sdk: # Anima
if not k.endswith(".weight"):
continue
if k.startswith("qwen3_06b.model"):
_key = k[len("qwen3_06b.model.layers.") : -len(".weight")]
key_map["lora_te_layers_{}".format(_key.replace(".", "_"))] = k
elif k.startswith("qwen3_06b.llm_adapter"):
_key = k[len("qwen3_06b.") : -len(".weight")]
key_map["lora_te_{}".format(_key.replace(".", "_"))] = k
return key_map