mirror of
https://github.com/lllyasviel/stable-diffusion-webui-forge.git
synced 2026-07-21 21:01:24 +08:00
keys
This commit is contained in:
parent
cc6c641b10
commit
472309ff2d
@ -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):
|
||||
|
||||
@ -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
|
||||
|
||||
|
||||
Loading…
Reference in New Issue
Block a user