Nodes/MTB Nodes/Batch Shake (mtb)
ComfyUI Node Runs on cloud

Batch Shake (mtb)

Fake handheld camera shake across a frame batch

By melMass·Created 3 years ago·Updated about a month ago· 721
Batch Shake (mtb)
  • images
  • image
  • pos_x
  • pos_y
  • rot
position_amount_x1.00
position_amount_y1.00
rotation_amount10.00
frequency1.00
frequency_divider1.00
octaves1
seed0

Perfectly stable AI video reads as artificial in a specific way - real handheld footage always has a little drift, and its absence is part of what makes generated video feel like generated video. Batch Shake is MTB Nodes' answer: it applies a Perlin-noise-driven wobble (position and rotation) across a batch of frames, the same mathematical trick used in motion graphics and game engines for procedural camera shake.

How it works

The frequency and octaves parameters are straight out of Perlin/simplex noise vocabulary: frequency controls how fast the noise oscillates - low values drift slowly, high values jitter fast - and octaves layers multiple frequencies of noise on top of each other, adding finer detail on top of the base wobble the way real camera shake has both a slow sway and a fast micro-jitter at once. frequency_divider scales that frequency down, giving you a second knob to tune the overall pace without changing the shape of the noise. seed makes the whole thing reproducible - same seed, same shake pattern, every time.

The inputs and outputs that matter

  • images (required) - the batch to shake.
  • position_amount_x / position_amount_y (default 1 each) - how far the frame drifts on each axis.
  • rotation_amount (default 10) - how many degrees of rotational wobble to add.
  • frequency, frequency_divider (both min 0.005) - pace of the noise.
  • octaves (min 1) - how many noise layers stack up.
  • seed - reproducibility.

It returns more than a shaken image: alongside image, you get pos_x, pos_y, and rot as separate FLOATS lists - the exact per-frame curves it used to produce the shake. That's worth knowing about even if you only came for the image output, because it means you can reuse the identical motion elsewhere: drive a matching camera move in a 3D/parallax layer, or feed those curves into something like Batch Time Wrap so a second element in your composite shakes in perfect sync with the first.

Installing it

ComfyUI Manager: search MTB Nodes, install, restart. Manually:

cd ComfyUI/custom_nodes
git clone https://github.com/melMass/comfy_mtb

then restart ComfyUI. No model downloads - it's procedural noise, computed on the fly.

Common issues

Overdo rotation_amount or the position amounts and it stops reading as "handheld" and starts reading as "earthquake" - start subtle (small fractions of your position_amount defaults, a couple of degrees of rotation) and increase gradually while previewing, rather than guessing a big number up front. Also, shaking near the frame edges can pull image content off-canvas since the node rotates/translates rather than cropping-and-padding - leave a little headroom in your source composition if you're pushing the amounts up.

The pack-wide issue applies here too: MTB logs [comfy_mtb] Some nodes (N) could not be loaded at startup instead of crashing when one node fails to import, with a pointer to http://127.0.0.1:8188/mtb - a real behavior confirmed in other users' install logs. If Batch Shake doesn't show up after install, check that line before reinstalling the pack.

Categorymtb/batch

Inputs (8)

NameTypeDefaultDescription
imagesIMAGE
position_amount_xFLOAT1.00
position_amount_yFLOAT1.00
rotation_amountFLOAT10.00
frequencyFLOAT1.00
frequency_dividerFLOAT1.00
octavesINT1
seedINT0

Outputs (4)

NameTypeDescription
imageIMAGE
pos_xFLOATS
pos_yFLOATS
rotFLOATS