Sharpen Module (Bending)
Crank the model's own texture, not the JPEG
- BENDING_MODULE
Sharpening a finished image is a lie you can see: halos along every edge, crunch in the hair, that over-processed look anyone who's been around AI images recognises instantly. Sharpen your model's features mid-sample and the sampler does something much more interesting with it - it resolves texture the model was already implying, and keeps going.
Sharpen Module (Bending) is the unsharp mask for this pack. Output is a BENDING_MODULE; it needs an applier.
What it does
It's the textbook unsharp mask, run on latent activations:
out = x + amount * (x − blur(x))
With sigma controlling how wide that blur is, which sets the scale of detail being amplified. Small sigma (0.5–1) hits fine texture; sigma 3–6 amplifies larger structure, contours and edges.
The formula has a feature most sharpen tools hide: amount accepts negatives. Negative values subtract the high-frequency component instead of adding it, which turns this into an extra blur - same node, opposite direction. amount: -1, sigma: 1 is a gentler version of what the Gaussian Blur Module does, just with a different weight profile. Nice party trick, though if you actually want blur, reach for the blur node.
Where you apply it decides what you get. Late blocks and the VAE produce the expected crispening, up to and including the ugly kind. Mid blocks are where the interesting results live: the model gets a strong signal about local contrast, and at moderate settings you get texture and micro-detail that looks drawn rather than filtered. Push a mid-block sharpen too hard and you get the full AI tell set - pore-level noise on skin, glitter in the eyes, a face with a slightly vibrating quality.
Inputs and output
- amount - default 1.0, range −10 to 10, step 0.05. The tooltip spells out the formula, which is a rare kindness. 0 is off; 0.3–1 is a nudge; above 2 things get loud.
- sigma - default 1.0, range 0.05 to 20, step 0.05. In latent cells/tokens, same unit as the rest of the pack's spatial ops.
Output: BENDING_MODULE.
Wiring it
- Model Bending with a layer path from Bendable Layer Catalogue. On SDXL-era models, a sharpening pass on an early-to-mid
output_blocks.*layer is the "more texture please" move. - DiT Block Bending with
blocks: double:8-16, spatial: true- on Flux-family models this is the accessible route, and it's worth stepping in small increments because a block-level sharpen compounds across every block you include. - Attention Map Bending - sharpening the attention map concentrates each prompt token's attention into a tighter region, so a subject stops sprawling over the frame. Pair it with
renormalize: keys. - Model VAE Bending - a decode-time sharpen. Honest warning: at that distance the model has no chance to adapt, so you're back to a pixel-ish filter and the halo look arrives much sooner.
- Wrap it in Timestep Gated Bending to sharpen only in the final detail window (t 0.2 → 0), which is the safest place for it.
Install
ComfyUI Manager → search "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
The pack's dependencies are kornia and scikit-learn; restart ComfyUI afterwards and watch the console for [model-bending] lines.
Where people get burned
- Sharpening an already-over-processed prompt. If your prompt is "ultra realistic, hyper detailed, 8K", you've already asked for over-processed and this node will happily supply the rest. On newer models those boosters are actively counterproductive; the same applies here.
- Raising
amountandsigmatogether. They multiply each other's visibility. Change one, look, then the other. - Using it as a fix for a soft model. Distilled and low-step models are soft because they took a shortcut. Sharpening the features makes the shortcut louder, not better.
- Forgetting the sigma unit. Sigma 20 blurs across the whole feature map on a middle block, which means the "detail" being amplified is basically the map's average - you get a brightened, flat result and no idea why.
- Stacking sharpen and unsharp-style modules on the same layer. They're the same operation. Stacking just multiplies
amount, and the pack applies same-layer bends last-to-first, so the result isn't even the order you see on the canvas.
Inputs (2)
| Name | Type | Default | Description |
|---|---|---|---|
| amount | FLOAT | 1.00-10–10 | Unsharp-mask strength: x + amount * (x - blur(x)) |
| sigma | FLOAT | 1.000.05–20 | — |
Outputs (1)
| Name | Type | Description |
|---|---|---|
| BENDING_MODULE | BENDING_MODULE | — |