mirror of
https://github.com/comfyanonymous/ComfyUI.git
synced 2026-04-03 07:23:30 +08:00
Fix text encoder lora loading for wrapped models (#12852)
This commit is contained in:
parent
e4b0bb8305
commit
06f85e2c79
@ -99,6 +99,9 @@ def model_lora_keys_clip(model, key_map={}):
|
|||||||
for k in sdk:
|
for k in sdk:
|
||||||
if k.endswith(".weight"):
|
if k.endswith(".weight"):
|
||||||
key_map["text_encoders.{}".format(k[:-len(".weight")])] = k #generic lora format without any weird key names
|
key_map["text_encoders.{}".format(k[:-len(".weight")])] = k #generic lora format without any weird key names
|
||||||
|
tp = k.find(".transformer.") #also map without wrapper prefix for composite text encoder models
|
||||||
|
if tp > 0 and not k.startswith("clip_"):
|
||||||
|
key_map["text_encoders.{}".format(k[tp + 1:-len(".weight")])] = k
|
||||||
|
|
||||||
text_model_lora_key = "lora_te_text_model_encoder_layers_{}_{}"
|
text_model_lora_key = "lora_te_text_model_encoder_layers_{}_{}"
|
||||||
clip_l_present = False
|
clip_l_present = False
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user