Implement Jina CLIP v2 and NewBie dual CLIP (#11415)

* Implement Jina CLIP v2

* Support quantized Gemma in NewBie dual CLIP
This commit is contained in:
woctordho
2025-12-20 13:57:22 +08:00
committed by GitHub
parent 31e961736a
commit 4c432c11ed
6 changed files with 306 additions and 4 deletions

View File

@@ -430,8 +430,9 @@ def detect_unet_config(state_dict, key_prefix, metadata=None):
dit_config["rope_theta"] = 10000.0
dit_config["ffn_dim_multiplier"] = 4.0
ctd_weight = state_dict.get('{}clip_text_pooled_proj.0.weight'.format(key_prefix), None)
if ctd_weight is not None:
if ctd_weight is not None: # NewBie
dit_config["clip_text_dim"] = ctd_weight.shape[0]
# NewBie also sets axes_lens = [1024, 512, 512] but it's not used in ComfyUI
elif dit_config["dim"] == 3840: # Z image
dit_config["n_heads"] = 30
dit_config["n_kv_heads"] = 30