Nodes/ComfyUI Line Boil/Line Boil (Image)
ComfyUI Node

Line Boil (Image)

Make Your AI Video Boil Like Real Hand-Drawn Animation

By scofano·Created 6 months ago·Updated 5 months ago· 0
Line Boil (Image)
  • images
  • IMAGE
enabledtrue
black_threshold45
expand1
warp_strength0.8
warp_scale28.0
shift1
alpha_jitter0.06
hold2
seed1234
workers4
use_gpufalse

You know that thing where generated video is too clean? WAN 2.2 and friends will hand you perfectly stable frames, and if you're chasing a cel-animation look that stability is exactly the problem. Hand-drawn animation gets its life from the "boil" - the tiny, constant wobble in the line work that makes it feel alive. This node does that. It takes an image or a batch of frames and re-draws just the near-black line art with a slightly different wobble every frame, leaving your fills and background untouched.

It's from the scofano/comfy-line-boil pack, and it's one of the few nodes that solves a real 2D-animation pain instead of another upscaler. People post on r/comfyui asking how to get "that classic 2d hand drawn animation boil effect" because everything their video model spits out looks like a still image. This is the answer, minus the agony of img2img-ing every frame by hand.

How it works

Under the hood it's an OpenCV pipeline, one pass per frame:

  1. Detect the line art. Any pixel where max(R,G,B) <= black_threshold (and alpha > 0) counts as a line. Default 45 means "close to black"; crank it to catch lighter pencil or antialiased edges.
  2. Expand and soften. expand dilates the mask a few pixels so antialiased line edges get caught, then it's blurred so the mask has soft edges instead of hard ones.
  3. Warp it. A low-res field of random noise is upscaled and used to remap the mask - warp_strength is how far things displace, warp_scale is how chunky the wobble is (lower = bigger, slower boils).
  4. Jitter, shift, composite. shift adds a random 0–N pixel slide, alpha_jitter pulses the mask's strength, then the frame is re-composited so the wobbly mask re-stamps the line zone. Result: line edges shimmer and slide slightly, fills stay put.

Everything is seeded, so the same seed + frame index gives the same pattern - fully reproducible. The hold parameter is the clever bit: the pattern only changes every N frames, so hold=2 gives you "on twos," hold=3 gives you "on threes," like real animation. Higher hold also means fewer remaps to compute, so it's the cheapest way to calm the effect down.

Inputs and outputs that matter

The node eats an images batch and spits out an IMAGE of the same size and length, so it slots anywhere in a pixel pipeline. The three you'll actually touch:

  • black_threshold (default 45) - the dial that decides what counts as a line. Too low and nothing happens; too high and fills start boiling.
  • warp_strength (0.8) - keep under 2.0 for subtle, above that for properly drunk animation.
  • hold (2) - temporal stability. 1 is maximum boil, 10+ is barely-there-but-cheap.

Also on the panel: enabled, expand, warp_scale, shift, alpha_jitter, seed, workers, and use_gpu. The last two are performance knobs, and use_gpu is mostly theater - see below.

Where it goes in a workflow: decode your generated video to frames, run this on the batch, then SaveImage or feed it to VHS VideoCombine. It only touches near-black pixels, so it's also safe on line art with flat color fills. Just don't expect anything from a photoreal render with no black outlines - nothing gets detected, nothing boils.

Installation

Install once for the whole pack:

cd ComfyUI/custom_nodes && git clone https://github.com/scofano/comfy-line-boil

Then restart ComfyUI. ComfyUI Manager works too - search "ComfyUI Line Boil". Dependencies are just numpy and opencv-python (torch is already there), pulled in automatically from the pack's pyproject.toml. No models to download, no API keys, nothing.

Troubleshooting

  • No effect at all. Check enabled, then check your image actually has near-black line art, then try raising black_threshold to 60–80.
  • use_gpu=True does nothing. The default OpenCV wheels ship without CUDA. The node checks cv2.cuda.getCudaEnabledDeviceCount(), finds nothing, and silently runs on CPU. Unless you built opencv-contrib-python with CUDA, leave it off.
  • Slow on big batches. The pack parallelizes frames with a process pool on Linux/macOS and threads on Windows, and falls back to sequential if the pool breaks - which is fine, but workers above your core count won't help.
  • Effect looks harsh. Lower warp_strength, bump hold, drop alpha_jitter.
Categoryimage/effects

Inputs (12)

NameTypeDefaultDescription
imagesIMAGE
enabledBOOLEANtrue
black_thresholdINT450–255
expandINT10–10
warp_strengthFLOAT0.80–10
warp_scaleFLOAT28.01–100
shiftINT10–10
alpha_jitterFLOAT0.060–1
holdINT21–100
seedINT12340–18446744073709550000
workersINT41–64
use_gpuBOOLEANfalse

Outputs (1)

NameTypeDescription
IMAGEIMAGE