Nodes/ComfyUI-Zlycoris/Z-Image Raw Model Merge
ComfyUI Node

Z-Image Raw Model Merge

Blend two model state dicts by weight

By TripleHeadedMonkey·Created 7 months ago·Updated 7 months ago· 4
Z-Image Raw Model Merge
  • model_a
  • model_b
  • RAW_MODEL
strength0.50

Where ZImageVectorMerge and ZImageTIESMerge operate on loaded MODEL objects, ZImageRawModelMerge works in raw land: it takes two RAW_MODEL state dicts and blends them weight-by-weight - A × (1 − strength) + B × strength - then hands you back a single merged RAW_MODEL. No MODEL patchers, no cloning, no GPU inference structures. Just tensors, math, and a merged state dict that can then go through the injector or a save node.

Why use raw when the MODEL-level merges exist

Because raw is where the other raw nodes live. The real power isn't the merge itself - it's what you can do around it in one graph:

  • Merge patched states. ZImageComfyUninjector gives you raw dicts with LoRAs baked in. Merge two of those and you're blending models that have adapters applied, which the MODEL-level nodes can't even see.
  • Merge anything that's already raw. GGUF-dequantized dicts from the standalone loader, diffusers-converted dicts from ZImageDiffusersLoader, or outputs of the merge itself (it's composable - merge a merge).
  • Then save. Route the merged raw into ZImageSaveTransformer and you've exported a permanent blended checkpoint.

If all you want is a quick Turbo+Base weight blend straight from two loaders, ZImageVectorMerge is simpler - it goes model-to-model with no raw detour. This node is for when you're already swimming in raw data.

The inputs

  • model_a (RAW_MODEL) - the base you keep.
  • model_b (RAW_MODEL) - the flavor you blend in.
  • strength - 0.0 to 1.0, default 0.5 (a straight 50/50). Unlike the vector merge, it won't go negative or past 1 - this is a plain convex blend.

Output is a single RAW_MODEL. The merge is shape-aware: keys that exist in only one side are kept as-is, and keys with mismatched shapes are kept from A with a console warning instead of a crash. It runs in float32 for the math and casts back to the source dtype per key.

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 dependencies.

Where people get burned

  • Silent shape mismatches. The "keeping A" warning is easy to miss, and a merge full of those produces a Frankenstein dict that only fails later, at injection or sampling time. Same-architecture models only - and given the community's doubts about how directly related Turbo and Base really are, verify with a test render.
  • Strength is capped at 1.0. That's a feature (it's a real interpolation), but people coming from the ±2 vector merge sometimes expect to overshoot. If you want to push past 100% of B, chain two merges or use the vector merge node.
  • The merged wrapper gets a synthetic path (merged_model.safetensors). That's fine for the injector - it intercepts the file read - but don't expect the path to point at a real file on disk.
  • Nothing here samples on its own. RAW_MODEL output needs ZImageComfyInjector (or ZImageGGUFInjector for quantized data) before a KSampler will touch it.
CategoryZ-Image/Loaders

Inputs (3)

NameTypeDefaultDescription
model_aRAW_MODEL
model_bRAW_MODEL
strengthFLOAT0.500–1

Outputs (1)

NameTypeDescription
RAW_MODELRAW_MODEL