Bendable Layer Catalogue
The JSON list of every layer you're allowed to poke
- model
- catalogue
Every bending node in this pack wants a layer path - middle_block.2.out_layers, output_blocks.5.1, blocks.15.ffn - and no two model families name their layers the same way. Bendable Layer Catalogue is how you find one without guessing. Hand it a MODEL, get back a JSON catalogue of the layer paths inside it, each marked with whether it can be bent and a note saying how.
It's the boring node you'll use on every new model before you touch anything fun.
What comes out
A single STRING output, catalogue, containing JSON with three parts:
- model - the diffusion model's class name, so you know what you're actually looking at.
- block_lists - for transformer models, which of the recognised block lists exist and how many blocks each has, with a ready-made spec string for DiT Block Bending (e.g.
double:0-27). - layers - the list. Each entry has a
path, aclass, ahookableflag and, where relevant, anoteand aleafflag.
The notes are the useful bit, because they encode the pack's own rules:
- A
ModuleListis marked not hookable - it's never called directly, so a bend on it does nothing. The note tells you to usepath.<i>instead. - A container module (anything subclassing
TimestepEmbedSequential, likemiddle_block,output_blocks.4) is marked hookable-with-caveat: the bend lands on its last child, and the note names the resolved path. - A transformer block in a known DiT block list is marked hookable with the advice to use DiT Block Bending with
double:<i>/single:<i>, because a direct hook only bends the first of the block's several outputs. - Leaves (no children) get a
leaf: trueflag, which is usually what you want when you're looking for an actual tensor-producing layer.
Inputs
- model - any MODEL wire, typically straight off your checkpoint or UNet loader. It doesn't modify anything, so you can leave it dangling off the loader in parallel with the rest of the graph.
- filter - only list paths containing this text. Default empty (everything).
middle_block,attn,out_layersandoutput_blocks.5are all good filters. - max_depth - default 3, range 1–12. Path depth, not tensor depth: at depth 3 you see
output_blocks.5.1but notoutput_blocks.5.1.transformer_blocks.0.attn1.to_q. Raise it when you need to bend something surgical.
And that's it - one input trio, one output, no model mutation.
Reading the output
Wire catalogue into Show Text, Preview Any, or a save-to-file node; it's a string, so it renders as text. The workflow is: run it once, search the text for the kind of layer you want (attention = attn, output projection = out_layers, the middle = middle_block), copy the path, paste it into Model Bending or an inspector.
If you're on a UNet model (SD 1.5, SDXL and their fine-tunes), you'll see input_blocks, middle_block, output_blocks - the classic structure, and middle_block.* is the popular place to start because it's small enough to bend hard without wrecking the image. In the pack's own examples, middle_block.2.out_layers is where rotating and adding scalars produces the demo GIFs.
If you're on a transformer model (Flux, SD3, WAN, Qwen-Image, LTX, HunyuanVideo), skip the layer-by-layer hunting and just take the dit_block_bending spec out of block_lists. Bending blocks is more predictable than bending individual leaves.
Install
ComfyUI Manager → "ComfyUI Model Bending", or:
cd ComfyUI/custom_nodes
git clone https://github.com/abuzreq/ComfyUI-Model-Bending
pip install -r ComfyUI-Model-Bending/requirements.txt
kornia and scikit-learn, then restart ComfyUI. Logs carry the [model-bending] prefix, and this node raises a plain "no diffusion model found" if you hand it something that isn't one.
Where people get burned
- Copying a path from one model to another. The catalogue describes this model.
output_blocks.5.1on an SDXL checkpoint has no meaning on Flux, and vice versa. - Filtering too hard. An over-specific filter shows an empty list, which reads as "nothing is bendable" rather than "your filter matched nothing".
- Bending a
ModuleListanyway. You'll get a warning and no effect, and it's an easy hour to lose if you don't read thehookable: falseflag. - Forgetting this is a diagnostic. It doesn't inject anything, doesn't stack with other bending nodes and has no MODEL output to pass downstream. It's a map, not a tunnel.
Model Inspector is the sibling node worth knowing: it prints the model structure as a tree, less machine-readable, easier to eyeball when you don't yet know the lay of the land.
Inputs (3)
| Name | Type | Default | Description |
|---|---|---|---|
| model | MODEL | — | |
| filter | STRING | Only list paths containing this text | |
| max_depth | INT | 31–12 | — |
Outputs (1)
| Name | Type | Description |
|---|---|---|
| catalogue | STRING | — |