Four VAE-focused nodes covering merging, latent diagnostics, and model introspection.
Merge two (or three) VAEs using one of eight algorithms:
weighted_sum—out = (1-α)·A + α·Badd_difference—out = A + α·(B - C)(requiresvae_c)tensor_sum— element-wise mean of A and Btriple_sum— equal mean of A, B, C (requiresvae_c)slerp— spherical linear interpolation of flattened parametersdare_ties— DARE/TIES with sparsity drop and sign-resolutionblock_swap— replace whole blocks of A with B according to per-block weightsclamp_interp— likeweighted_sumbut bounds the result to the per-tensor range of A and B
Pass either a JSON object or a comma-separated list to override the
global alpha for individual blocks. Recognised names follow the
SD/SDXL VAE block layout (block_conv_in, block_0..3, block_mid,
block_norm_out, block_conv_out).
After the merge, two scalar tweaks can be applied to the
decoder.conv_out weights only — useful for nudging output luminance
without retraining.
The merged VAE is returned as a fresh deepcopy; the inputs are never
modified. The merge runs on CPU in float32 and is cast back to the
source dtype before being installed into the wrapper.
Per-channel min / max / mean / std / abs_mean stats across the latent,
plus NaN/Inf counts and an overall verdict:
corrupt— non-zero NaN or Inf countsaturated— channel abs_mean exceeds 30 (suggests clipping)low_contrast— channel std below 0.05healthy— none of the above
Use fail_on_corrupt=True to raise hard on corrupt latents (useful as a
sentinel in long batched runs).
Computes cosine similarity between two VAEs:
- Globally (over all common parameters)
- Per block (using the same SD/SDXL layout as VAEMerge)
- Optionally per tensor
Reports tensors that exist only in one model — handy for debugging mismatched checkpoints.
Per-block weight statistics (mean / std / abs_mean / count) for a single VAE. Useful to spot blocks dominated by NaN/zeros, or to compare fine-tunes against a reference.