ComfyUI Node

VAE Network Bending

Surgery on the VAE itself, not the images it produces

By DavidPiazza·Created about a year ago·Updated 9 months ago· 0
VAE Network Bending
  • vae
  • vae
operationadd_noise
intensity0.10
target_componentboth
preserve_meantrue
seed-1

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 by intensity and each tensor's std. With preserve_mean on (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. decoder is 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.

Categorynetwork_bending/vae

Inputs (6)

NameTypeDefaultDescription
vaeVAEThe VAE model to modify
operationCOMBOadd_noiseVAE-specific bending operation
intensityFLOAT0.100–1Strength of the operation
target_componentCOMBObothWhich part of the VAE to modify
preserve_meanBOOLEANtruePreserve weight means to maintain stability
seedINT-1-1–4294967295

Outputs (1)

NameTypeDescription
vaeVAEModified VAE with network bending applied