Add functions to check and extract TwinFlow-Z-Image config

This commit is contained in:
azazeal04 2026-04-04 15:59:50 +02:00 committed by GitHub
parent 84c983a779
commit dc413071ff
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -74,6 +74,20 @@ import comfy.latent_formats
import comfy.ldm.flux.redux
def is_twinflow_z_image_model(state_dict):
"""Check if model state dict is TwinFlow-Z-Image."""
return any(k.startswith("t_embedder_2.") for k in state_dict)
def get_twinflow_z_image_config(state_dict):
"""Extract TwinFlow-Z-Image configuration from state dict."""
if not is_twinflow_z_image_model(state_dict):
return {}
return {
"image_model": "twinflow_z_image",
"architecture": "TwinFlow_Z_Image",
}
def load_lora_for_models(model, clip, lora, strength_model, strength_clip):
key_map = {}
if model is not None: