mirror of
https://github.com/comfyanonymous/ComfyUI.git
synced 2026-04-18 22:42:35 +08:00
Add functions to check and extract TwinFlow-Z-Image config
This commit is contained in:
parent
84c983a779
commit
dc413071ff
14
comfy/sd.py
14
comfy/sd.py
@ -74,6 +74,20 @@ import comfy.latent_formats
|
|||||||
|
|
||||||
import comfy.ldm.flux.redux
|
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):
|
def load_lora_for_models(model, clip, lora, strength_model, strength_clip):
|
||||||
key_map = {}
|
key_map = {}
|
||||||
if model is not None:
|
if model is not None:
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user