Merge Text Encoders (2 Models)
Blend two CLIP/T5 files at the weight level
- output_filename
- documentation
This is the third leg of the merger family this pack ships - same engine as CheckpointTwoMerger and ModelTwoMerger, aimed at standalone text encoders. If your setup loads CLIP or a T5/Qwen encoder as its own file (which is how basically every current-generation model does it - Flux, Chroma, and the LLM-encoder architectures all keep the text encoder separate from the diffusion weights), this is where you'd blend two of those files together rather than the checkpoint or UNet.
Why you'd want this at all
It's the least common of the three merger types in this pack for a reason: merging text encoders isn't the same operation as merging fine-tuned checkpoints. A checkpoint merge is blending two things that were each independently trained to be good at generating images. A text-encoder merge is blending two things that were trained to produce embeddings the diffusion model downstream learned to interpret - and unless both encoders came from closely related training runs, averaging their weights doesn't obviously produce a coherent encoder, it produces an embedding space neither downstream model was ever conditioned on. This node exists for the narrower, legitimate case: two encoder checkpoints from the same base architecture (say, two CLIP fine-tunes, or two versions of the same T5 checkpoint) where a careful blend genuinely makes sense.
How it works
model_a and model_b pick your two source encoders. calc_mode selects the merge algorithm (option list not documented in the schema - check your install's dropdown). The six weight knobs - alpha 0.5, beta 0.5, gamma 0.99, delta 2, epsilon 0.01, zeta 0 - match the exact defaults every other two-input merger in this pack ships with, which is the same engine underneath all of them. alpha is the one you'd reach for on a basic blend; the rest feed more specific algorithms and aren't documented per-field.
mismatch_mode (default skip) and alignment_mode (default pad/crop) handle tensors that don't line up between the two encoder files. exclude_patterns/discard_patterns (regex, or glob with glob_patterns) scope layers out of the result. lazy_load streams tensors instead of holding both encoders fully in memory, force_clear_cache clears CUDA cache per layer, save_dtype/override_dtype control output precision, process_device picks CPU or GPU, and seed covers whichever calc_mode is stochastic. Output is output_filename (default merged_2_textencoder) and a documentation string.
Installing it
ComfyUI Manager: search Model Utility Toolkit, install, restart. Or:
cd ComfyUI/custom_nodes
git clone https://github.com/silveroxides/ComfyUI-ModelUtils
Restart ComfyUI. Nothing to download - it works on encoder files already on disk.
Where people get burned
The one that actually matters here: never merge text encoders across architecture families. A T5-class encoder and a CLIP-class encoder don't share a token space, a dimensionality, or a training objective - merging them isn't a bad idea that produces a mediocre result, it's an operation that doesn't mean anything, and mismatch_mode/alignment_mode will at best pad/crop the shapes into something that loads without actually being sensible. Even within the same family, current-generation text encoders are increasingly full language models (Qwen3, T5-XXL) rather than small CLIP towers - the training that shaped one Qwen3-based encoder checkpoint and another can diverge more than two CLIP fine-tunes ever did, so a naive weighted blend is more likely to produce something the downstream diffusion model was never conditioned to read. If your merged encoder produces prompts that render as noise or ignore the prompt entirely, that's the first thing to suspect - not a bug in the node, a mismatch in what you fed it.
Inputs (22)
| Name | Type | Default | Description |
|---|---|---|---|
| execution_mode | COMBO | 2 options: MERGE, DOCUMENTATION ONLY | |
| model_a | COMBO | 1 options: None | |
| model_b | COMBO | 1 options: None | |
| calc_mode | COMBO | 10 options: Weight-Sum, Comparative-Interpolation, Power-Up (DARE), Power-Up (DARE+TIES), SVD LoRA Extraction, Enhanced Man Interp, +4 | |
| mismatch_mode | COMBO | skip | 3 options: skip, zeros, error |
| alignment_mode | COMBO | pad/crop | 2 options: pad/crop, interpolate |
| alpha | FLOAT | 0.50-10–10 | — |
| beta | FLOAT | 0.50-10–10 | — |
| gamma | FLOAT | 0.990-10–10 | — |
| delta | FLOAT | 2.00-10–10 | — |
| epsilon | FLOAT | 0.01-10–10 | — |
| zeta | FLOAT | 0.00-10–10 | — |
| seed | INT | 00–18446744073709550000 | — |
| output_filename | STRING | merged_2_textencoder | — |
| save_dtype | COMBO | 3 options: fp32, fp16, bf16 | |
| process_device | COMBO | 2 options: cuda, cpu | |
| exclude_patterns | STRING | — | |
| discard_patterns | STRING | — | |
| glob_patterns | BOOLEAN | false | When True, exclude/discard patterns use glob syntax (* = any sequence, dots are literal). When False (default), patterns are Python regex matched as substrings. |
| lazy_load | BOOLEAN | true | Low memory mode: load tensors from disk on demand |
| force_clear_cache | BOOLEAN | true | Clear CUDA cache after each layer |
| override_dtype | BOOLEAN | false | Force the entire model to be saved as the selected save_dtype. If False (default), higher precision dtypes are preserved. |
Outputs (2)
| Name | Type | Description |
|---|---|---|
| output_filename | STRING | — |
| documentation | STRING | — |