VAE Network Bending
Surgery on the VAE itself, not the images it produces
- vae
- vae
The VAE is the quiet workhorse - it turns pixels into latents and back, and nobody thinks about it until the colors go grey. VAENetworkBending is for when you do want to think about it: it corrupts the VAE's own weights, so every image that passes through the modified encoder or decoder picks up the damage. Bend the encoder and every image you encode inherits the weirdness; bend the decoder and the whole workflow's output gets a character. It's the "ruin the camera lens" approach to glitch art.
How it works
The node deep-copies the VAE (so your loaded original is safe), finds its encoder and decoder, and applies the operation to the target_component you name - both, encoder, decoder, or latent_layers:
add_noise- Gaussian noise added to weights, scaled byintensityand each tensor's std. Withpreserve_meanon (the default), the noise is zero-mean, which keeps the VAE from drifting into instability - a nice touch that most weight-noise hacks skip.scale_weights- multiply weights by a factor (0–1 maps to 0–2×).asymmetric_noise- noise the encoder at only 30% of the decoder's intensity, so one half of the pipeline degrades faster than the other.channel_corruption- zeroes/scrambles a fraction of the channels in each conv weight.progressive_corruption- ramps corruption linearly through the layers, so early layers stay clean and later ones get trashed. Great for "the structure is fine but the texture is off."
That's the implemented set - five real operations. The dropdown lists seven; latent_space_expand and encoder_decoder_swap are declared but not wired up in the shipped 0.0.1 code. Same story as a few of its siblings: pick one and you get an unchanged clone and no error. Check the repo before building on them.
The inputs that matter
vae- the VAE to modify.operation- the five working modes above.intensity- 0–1, the amount of damage.target_component- where the damage lands.decoderis the highest-visibility choice since it touches every decode.preserve_mean- keep it on unless you're chasing chaos.seed- for reproducible damage.
Output is vae, a modified VAE you can wire into VAEDecode.
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 requirements for the core nodes.
Gotchas
The most common mistake is bending the VAE you're also using to save your work - a corrupted decoder makes every preview and every saved PNG come out wrong, which is confusing until you remember what you did. Keep a clean VAE in the graph or use a separate one for the "bent" branch of the workflow. And as always with this pack: in-memory, per-run, nothing written to disk - note your seed and settings if you find a look worth keeping.
Inputs (6)
| Name | Type | Default | Description |
|---|---|---|---|
| vae | VAE | The VAE model to modify | |
| operation | COMBO | add_noise | VAE-specific bending operation |
| intensity | FLOAT | 0.100–1 | Strength of the operation |
| target_component | COMBO | both | Which part of the VAE to modify |
| preserve_mean | BOOLEAN | true | Preserve weight means to maintain stability |
| seed | INT | -1-1–4294967295 | — |
Outputs (1)
| Name | Type | Description |
|---|---|---|
| vae | VAE | Modified VAE with network bending applied |