Erosion Module (Bending)
Shrink the signal and strip a layer's texture
- BENDING_MODULE
The inverse of dilation, and arguably the more interesting half of the pair. Erosion shrinks bright regions in an image; applied to a model's activations it suppresses the layer's responses, whittling feature maps down to their strongest cores. Bend a UNet layer with this and fine texture gets stripped away, thin structures vanish, and the image tends toward its skeleton - clean, hard, slightly skeletal. It's the closest thing in the pack to a "subtract detail" button that acts on the model's internals rather than the output pixels.
As with every BENDING_MODULE node here, it's a builder: you get a module, then you inject it at a layer with Model Bending, Model Bending (SD Layers), or Model VAE Bending. Mechanically it calls kornia's morphology.erosion with a square kernel of ones - the same kornia dependency the dilation, gradient, and sobel modules share, which is why the pack pins it in requirements.
One input: kernel_size, default 3, range 1–10. The size of the erosion window, and the entire strength dial. At 3 you get a subtle etching effect on texture-heavy layers; at 7–10 the layer's responses are eroded so hard that the image goes flat and graphic, losing almost all interior detail. Erosion hits weakest activations first, so the effect is more "lossy" than dilation - things disappear rather than blur.
The trick that makes erosion shine: ablate a layer on purpose. Erode a middle-block layer to near-zero and you've effectively removed a chunk of the model's reasoning - a great way to learn what that layer was contributing. If the image barely changes, the layer was redundant; if the composition falls apart, you found a pillar. That's the tinkering loop the whole pack is built for.
Install: ComfyUI Manager → search "ComfyUI-Model-Bending" → install → restart. Manual:
cd ComfyUI/custom_nodes
git clone https://github.com/abuzreq/ComfyUI-Model-Bending
kornia must be present or this node errors on first use; Manager installs it, or pip install -r requirements.txt after a manual clone.
Realistic expectation: erosion and dilation cancel each other nicely, and the pack's basic_unet_bending.json workflow has them all pre-wired so you can A/B them without building anything. Pair the two at different layers for the push-pull effect, and remember the default of 3 is gentle - the extreme values (7+) are where the image starts falling apart, which is either a feature or a bug depending on your goal.
Inputs (1)
| Name | Type | Default | Description |
|---|---|---|---|
| kernel_size | INT | 31–10 | — |
Outputs (1)
| Name | Type | Description |
|---|---|---|
| BENDING_MODULE | BENDING_MODULE | — |