Nodes/comfyui_davcha/DavchaCLIPMergeSimple
ComfyUI Node

DavchaCLIPMergeSimple

Blend two text encoders like you'd blend checkpoints

By dchatel·Created 2 years ago·Updated 13 days ago· 2
DavchaCLIPMergeSimple
  • clip1
  • clip2
  • CLIP
ratio1.000

Everyone merges checkpoints, but the text encoder is a model too - and this node lets you merge two of them. DavchaCLIPMergeSimple takes two CLIP models, blends them at a ratio, and hands you a merged CLIP you can feed straight into a text encode node. Same idea as the core ModelMergeSimple, just aimed at the part of the pipeline most people never think to touch.

It's part of comfyui_davcha, the author's "personal QoL and experimental nodes" pack. This one leans experimental - CLIP merging is a niche hobby, and there's a reason the stock nodes barely cover it.

How it works

The mechanism mirrors ComfyUI's own model merging: clone clip1, pull the key patches from clip2, and apply them with weights (1 - ratio, ratio). Two keys are explicitly skipped - anything ending in .position_ids and .logit_scale. That's the smart part: position_ids encode where tokens sit, and logit_scale is the learned text-image similarity scale; blending either across two encoders tends to break things rather than improve them.

The ratio slider runs -5 to 6 with a default of 1.0 and a fine 0.001 step. Read it as "how much clip2." At 1.0 you get essentially clip2; at 0 you get clip1; negative values subtract, which is how you'd push one encoder's influence out rather than in.

When you'd reach for it

  • Hybrid prompt understanding - merge an SD1.5 CLIP with an Illustrious or Pony CLIP and you get a middle ground that understands tags from both.
  • Style transfer of a sort - the community plays with encoder blends to shift how a model interprets prompts.
  • Tuning without retraining - it's in-graph, instant, and reversible, so you can A/B the blend live.

Inputs: clip1, clip2, ratio (FLOAT). Output: CLIP - wire it into any CLIP Text Encode.

Installing it

# ComfyUI Manager → Install Custom Nodes → search "comfyui_davcha" → Install → Restart
# or manually:
cd ComfyUI/custom_nodes
git clone https://github.com/dchatel/comfyui_davcha
cd comfyui_davcha
pip install -r requirements.txt

Pack-level gotcha applies: nodes.py imports llama_cpp and cv2 at module load though requirements.txt only lists webp and rapidfuzz. If the pack won't show up, pip install llama-cpp-python opencv-python and restart.

Where people get burned: blending two CLIPs whose tokenizers disagree can produce odd token mappings, so merge encoders from the same family for sane results, and don't assume 0.5 is a safe default - test a few ratios because the curve isn't linear in quality. It's an experiment, and the UI treats it like one.

Categoryadvanced/model_merging

Inputs (3)

NameTypeDefaultDescription
clip1CLIP
clip2CLIP
ratioFLOAT1.000-5–6

Outputs (1)

NameTypeDescription
CLIPCLIP