Z-Image Raw CLIP Merge
Blend text encoders at the raw level
- clip_a
- clip_b
- RAW_CLIP
ZImageRawModelMerge's text-encoder sibling: two RAW_CLIP state dicts in, one blended RAW_CLIP out. The math is the same weight-wise interpolation - A × (1 − strength) + B × strength - but aimed at the Qwen3-4B text encoder, the part of Z-Image that shapes how your prompt becomes conditioning. For a model where the text encoder is a 4-billion-parameter LLM, that's not a footnote; merging encoders is a real way to change prompting behavior without touching the diffusion model.
Why merge a text encoder at all
The Z-Image encoder is where a lot of the model's character lives. Blending two Qwen encoder checkpoints (or one patched and one stock, via ZImageComfyUninjector) is a coarse but real way to:
- Merge TE LoRA behavior into a base encoder - bake a text-encoder LoRA into one side, blend it with the stock encoder at partial strength, and you've effectively got the LoRA at 0.5 strength without a loader.
- Fuse two different Qwen fine-tunes - community encoder merges like the "Z-Image Engineer" Qwen variants people pair with diffusers models. This is the raw knob for that kind of experiment.
- Interpolate between encoder personalities - one encoder trained for Chinese-prompt adherence, one for English, blend to taste.
The output RAW_CLIP feeds ZImageComfyInjector (or gets saved via ZImageSaveTextEncoder for reuse). Because the encoder is a big LLM, a raw merge of two 4B encoders is a real memory event - it's not a lightweight op.
The inputs
clip_a(RAW_CLIP) - the base encoder.clip_b(RAW_CLIP) - the flavor.strength- 0.0 to 1.0, default 0.5. 0 = pure A, 1 = pure B.
Output is a single RAW_CLIP. Same rules as the model merge: missing keys are kept from whichever side has them, and shape mismatches keep A's version with a console warning.
Install
ComfyUI Manager (search ComfyUI-Zlycoris) or:
cd ComfyUI/custom_nodes
git clone https://github.com/TripleHeadedMonkey/ComfyUI-Zlycoris.git
Restart ComfyUI. No models, no extra downloads.
Where people get burned
- Both encoders must be the same architecture. A Qwen3 encoder blended with something else is meaningless - most keys mismatch, and you get a "merged" dict that's mostly A with a few B surprises. The shape-mismatch warnings in the console are the tell.
- Weight-blending an LLM encoder is crude. Unlike LoRA merging, raw interpolation mixes every weight - attention, norms, embeddings - which can produce an encoder that's subtly off in ways that only show up as odd prompting behavior. It's a tinkering tool, not a production technique. Verify with side-by-side renders before trusting it.
- The merged wrapper's path is synthetic (
merged_clip.safetensors), which is fine for the injector but isn't a real file on disk. - It outputs raw, not a
CLIP. NeedsZImageComfyInjector(or the GGUF injector for quantized input) before a CLIP Text Encode node will accept it. Skipping that step is the standard first-run stumble.
Inputs (3)
| Name | Type | Default | Description |
|---|---|---|---|
| clip_a | RAW_CLIP | — | |
| clip_b | RAW_CLIP | — | |
| strength | FLOAT | 0.500–1 | — |
Outputs (1)
| Name | Type | Description |
|---|---|---|
| RAW_CLIP | RAW_CLIP | — |