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

Line Boil (Video)

Batch-Boil an Entire Video File Without Touching a Frame Tensor

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

    Sibling to the Line Boil (Image) node, and it solves a different problem. The Image version works inside the graph - frames in, frames out, ready for more nodes. This one is the batch job: give it a path to a video file on disk, and it chews through every frame, writes a new .mp4 next to the original, and hands you back the output path. No tensors, no VRAM pressure from holding a whole clip in memory.

    The use case is the same one that gets people asking on r/comfyui: your WAN (or whatever) output is too clean and stable, you want that hand-drawn line boil, and you don't want to babysit a thousand frames. This is the fire-and-forget version.

    How it works

    It's OpenCV end to end. cv2.VideoCapture opens the file, reads frames in chunks, and runs the exact same per-frame pipeline as the Image node - near-black line detection, mask warp, shift, jitter - then cv2.VideoWriter writes them out with the mp4v codec at the source's resolution and framerate. A progress bar tracks the whole clip, and if the parallel pool chokes for any reason it falls back to sequential rather than dying. The output filename is {original_name}{suffix}.mp4, written into the same directory as the source.

    Same effect parameters as its sibling - black_threshold, warp_strength, warp_scale, shift, alpha_jitter, hold, seed, workers, use_gpu - so if you've tuned the Image version, copy your numbers over and it behaves identically. hold still does the "on twos / on threes" pattern reuse, which on a long clip is also your main speed lever.

    Inputs and outputs that matter

    • video_path - a plain STRING with the absolute path to your video. The whole node hangs on this.
    • suffix - defaults to _boiled, so clip.mp4 becomes clip_boiled.mp4.
    • Everything else is the shared effect kit: black_threshold (45), warp_strength (0.8), and hold (2) are the three you'll actually turn.

    The single output is output_path, a STRING pointing at the finished file. There's nothing to wire into the image pipeline - it's a file-out node by design.

    Where it fits

    Reach for this one when you're processing long footage, or when the video lives on disk and you just want the result on disk. It streams frame-by-frame, so memory stays flat no matter how long the clip is - the Image node loads the whole batch into RAM. If you want to keep working on the frames afterwards, or you're already holding them as a tensor, use the Image version instead.

    The traps

    • It will not accept a video tensor. VHS output, video latent batches, all that - this node takes a string path, full stop. Beginners wire a video output into it and wonder why nothing happens. It's a STRING input.
    • Silent-ish failure. If the path doesn't exist or the file won't open, it logs an error and returns your input video_path unchanged. Check the console, and check the returned path isn't the original.
    • No audio. cv2.VideoWriter doesn't copy the audio track, so _boiled.mp4 comes out silent. Mux it back:
      ffmpeg -i original.mp4 -i original_boiled.mp4 -map 0:a -map 1:v -c copy out.mp4
    • Big files. mp4v is a soft, space-hungry codec; re-encode with H.264 (-c:v libx264 -crf 18) if size matters.
    • use_gpu is a no-op for most people. Stock OpenCV builds have no CUDA; the node detects that and falls back to CPU. Don't expect a speedup unless you installed a CUDA-enabled OpenCV.

    Installation

    Same pack as the Image node - install once:

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

    Then restart ComfyUI (or use Manager and search "ComfyUI Line Boil"). Just numpy and opencv-python, auto-installed; no models, no keys. The whole pack is MIT-licensed and self-contained.

    Categoryimage/effects

    Inputs (13)

    NameTypeDefaultDescription
    video_pathSTRING
    suffixSTRING_boiled
    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
    output_pathSTRING