Nodes/Advanced Latent Control/Shift transform (one time)
ComfyUI Node

Shift transform (one time)

One precise nudge at one precise step

By kuschanow·Created 2 years ago·Updated 14 days ago· 23
Shift transform (one time)
    • TRANSFORM
    step1
    modereplace
    x_shift0.00
    y_shift0.00

    The one-time variants are the pack's "surgical strike" versions of its transforms, and OneTimeShiftTransform is the shift version. Where Shift transform applies a slide across a window of steps, this one fires a single shift at exactly one step, then never again. One input, one action, done.

    The inputs

    • step - the step number to fire on (1-based, up to 10000). The transform fires when the sampler reaches step, and only then.
    • mode - replace shifts outright; combine averages the shifted and original latent ((shifted + original) / 2).
    • x_shift / y_shift - fractions of the latent's width/height to roll, -1 to 1, wrapping at the edges.

    Output is a TRANSFORM for a TSampler, TSampler Advanced, or Transform Hijack-patched sampler.

    Why a one-time shift matters

    Because a single mid-sampling shift is a trajectory change, not a visual edit. When the sampler re-noises the shifted prediction, the next steps build on the new position - so one shift at step 5 of 20 can subtly re-center composition, and the remaining 15 steps draw the details in around the new framing. That's a very different result from shifting the finished latent, which just translates the final image and leaves a hole at one edge. The one-time version lets the model fill the gap the shift created.

    It's also the most predictable transform in the pack. There's no window math to reason about, no offset pattern - just "hit it at step N." For learning what step-local editing does, and for reproducible experiments, the one-time nodes are where you start.

    Tips

    • Small shifts (0.03–0.1) early in the run are the sweet spot. Big shifts later just smear detail.
    • combine mode halves the displacement's visible strength, so pair a bigger shift with combine if you want the nudge without the hard cut.
    • The step is 1-based and compares against the sampler's step counter, so with a 20-step run, step: 1 fires on the first step. Keep it within your step count.

    Install

    Same pack, same install:

    cd ComfyUI/custom_nodes
    git clone https://github.com/RomanKuschanow/ComfyUI-Advanced-Latent-Control
    

    Restart, or search "Advanced Latent Control" in ComfyUI Manager. No models, no extra dependencies.

    The honest take

    The one-time shift is the least flashy of the one-time nodes - a single shift just isn't as dramatic as a one-time mirror or a one-time multiply. But it's the best teacher of the whole family, because its effect is small enough to observe cleanly. Run the same seed with and without it, and you'll see exactly what one mid-sampling nudge changes. That lesson carries over to every other transform in the pack.

    Categorysampling/transforms

    Inputs (4)

    NameTypeDefaultDescription
    stepINT11–10000
    modeCOMBOreplace2 options: replace, combine
    x_shiftFLOAT0.00-1–1
    y_shiftFLOAT0.00-1–1

    Outputs (1)

    NameTypeDescription
    TRANSFORMTRANSFORM