KJNodes/vaegenerated

VAE Merge KJ(VAEMergeKJ)

Merge two VAEs by weighted-averaging their weights. ratio is the weight toward vae_2 (0.0 = pure vae_1, 1.0 = pure vae_2). Both VAEs must share the same architecture (matching state dict keys and shapes).

VAE Merge KJ

vae_1
vae_2
vae
ratio
0.50
KJNodes

Description

Merges two VAEs by weighted-averaging their state dictionary weights. The ratio parameter controls the interpolation: 0.0 yields pure vae_1, 1.0 yields pure vae_2, and intermediate values produce a linear blend. Both VAEs must share the same architecture (matching state dict keys and tensor shapes) for the merge to succeed.

Inputs

NameTypeDefaultMinMaxStepDescription
vae_1VAEFirst VAE (contributes 1 - ratio to the blend).
vae_2VAESecond VAE (contributes ratio to the blend).
ratioFLOAT0.50.01.00.01Weight toward vae_2. 0.0 = all vae_1, 1.0 = all vae_2.

Outputs

NameTypeDescription
VAEA new VAE whose weights are the element-wise weighted average of the two input VAEs.

Usage Notes

  • Both VAEs must have identical state dictionary keys and tensor shapes. If they differ (e.g., different model architectures, latent dimensions, or channel configurations), the node will raise an error.
  • This is a simple linear interpolation of model weights, not a more sophisticated merging technique. It is useful for blending between different VAE finetunes or for testing smooth transitions in latent space behavior.
  • The original input VAEs are not modified. A new VAE object is created with the interpolated weights.
  • The ratio step of 0.01 allows fine-grained control; use the slider or type a value directly.

Comments

Sign in with GitHub to join the discussion.

Loading comments…
VAE Merge KJ (VAEMergeKJ) - ComfyUI-KJNodes | ComfyUI Wiki