Nodes/ComfyUI Model Bending/Latent Operation (Multiply Scalar)
ComfyUI Node

Latent Operation (Multiply Scalar)

Latent Operation (Multiply Scalar)

By abuzreq·Created about a year ago·Updated 3 months ago· 21
Latent Operation (Multiply Scalar)
    • LATENT_OPERATION
    scalar1.00

    Where add-scalar shifts, multiply-scalar scales - this node returns a LATENT_OPERATION that multiplies every element of a latent tensor by a constant. It's the volume knob: values above 1 amplify the tensor, values below 1 attenuate it, and negative values flip it upside down. In latent space, "amplify" roughly means "make the model's interpretation of this tensor more assertive," and it's the workhorse operation of the pack's denoising_step_bending.json workflow, which multiplies the guidance by 10 at a single step just to make the effect visible.

    Like all the operation builders, it does nothing until you wire the result into a consumer: ConditioningApplyOperation (bend the prompt's embedding), LatentApplyOperationCFGToStep (bend one denoising step), or Latent Operation To Module (wrap it as a bending module for layer injection). The choice of consumer is the whole strategy - the same multiply can be a whisper or a wrecking ball depending on where it lands.

    One input: scalar, default 1 (identity - nothing changes until you move it), range −100 to 100, step 0.01. The range being negative-capable is meaningful: multiply by −1 and the latent's values invert, which the model reads as an extreme semantic reversal - a genuinely bizarre and interesting effect, closer to "opposite day" than "dimmer." Keep in mind you're scaling a latent, whose values are the model's compressed representation, not pixel brightness - so a factor of 2 isn't "twice as bright," it's "twice as confident," whatever that means to the model at that point in the pipeline.

    The family trap: Multiply Scalar Module (Bending) is the sibling that scales model activations at a chosen layer and outputs a BENDING_MODULE. Same math, different game - one operates on the latent/conditioning side, the other on a layer's internal signal. If you're hunting for the "bend the whole generation's volume" effect, the module version is the one to grab; this node is for targeted, position-aware scaling.

    Install: ComfyUI Manager → search "ComfyUI-Model-Bending" → install → restart. Manual:

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

    Dependencies: kornia and scikit-learn.

    The practical advice: at a single mid-denoise step, expect to need big values (the example workflow uses 10) before you notice anything, and on conditioning expect tiny values - the README's own catalog of multiply results runs the whole ablation from 0 to 2 and shows how much of a layer's personality that range covers. Start at 0 (ablation) on a step you care about, then sweep up.

    Categorymodel_bending

    Inputs (1)

    NameTypeDefaultDescription
    scalarFLOAT1.00-100–100

    Outputs (1)

    NameTypeDescription
    LATENT_OPERATIONLATENT_OPERATION