VAE Deep Debiaser (Flux 2 Klein — 125 Tensors)
Fix color and contrast at the decoder level
- vae
- vae
- info
Klein has a known, reproducible warm color shift on edits - reported independently at both fp8 and fp16, so it isn't a quantization artifact. If you've tried fixing that with prompt tricks and gotten nowhere, the problem may not be prompt-shaped at all: it can live in specific convolution layers of the VAE decoder, and this node is a knob for exactly those.
What it is and why you'd reach for it
Flux 2 Klein's VAE decodes a 32-channel latent, and this node exposes 125 individually addressable tensor units inside it - every conv layer, norm, shortcut connection, and attention Q/K/V/projection in both the encoder and decoder halves, each with its own strength multiplier. That's a much finer instrument than swapping VAEs wholesale, which is the usual community fix for a VAE that's over-smoothing or shifting color (the standard example being Qwen-Image's VAE, where people drop in the Wan 2.1 decoder instead because the two share a frozen encoder). Here you don't swap anything - you dial down the specific tensor responsible.
All tensors are stored in F32, so there's no quantization getting in the way of any of the 125 controls, unlike the pack's text-encoder debiasers where some layers are locked behind quantized formats.
How it works, and the tip that actually matters
Encoder units only matter for img2img and inpainting - for plain text-to-image, only the decoder half of the VAE ever touches your output, so don't waste time tuning e_* controls if you're only generating from scratch. The pack's own color-tuning guide, baked into the node description, maps decoder stages to what they visibly affect:
d_u0b*_conv*(final decoder stage, 128 channels) - fine color precisiond_u1b*_conv*(256 channels) - color gradients and transitionsd_u2b*/d_u3b*(512 channels) - coarse structure and base toned_mid_attn_*- global spatial color relationshipsd_norm_out- overall brightness/contrastd_conv_out- final RGB mapping, and explicitly flagged as very sensitive - small changes here move the whole image's color more than anywhere else
That last one is the one to touch last, carefully, and in small increments.
Inputs and outputs that matter
- vae - the Flux 2 Klein VAE to edit.
- preset - 22 built-in presets targeting specific decoder regions (Dec All Up0 convs 90%, Dec Mid Attn all 80%, Dec All norms 90%, and more) rather than starting from 125 blank sliders.
- bn, d_pqconv, d_conv_in, the full
d_mid_attn_*/d_mid_b1_*/d_mid_b2_*set, everyd_u0b0throughd_u3b2conv/norm/shortcut/up control, d_norm_out, d_conv_out, and the mirrorede_*encoder set - 125 controls total, each with a toggle and a -5 to 5 strength slider. - save_model / save_mode / filename (optional) - export the modified VAE.
save_modeoffersfull_model,diff_only, orboth. - Outputs: vae (patched, drop straight into your VAE Decode node), info (a text report of what changed).
Installing it
ComfyUI Manager: search "Realtime LoRA Trainer." Manual:
cd ComfyUI/custom_nodes
git clone https://github.com/ShootTheSound/comfyUI-Realtime-Lora
Restart ComfyUI. Works out of the box, same as the rest of the Deep Debiaser & Inspector suite - no extra install beyond the pack. You need a working Flux 2 Klein VAE loaded already; this node edits it, it doesn't fetch one for you.
Troubleshooting
Colors went to noise or a flat wrong tone after one change. You likely touched d_conv_out too aggressively - it's the final RGB mapping stage and the pack explicitly flags it as very sensitive. Make small adjustments there and check the result before moving further.
Tuned encoder units and nothing changed. Expected for plain text-to-image generation - the encoder half of a VAE is only exercised during img2img or inpainting, when an existing image gets encoded into latent space first. For txt2img, only the d_* decoder controls do anything.
Ran the pack's own Inspector node first and the "high impact" tensors don't match the color-tips guide above. The guide is a general map of what each region tends to affect; the pack's companion Inspector node (weight analysis, decode ablation) gives you a per-checkpoint measurement instead of a rule of thumb. When they disagree, trust the Inspector's measured result for your specific VAE over the general guide.
Inputs (255)
| Name | Type | Default | Description |
|---|---|---|---|
| vae | VAE | VAE model (Flux.1 Autoencoder for Flux 2 Klein) | |
| preset | COMBO | Default | 22 options: Custom, Default, Dec All Up0 convs 90%, Dec All Up0 convs 85%, Dec All Up0+Up1 convs 90%, Dec All Up convs 90%, +16 |
| save_model | BOOLEAN | false | Save the modified VAE to disk |
| save_mode | COMBO | full_model | 3 options: full_model, diff_only, both |
| filename | STRING | auto | Filename (no ext). 'auto' = generate from settings. |
| bn | BOOLEAN | true | — |
| bn_str | FLOAT | 1.00-5–5 | — |
| d_pqconv | BOOLEAN | true | — |
| d_pqconv_str | FLOAT | 1.00-5–5 | — |
| d_conv_in | BOOLEAN | true | — |
| d_conv_in_str | FLOAT | 1.00-5–5 | — |
| d_mid_attn_q | BOOLEAN | true | — |
| d_mid_attn_q_str | FLOAT | 1.00-5–5 | — |
| d_mid_attn_k | BOOLEAN | true | — |
| d_mid_attn_k_str | FLOAT | 1.00-5–5 | — |
| d_mid_attn_v | BOOLEAN | true | — |
| d_mid_attn_v_str | FLOAT | 1.00-5–5 | — |
| d_mid_attn_proj_out | BOOLEAN | true | — |
| d_mid_attn_proj_out_str | FLOAT | 1.00-5–5 | — |
| d_mid_attn_norm | BOOLEAN | true | — |
| d_mid_attn_norm_str | FLOAT | 1.00-5–5 | — |
| d_mid_b1_conv1 | BOOLEAN | true | — |
| d_mid_b1_conv1_str | FLOAT | 1.00-5–5 | — |
| d_mid_b1_conv2 | BOOLEAN | true | — |
| d_mid_b1_conv2_str | FLOAT | 1.00-5–5 | — |
| d_mid_b1_norm1 | BOOLEAN | true | — |
| d_mid_b1_norm1_str | FLOAT | 1.00-5–5 | — |
| d_mid_b1_norm2 | BOOLEAN | true | — |
| d_mid_b1_norm2_str | FLOAT | 1.00-5–5 | — |
| d_mid_b2_conv1 | BOOLEAN | true | — |
| d_mid_b2_conv1_str | FLOAT | 1.00-5–5 | — |
| d_mid_b2_conv2 | BOOLEAN | true | — |
| d_mid_b2_conv2_str | FLOAT | 1.00-5–5 | — |
| d_mid_b2_norm1 | BOOLEAN | true | — |
| d_mid_b2_norm1_str | FLOAT | 1.00-5–5 | — |
| d_mid_b2_norm2 | BOOLEAN | true | — |
| d_mid_b2_norm2_str | FLOAT | 1.00-5–5 | — |
| d_u0b0_conv1 | BOOLEAN | true | — |
| d_u0b0_conv1_str | FLOAT | 1.00-5–5 | — |
| d_u0b0_conv2 | BOOLEAN | true | — |
| d_u0b0_conv2_str | FLOAT | 1.00-5–5 | — |
| d_u0b0_norm1 | BOOLEAN | true | — |
| d_u0b0_norm1_str | FLOAT | 1.00-5–5 | — |
| d_u0b0_norm2 | BOOLEAN | true | — |
| d_u0b0_norm2_str | FLOAT | 1.00-5–5 | — |
| d_u0b0_nin_shortcut | BOOLEAN | true | — |
| d_u0b0_nin_shortcut_str | FLOAT | 1.00-5–5 | — |
| d_u0b1_conv1 | BOOLEAN | true | — |
| d_u0b1_conv1_str | FLOAT | 1.00-5–5 | — |
| d_u0b1_conv2 | BOOLEAN | true | — |
| d_u0b1_conv2_str | FLOAT | 1.00-5–5 | — |
| d_u0b1_norm1 | BOOLEAN | true | — |
| d_u0b1_norm1_str | FLOAT | 1.00-5–5 | — |
| d_u0b1_norm2 | BOOLEAN | true | — |
| d_u0b1_norm2_str | FLOAT | 1.00-5–5 | — |
| d_u0b2_conv1 | BOOLEAN | true | — |
| d_u0b2_conv1_str | FLOAT | 1.00-5–5 | — |
| d_u0b2_conv2 | BOOLEAN | true | — |
| d_u0b2_conv2_str | FLOAT | 1.00-5–5 | — |
| d_u0b2_norm1 | BOOLEAN | true | — |
| d_u0b2_norm1_str | FLOAT | 1.00-5–5 | — |
| d_u0b2_norm2 | BOOLEAN | true | — |
| d_u0b2_norm2_str | FLOAT | 1.00-5–5 | — |
| d_u1b0_conv1 | BOOLEAN | true | — |
| d_u1b0_conv1_str | FLOAT | 1.00-5–5 | — |
| d_u1b0_conv2 | BOOLEAN | true | — |
| d_u1b0_conv2_str | FLOAT | 1.00-5–5 | — |
| d_u1b0_norm1 | BOOLEAN | true | — |
| d_u1b0_norm1_str | FLOAT | 1.00-5–5 | — |
| d_u1b0_norm2 | BOOLEAN | true | — |
| d_u1b0_norm2_str | FLOAT | 1.00-5–5 | — |
| d_u1b0_nin_shortcut | BOOLEAN | true | — |
| d_u1b0_nin_shortcut_str | FLOAT | 1.00-5–5 | — |
| d_u1b1_conv1 | BOOLEAN | true | — |
| d_u1b1_conv1_str | FLOAT | 1.00-5–5 | — |
| d_u1b1_conv2 | BOOLEAN | true | — |
| d_u1b1_conv2_str | FLOAT | 1.00-5–5 | — |
| d_u1b1_norm1 | BOOLEAN | true | — |
| d_u1b1_norm1_str | FLOAT | 1.00-5–5 | — |
| d_u1b1_norm2 | BOOLEAN | true | — |
| d_u1b1_norm2_str | FLOAT | 1.00-5–5 | — |
| d_u1b2_conv1 | BOOLEAN | true | — |
| d_u1b2_conv1_str | FLOAT | 1.00-5–5 | — |
| d_u1b2_conv2 | BOOLEAN | true | — |
| d_u1b2_conv2_str | FLOAT | 1.00-5–5 | — |
| d_u1b2_norm1 | BOOLEAN | true | — |
| d_u1b2_norm1_str | FLOAT | 1.00-5–5 | — |
| d_u1b2_norm2 | BOOLEAN | true | — |
| d_u1b2_norm2_str | FLOAT | 1.00-5–5 | — |
| d_u1_up | BOOLEAN | true | — |
| d_u1_up_str | FLOAT | 1.00-5–5 | — |
| d_u2b0_conv1 | BOOLEAN | true | — |
| d_u2b0_conv1_str | FLOAT | 1.00-5–5 | — |
| d_u2b0_conv2 | BOOLEAN | true | — |
| d_u2b0_conv2_str | FLOAT | 1.00-5–5 | — |
| d_u2b0_norm1 | BOOLEAN | true | — |
| d_u2b0_norm1_str | FLOAT | 1.00-5–5 | — |
| d_u2b0_norm2 | BOOLEAN | true | — |
| d_u2b0_norm2_str | FLOAT | 1.00-5–5 | — |
| d_u2b1_conv1 | BOOLEAN | true | — |
| d_u2b1_conv1_str | FLOAT | 1.00-5–5 | — |
| d_u2b1_conv2 | BOOLEAN | true | — |
| d_u2b1_conv2_str | FLOAT | 1.00-5–5 | — |
| d_u2b1_norm1 | BOOLEAN | true | — |
| d_u2b1_norm1_str | FLOAT | 1.00-5–5 | — |
| d_u2b1_norm2 | BOOLEAN | true | — |
| d_u2b1_norm2_str | FLOAT | 1.00-5–5 | — |
| d_u2b2_conv1 | BOOLEAN | true | — |
| d_u2b2_conv1_str | FLOAT | 1.00-5–5 | — |
| d_u2b2_conv2 | BOOLEAN | true | — |
| d_u2b2_conv2_str | FLOAT | 1.00-5–5 | — |
| d_u2b2_norm1 | BOOLEAN | true | — |
| d_u2b2_norm1_str | FLOAT | 1.00-5–5 | — |
| d_u2b2_norm2 | BOOLEAN | true | — |
| d_u2b2_norm2_str | FLOAT | 1.00-5–5 | — |
| d_u2_up | BOOLEAN | true | — |
| d_u2_up_str | FLOAT | 1.00-5–5 | — |
| d_u3b0_conv1 | BOOLEAN | true | — |
| d_u3b0_conv1_str | FLOAT | 1.00-5–5 | — |
| d_u3b0_conv2 | BOOLEAN | true | — |
| d_u3b0_conv2_str | FLOAT | 1.00-5–5 | — |
| d_u3b0_norm1 | BOOLEAN | true | — |
| d_u3b0_norm1_str | FLOAT | 1.00-5–5 | — |
| d_u3b0_norm2 | BOOLEAN | true | — |
| d_u3b0_norm2_str | FLOAT | 1.00-5–5 | — |
| d_u3b1_conv1 | BOOLEAN | true | — |
| d_u3b1_conv1_str | FLOAT | 1.00-5–5 | — |
| d_u3b1_conv2 | BOOLEAN | true | — |
| d_u3b1_conv2_str | FLOAT | 1.00-5–5 | — |
| d_u3b1_norm1 | BOOLEAN | true | — |
| d_u3b1_norm1_str | FLOAT | 1.00-5–5 | — |
| d_u3b1_norm2 | BOOLEAN | true | — |
| d_u3b1_norm2_str | FLOAT | 1.00-5–5 | — |
| d_u3b2_conv1 | BOOLEAN | true | — |
| d_u3b2_conv1_str | FLOAT | 1.00-5–5 | — |
| d_u3b2_conv2 | BOOLEAN | true | — |
| d_u3b2_conv2_str | FLOAT | 1.00-5–5 | — |
| d_u3b2_norm1 | BOOLEAN | true | — |
| d_u3b2_norm1_str | FLOAT | 1.00-5–5 | — |
| d_u3b2_norm2 | BOOLEAN | true | — |
| d_u3b2_norm2_str | FLOAT | 1.00-5–5 | — |
| d_u3_up | BOOLEAN | true | — |
| d_u3_up_str | FLOAT | 1.00-5–5 | — |
| d_norm_out | BOOLEAN | true | — |
| d_norm_out_str | FLOAT | 1.00-5–5 | — |
| d_conv_out | BOOLEAN | true | — |
| d_conv_out_str | FLOAT | 1.00-5–5 | — |
| e_conv_in | BOOLEAN | true | — |
| e_conv_in_str | FLOAT | 1.00-5–5 | — |
| e_d0b0_conv1 | BOOLEAN | true | — |
| e_d0b0_conv1_str | FLOAT | 1.00-5–5 | — |
| e_d0b0_conv2 | BOOLEAN | true | — |
| e_d0b0_conv2_str | FLOAT | 1.00-5–5 | — |
| e_d0b0_norm1 | BOOLEAN | true | — |
| e_d0b0_norm1_str | FLOAT | 1.00-5–5 | — |
| e_d0b0_norm2 | BOOLEAN | true | — |
| e_d0b0_norm2_str | FLOAT | 1.00-5–5 | — |
| e_d0b1_conv1 | BOOLEAN | true | — |
| e_d0b1_conv1_str | FLOAT | 1.00-5–5 | — |
| e_d0b1_conv2 | BOOLEAN | true | — |
| e_d0b1_conv2_str | FLOAT | 1.00-5–5 | — |
| e_d0b1_norm1 | BOOLEAN | true | — |
| e_d0b1_norm1_str | FLOAT | 1.00-5–5 | — |
| e_d0b1_norm2 | BOOLEAN | true | — |
| e_d0b1_norm2_str | FLOAT | 1.00-5–5 | — |
| e_d0_down | BOOLEAN | true | — |
| e_d0_down_str | FLOAT | 1.00-5–5 | — |
| e_d1b0_conv1 | BOOLEAN | true | — |
| e_d1b0_conv1_str | FLOAT | 1.00-5–5 | — |
| e_d1b0_conv2 | BOOLEAN | true | — |
| e_d1b0_conv2_str | FLOAT | 1.00-5–5 | — |
| e_d1b0_norm1 | BOOLEAN | true | — |
| e_d1b0_norm1_str | FLOAT | 1.00-5–5 | — |
| e_d1b0_norm2 | BOOLEAN | true | — |
| e_d1b0_norm2_str | FLOAT | 1.00-5–5 | — |
| e_d1b0_nin_shortcut | BOOLEAN | true | — |
| e_d1b0_nin_shortcut_str | FLOAT | 1.00-5–5 | — |
| e_d1b1_conv1 | BOOLEAN | true | — |
| e_d1b1_conv1_str | FLOAT | 1.00-5–5 | — |
| e_d1b1_conv2 | BOOLEAN | true | — |
| e_d1b1_conv2_str | FLOAT | 1.00-5–5 | — |
| e_d1b1_norm1 | BOOLEAN | true | — |
| e_d1b1_norm1_str | FLOAT | 1.00-5–5 | — |
| e_d1b1_norm2 | BOOLEAN | true | — |
| e_d1b1_norm2_str | FLOAT | 1.00-5–5 | — |
| e_d1_down | BOOLEAN | true | — |
| e_d1_down_str | FLOAT | 1.00-5–5 | — |
| e_d2b0_conv1 | BOOLEAN | true | — |
| e_d2b0_conv1_str | FLOAT | 1.00-5–5 | — |
| e_d2b0_conv2 | BOOLEAN | true | — |
| e_d2b0_conv2_str | FLOAT | 1.00-5–5 | — |
| e_d2b0_norm1 | BOOLEAN | true | — |
| e_d2b0_norm1_str | FLOAT | 1.00-5–5 | — |
| e_d2b0_norm2 | BOOLEAN | true | — |
| e_d2b0_norm2_str | FLOAT | 1.00-5–5 | — |
| e_d2b0_nin_shortcut | BOOLEAN | true | — |
| e_d2b0_nin_shortcut_str | FLOAT | 1.00-5–5 | — |
| e_d2b1_conv1 | BOOLEAN | true | — |
| e_d2b1_conv1_str | FLOAT | 1.00-5–5 | — |
| e_d2b1_conv2 | BOOLEAN | true | — |
| e_d2b1_conv2_str | FLOAT | 1.00-5–5 | — |
| e_d2b1_norm1 | BOOLEAN | true | — |
| e_d2b1_norm1_str | FLOAT | 1.00-5–5 | — |
| e_d2b1_norm2 | BOOLEAN | true | — |
| e_d2b1_norm2_str | FLOAT | 1.00-5–5 | — |
| e_d2_down | BOOLEAN | true | — |
| e_d2_down_str | FLOAT | 1.00-5–5 | — |
| e_d3b0_conv1 | BOOLEAN | true | — |
| e_d3b0_conv1_str | FLOAT | 1.00-5–5 | — |
| e_d3b0_conv2 | BOOLEAN | true | — |
| e_d3b0_conv2_str | FLOAT | 1.00-5–5 | — |
| e_d3b0_norm1 | BOOLEAN | true | — |
| e_d3b0_norm1_str | FLOAT | 1.00-5–5 | — |
| e_d3b0_norm2 | BOOLEAN | true | — |
| e_d3b0_norm2_str | FLOAT | 1.00-5–5 | — |
| e_d3b1_conv1 | BOOLEAN | true | — |
| e_d3b1_conv1_str | FLOAT | 1.00-5–5 | — |
| e_d3b1_conv2 | BOOLEAN | true | — |
| e_d3b1_conv2_str | FLOAT | 1.00-5–5 | — |
| e_d3b1_norm1 | BOOLEAN | true | — |
| e_d3b1_norm1_str | FLOAT | 1.00-5–5 | — |
| e_d3b1_norm2 | BOOLEAN | true | — |
| e_d3b1_norm2_str | FLOAT | 1.00-5–5 | — |
| e_mid_attn_q | BOOLEAN | true | — |
| e_mid_attn_q_str | FLOAT | 1.00-5–5 | — |
| e_mid_attn_k | BOOLEAN | true | — |
| e_mid_attn_k_str | FLOAT | 1.00-5–5 | — |
| e_mid_attn_v | BOOLEAN | true | — |
| e_mid_attn_v_str | FLOAT | 1.00-5–5 | — |
| e_mid_attn_proj_out | BOOLEAN | true | — |
| e_mid_attn_proj_out_str | FLOAT | 1.00-5–5 | — |
| e_mid_attn_norm | BOOLEAN | true | — |
| e_mid_attn_norm_str | FLOAT | 1.00-5–5 | — |
| e_mid_b1_conv1 | BOOLEAN | true | — |
| e_mid_b1_conv1_str | FLOAT | 1.00-5–5 | — |
| e_mid_b1_conv2 | BOOLEAN | true | — |
| e_mid_b1_conv2_str | FLOAT | 1.00-5–5 | — |
| e_mid_b1_norm1 | BOOLEAN | true | — |
| e_mid_b1_norm1_str | FLOAT | 1.00-5–5 | — |
| e_mid_b1_norm2 | BOOLEAN | true | — |
| e_mid_b1_norm2_str | FLOAT | 1.00-5–5 | — |
| e_mid_b2_conv1 | BOOLEAN | true | — |
| e_mid_b2_conv1_str | FLOAT | 1.00-5–5 | — |
| e_mid_b2_conv2 | BOOLEAN | true | — |
| e_mid_b2_conv2_str | FLOAT | 1.00-5–5 | — |
| e_mid_b2_norm1 | BOOLEAN | true | — |
| e_mid_b2_norm1_str | FLOAT | 1.00-5–5 | — |
| e_mid_b2_norm2 | BOOLEAN | true | — |
| e_mid_b2_norm2_str | FLOAT | 1.00-5–5 | — |
| e_norm_out | BOOLEAN | true | — |
| e_norm_out_str | FLOAT | 1.00-5–5 | — |
| e_conv_out | BOOLEAN | true | — |
| e_conv_out_str | FLOAT | 1.00-5–5 | — |
| e_qconv | BOOLEAN | true | — |
| e_qconv_str | FLOAT | 1.00-5–5 | — |
Outputs (2)
| Name | Type | Description |
|---|---|---|
| vae | VAE | VAE with per-tensor modifications |
| info | STRING | Text summary |