Implement TwinFlow-Z-Image LoRA compatibility

Add compatibility for TwinFlow-Z-Image LoRAs to target t_embedder_2.* keys.
This commit is contained in:
azazeal04 2026-04-04 15:49:32 +02:00 committed by GitHub
parent f21f6b2212
commit 00c4e72a97
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -328,6 +328,13 @@ def model_lora_keys_unet(model, key_map={}):
key_map["lycoris_{}".format(key_lora.replace(".", "_"))] = to
key_map[key_lora] = to
# TwinFlow-Z-Image LoRAs can target t_embedder_2.* keys.
# Alias them back to t_embedder.* targets for compatibility.
if isinstance(model, comfy.model_base.TwinFlow_Z_Image):
for key in list(key_map.keys()):
if "t_embedder." in key and "t_embedder_2." not in key:
key_map[key.replace("t_embedder.", "t_embedder_2.", 1)] = key_map[key]
if isinstance(model, comfy.model_base.Kandinsky5):
for k in sdk:
if k.startswith("diffusion_model.") and k.endswith(".weight"):