Nodes/ComfyUI Model Bending/Model Bending (SD Blocks)
ComfyUI Node

Model Bending (SD Blocks)

Point at a block, skip the path syntax

By abuzreq·Created about a year ago·Updated 3 months ago· 21
Model Bending (SD Blocks)
  • model
  • bending_module
  • MODEL
block_typeinput_blocks
block_index0

If Model Bending is the one that makes you type middle_block.2.out_layers and hope, Model Bending (SD Blocks) is the friendly version: pick a block and an index from a dropdown, and it bends whatever lives there. Same mechanism, no path strings, no Inspector spelunking required. It's the node you reach for when you want to start experimenting on an SD-style UNet in about ten seconds.

The catch is in the name - it's built for Stable Diffusion's classic UNet layout, the input_blocks / middle_block / output_blocks U-shape that SD 1.5 and SDXL share. A Flux transformer doesn't have that structure, so this node won't help you there; the plain Model Bending node with a custom path is your Flux route.

How it works

Under the hood it's the same forward-hook machinery as Model Bending. The node clones your model, grabs the UNet, and resolves a target from two numbers instead of a string:

  • block_type - input_blocks, middle_block, or output_blocks. The encoder side, the bottleneck, or the decoder side of the U.
  • block_index (INT, default 0, range 0–20) - which block inside that section.

For middle_block the index is ignored - the middle block is a single container, so the whole thing gets bent. For the input/output blocks, an index past the end clamps to the last block instead of erroring, which is forgiving but can surprise you if you typed 12 on a model that only has 11.

The input that matters

Honestly, just one: bending_module. Everything else is picking where to aim. Multiply Scalar is the classic first choice - bend output_blocks at low index to mangle the start of the decode, or middle_block to hit the bottleneck where the whole image's global structure is decided. The README's own showcase bends middle_block - rotating its output a full 360° produces the analog-portrait morph loop.

Wire it like this:

  1. Checkpoint → Model Bending (SD Blocks) → KSampler
  2. Multiply Scalar Module (Bending) (or Rotate, Threshold, Sobel, …) → bending_module

Output is a single MODEL downstream to the sampler.

Installing

Ships in the ComfyUI-Model-Bending pack:

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

Restart ComfyUI and refresh the tab, or install via ComfyUI Manager (search ComfyUI-Model-Bending). Just kornia + scikit-learn for dependencies, no model downloads. Keep the clone folder named ComfyUI-Model-Bending - the README's ComfyUI-Web-Bend-Demo folder name is stale.

Where people get tripped up

If nothing changes, your bending module is probably at an identity default - Multiply Scalar at 1, Rotate at 0, Threshold at 0. Change the value and watch. Also remember "bend" here is a global, every-step operation by default; if you only want the effect at one denoising step you need the steps_to_bend controls that live on the custom-path Model Bending node, not this one. And if you're on Flux and this node does nothing, that's not a bug - it's the wrong tool; use Model Bending with paths from the Interactive Web UI instead.

Categorymodel_bending

Inputs (4)

NameTypeDefaultDescription
modelMODEL
bending_moduleBENDING_MODULE
block_typeCOMBOinput_blocks3 options: input_blocks, middle_block, output_blocks
block_indexINT00–20

Outputs (1)

NameTypeDescription
MODELMODEL