Nodes/ComfyUI Model Bending/Scale Module (Bending)
ComfyUI Node

Scale Module (Bending)

Zoom a layer's activations, not its values

By abuzreq·Created about a year ago·Updated 3 months ago· 21
Scale Module (Bending)
    • BENDING_MODULE
    scale_factor1.00

    Don't confuse this with Multiply Scalar Module (Bending) - the names are one word apart and the effects could not be more different. Multiply Scalar scales values: every activation gets bigger or smaller. Scale Module (Bending) scales space: it zooms the activation map itself, blowing up or shrinking the spatial layout of the features flowing through a layer. Same family, opposite axis.

    It's a BENDING_MODULE factory for the ComfyUI-Model-Bending pack: one factor in, a BENDING_MODULE out, consumed by any of the Model Bending / VAE Bending / LoRA Bending nodes. The math is kornia's affine scale applied to each feature map, with fp16 cast up to fp32 and back so precision holds on half-precision models.

    The one input

    • scale_factor (FLOAT, default 1, range −100 to 100) - the zoom applied to the target layer's output maps.

    The default is 1 - identity, no zoom. Below 1 the map shrinks toward the center of its receptive field; above 1 it blows up and the edges spill out of frame. Negative factors flip the spatial coordinates as well as zooming, which gets into mirror-bend territory.

    What it's good for

    Spatial scale on a feature map is a strange, rarely-used distortion, and that's precisely its appeal: it's the kind of bend most workflows never attempt, so the results feel novel. A mild zoom (< 1) on a mid-UNet layer compresses the composition toward the center of influence of that layer; a strong zoom turns that layer into an extreme close-up of its own features, which the rest of the network then has to interpret. Because the maps are not the final image, you don't get a literal "zoomed photo" - you get the network's idea of a zoom, filtered through the layers below.

    Start at 0.8 or 1.2 on the middle block to feel it out, then go extreme in one direction once you trust that the run won't NaN out. Pair it with Multiply Scalar at 0 on the same target first to learn what the layer is responsible for - a spatial zoom on a layer that mostly carries color information does very little; on a layer carrying composition, it's dramatic.

    Installing

    Ships in the pack:

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

    Restart ComfyUI and refresh the tab, or search ComfyUI-Model-Bending in ComfyUI Manager. Dependencies are kornia + scikit-learn, no downloads. Name the clone folder ComfyUI-Model-Bending, not the stale ComfyUI-Web-Bend-Demo in the README.

    Where people get tripped up

    The scale_factor range goes to ±100, but anything past roughly 3–4 on either side is usually just texture chaos - the interesting stuff lives near 1. And because this is spatial, it does nothing meaningful on a layer whose outputs have already been pooled or flattened to 2D; aim it at conv feature maps. If nothing changes, check for the 1 default pass-through first.

    Categorymodel_bending

    Inputs (1)

    NameTypeDefaultDescription
    scale_factorFLOAT1.00-100–100

    Outputs (1)

    NameTypeDescription
    BENDING_MODULEBENDING_MODULE