ComfyUI Node

VAE Mixer

Blend two VAEs like you'd blend two checkpoints

By DavidPiazza·Created about a year ago·Updated 9 months ago· 0
VAE Mixer
  • vae_a
  • vae_b
  • vae
mix_modelinear_blend
mix_ratio0.50

Checkpoint merging gets all the attention, but your VAE is a network too - and you can merge those just the same. VAEMixer takes two VAE models, blends their weights, and hands back a single VAE you can drop into any encode/decode step. People mostly use this to fix or mutate image quality: blend a checkpoint's own VAE with a "better" community VAE and tune the ratio until the colors are exactly right, no file juggling required.

How it works

The node deep-copies VAE A as the base, then pulls the encoder and decoder out of both VAEs and mixes them according to mix_mode:

  • linear_blend - weighted average of every matching weight in both encoder and decoder. The default, and the "classic merge" experience.
  • encoder_swap - if mix_ratio is above 0.5, B's encoder replaces A's; otherwise A's stays. Mix-and-match encoders and decoders.
  • decoder_swap - the mirror: swap the decoder at the 0.5 boundary.
  • cross_architecture - blends the encoders by 1 - mix_ratio and the decoders by mix_ratio, so you can push the two halves in opposite directions.
  • layer_shuffle - randomly picks each layer from either VAE, weighted by mix_ratio, so you get a Frankenstein of whole layers instead of averaged ones.

Weights are matched by parameter name and shape, so this works best when both VAEs are the same architecture - an SDXL VAE blended with another SDXL VAE, not a Stable Audio VAE fused with a SD1.5 one.

One honest caveat, same as its cousin ModelMixer: the dropdown lists six modes but the shipped 0.0.1 code implements five - frequency_mix is declared and not wired up. Pick it and you'll get the base clone with no error and no change. Check the repo's current state; it may be fixed by the time you read this.

The inputs that matter

  • vae_a / vae_b - the two VAEs, from whatever VAE loaders your workflow uses.
  • mix_mode - linear_blend to start; encoder_swap/decoder_swap for surgical swaps.
  • mix_ratio - 0–1; 0 is all A, 1 is all B.

Output is vae, ready to wire into VAEDecode or VAEEncode.

Installing it

From DavidPiazza/network_bending - ComfyUI Manager ("Network Bending") or:

cd ComfyUI/custom_nodes
git clone https://github.com/DavidPiazza/network_bending.git

Restart. No pip step for the core nodes.

Where people get burned

The classic trap is blending VAEs that weren't trained the same way and getting muddy, low-contrast output - the VAE is subtle, and a bad blend shows up as "everything looks slightly wrong" rather than a crash. Go 90/10 first and work toward the middle; you usually don't need a 50/50 VAE blend. And remember the same rule that applies to every node in this pack: the result is in-memory and per-run. If you find a VAE blend you love, save the decoded output - re-running won't remember it.

Categorynetwork_bending/vae

Inputs (4)

NameTypeDefaultDescription
vae_aVAEFirst VAE model
vae_bVAESecond VAE model
mix_modeCOMBOlinear_blendHow to mix the VAE models
mix_ratioFLOAT0.500–1

Outputs (1)

NameTypeDescription
vaeVAE