Nodes/ComfyUI_AIIA/AIIA Body Sway
ComfyUI Node

AIIA Body Sway

The tiny node that stops talking heads looking like statues

By havvk·Created about a year ago·Updated 6 months ago· 13
AIIA Body Sway
  • images
  • images
  • output_frames_dir
crop_ratio0.990
rotation_amplitude0.1
smoothness0.020
seed0
frames_directory

Watch a talking-head model long enough and the thing that finally gives it away isn't the mouth - it's the body. The head moves, the lips sync, and the torso sits there rigid as a mannequin, because the model was busy driving the face and forgot humans sway. This node fixes that specific deadness: it adds a subtle, organic body sway - the breathing, weight-shifting motion of a real person standing or sitting - to the output of Ditto-style talking-head models. It's a one-node personality transplant, and it's the difference between "AI video" and "a person talking on camera."

How it works

Mechanically it's elegant: instead of warping or moving the subject, it crops and slightly rotates each frame. The crop shrinks the frame a hair (that's crop_ratio), and the rotation gently wanders within that slack space, following a trajectory generated from Perlin noise. Perlin matters - it's the "smooth organic" version of random, so the motion looks like drifting and breathing rather than a metronome. Two details from the README's changelog are worth knowing: the vertical translation was removed (it made the head look seasick when stacked on top of Ditto's own head motion), and it's pure crop with no resampling, so image quality is untouched.

The inputs

  • crop_ratio - 0.99 default (keep 99%, crop 1%). Lower = more room to sway = more visible motion. 0.99 is subtle, 0.98 is noticeable, three-decimal precision like 0.995 if you want to be delicate.
  • rotation_amplitude - max rotation in degrees, 0.1 default. The source clamps it automatically so the rotation never opens black corners - which is the thing that would otherwise wreck this trick.
  • smoothness - Perlin noise smoothness, 0.02 default. Smaller = slower, more languid drift.
  • seed - the trajectory seed, so you can reproduce or vary the sway.

Then either images (an IMAGE tensor from a talking-head node's memory mode) or frames_directory (a folder path from Ditto's disk mode - the OOM-safe path for long videos).

Outputs

images (swayed frames, or a placeholder in disk mode) and output_frames_dir (the processed frames' path in disk mode).

Where it fits

It's a post-processor, so it slots in after the talking-head sampler:

  • Memory mode: Ditto Sampler → BodySway (images) → Video Combine.
  • Disk/OOM-safe mode: Ditto Sampler (Disk) → BodySway (frames_directory) → Video Combine (frames_directory). The README explicitly bills this chain as fully OOM-safe for long videos, with the sway pass keeping pace with memory mode.

Gotchas

  • It amplifies what's already there. If your talking head already drifts badly, sway on top reads as shakiness. Fix the source first; this node is polish.
  • Don't crank it. 0.1° of rotation with 0.99 crop looks alive. Maxing rotation_amplitude while keeping crop tiny just produces a jittery portrait.
  • Disk mode output is a directory path, not frames - connect output_frames_dir, not images, when you went the OOM-safe route.
CategoryAIIA/视频

Inputs (6)

NameTypeDefaultDescription
crop_ratioFLOAT0.9900.9–1Output size as ratio of input (0.99 = keep 99%, crop 1%)
rotation_amplitudeFLOAT0.10–2Max rotation in degrees
smoothnessFLOAT0.0200.005–0.1Perlin noise smoothness (smaller = slower drift)
seedINT00–18446744073709550000
imagesoptIMAGE
frames_directoryoptSTRINGPath to directory containing frames (from Ditto disk mode)

Outputs (2)

NameTypeDescription
imagesIMAGE
output_frames_dirSTRING