Nodes/ComfyUI Model Bending/Model VAE Inspector
ComfyUI Node

Model VAE Inspector

The address book you need before bending a VAE

By abuzreq·Created about a year ago·Updated 3 months ago· 21
Model VAE Inspector
  • vae
  • STRING
  • VAE
path_placeholder

Bending a VAE is a shot in the dark until you know what's inside it. That's the job of this node: it dumps the VAE's internal structure to your browser as an interactive tree, so you can find the exact layer path to feed into the pack's Model VAE Bending node. Without it, you're typing paths blind and hoping.

Model bending lives and dies by addresses. The Model Bending nodes inject a bending module at a path like decoder.mid.block.2.conv, and that path has to point at something real. The Model Inspector node does this for the UNet; this one is the VAE sibling. You wire a VAE in, run the prompt once, and a tree of every submodule - encoder, bottleneck, decoder, the lot - appears in a panel rendered by the pack's frontend JS. Click around, copy a path, and paste it into Model VAE Bending.

The mechanism is simple under the hood: the node walks vae.patcher.model with named_modules(), serializes the tree as JSON, and pushes it to the browser over ComfyUI's websocket (model_bending.inspect_model event). The heavy lifting is all frontend.

Inputs are the two you see: vae, and path_placeholder - a text field that exists mostly as a UI anchor; it's not used for navigation, the tree is. Outputs are a STRING (it echoes your path_placeholder text back, which is the pack's pattern for plumbing paths around) and the VAE itself, passed straight through. So you can drop this node inline in a graph, read a path out of one output and keep the VAE flowing to your decoder - no graph surgery needed.

Install is the standard one for this pack: ComfyUI Manager → search "ComfyUI-Model-Bending" → install → restart, then refresh your browser (the refresh matters - the tree panel is JS, and a stale page won't show it). Manual route:

cd ComfyUI/custom_nodes
git clone https://github.com/abuzreq/ComfyUI-Model-Bending

then restart. The pack depends on kornia and scikit-learn; Manager installs them, or pip install -r requirements.txt if you cloned by hand.

The thing to watch: the tree only renders after you actually run the graph once - the node sends the structure when it executes. If you queue a prompt and see no panel, check your browser console and make sure you're not on a cached page. And keep expectations calibrated: the VAE tree is deeper and uglier than the UNet's, and bending a decoder layer tends to produce wild color/geometry distortion fast. That's the point, but go small on the scalar.

Categorymodel_bending

Inputs (2)

NameTypeDefaultDescription
vaeVAE
path_placeholderSTRING

Outputs (2)

NameTypeDescription
STRINGSTRING
VAEVAE