Nodes/ComfyUI_CineStyle/CS ProPainterX Inpaint
ComfyUI Node

CS ProPainterX Inpaint

Delete the thing from your clip without dreaming up new pixels

By chflame163·Created 2 months ago·Updated 4 days ago· 84
CS ProPainterX Inpaint
  • image
  • mask
  • IMAGE
◄deviceauto►
◄subvideo_length80►
◄neighbor_length10►
◄ref_stride10►
◄mask_dilation4►
◄force_unload_modelfalse►
◄batch_overlap4►

Video object removal is the job everyone asks for and nobody agrees on. Search the subreddits for it and you get a graveyard of low-scoring question threads, half of them about DiffuEraser workflows that broke when the node's inputs changed. Two genuinely different jobs hide under the same name, and picking the wrong one wastes your afternoon.

Clone a whole person out of a tracking shot? You want a generative remover - VACE, DiffuEraser, VOID, or Bernini-R, which does it maskless from an instruction and is the current community darling for that. Clone a watermark, a boom mic in the corner, a stray cable, a tracking-marker sticker, someone's arm at the edge of frame? You want what CS ProPainterX Inpaint does: flow-based completion. No prompt, no diffusion, no invented content. It looks at the pixels around the mask in the frames before and after and propagates them forward, which is why it's temporally stable and cheap, and also why it can't invent a brick wall you never showed it.

How it actually works

The engine is upstream ProPainter with one substitution: MemFOF replaces RAFT for the optical-flow stage, and that swap is the whole "X". RAFT is what makes original ProPainter crawl at full HD; MemFOF's flow model is what the author's fork uses to make 1080p removal actually fit on a 24 GB card.

Inference runs at your source resolution - only nudged down to a multiple of 8, which the encoder/decoder chain requires. Four internal stages: optical flow, flow completion, image propagation, and a transformer that refines the result. Frames go through in passes sized to your free VRAM, and when a clip is long enough to need several passes, consecutive passes share frames that get linearly cross-faded so the seam doesn't show.

You get one output: IMAGE, same frame count and same size as what went in. Nothing to re-encode, and no mask comes back out.

The inputs you'll actually touch

  • mask - the region to erase, not the subject to keep. This is the number one mistake: if you built a person mask with SAM, invert it before it arrives. A single mask broadcasts to every frame; a per-frame batch has to match the frame count exactly or the node throws.
  • mask_dilation (default 4) - grows the removal region with the same 3×3 cross-kernel dilation upstream ProPainter uses. Use it when a subject's outline survives as a ghost fringe. Need much more? Reach for this pack's own CS Mask Grow first, which does a true Euclidean distance grow instead of the diamond-shaped result the stock node gives you.
  • subvideo_length (default 80) - the VRAM knob. Peak memory tracks neighbor_length + subvideo_length / ref_stride, and total clip length doesn't enter into it. Hit an OOM? Lower this. The node already shrinks it for you when memory is tight, but the tooltip is blunt that this is the parameter that matters.
  • batch_overlap (default 4) - only does anything once your clip is split across multiple passes.
  • neighbor_length / ref_stride (both 10) - reference-frame plumbing. Leave them alone unless you're chasing a specific quality problem.
  • force_unload_model - flip it on if this node shares a card with a video model you want back afterwards.

Installing it (and the ~460 MB it wants)

Via ComfyUI Manager, search ComfyUI_CineStyle; or:

cd ComfyUI/custom_nodes
git clone https://github.com/chflame163/ComfyUI_CineStyle.git
# restart ComfyUI

The nodes live under 😺dzNodes/CineStyle (right-click → Add Node), or just double-click the canvas and type cinestyle. Note that this is not a two-node pack - the same install drags in requirements.txt for the whole CineStyle suite: diffusers, transformers, peft, accelerate, hydra-core, iopath, timm, av, soundfile and friends. If you keep a lean environment, install this and test it before you change anything else. Dependency collisions between packs are the single most reported pain in this ecosystem, and this is a big pack.

On first execution the node downloads its own weights into ComfyUI/models/ProPainter/:

ProPainter.pth                    (~150 MB, from sczhou/ProPainter v0.1.0 release)
recurrent_flow_completion.pth     (~19 MB,  same release)
memfof/config.json
memfof/model.safetensors          (~289 MB, egorchistov/optical-flow-MEMFOF-Tartan-T-TSKH)

It's a directory of its own on purpose - the older ComfyUI_ProPainter_Nodes pack keeps its weights inside its own folder, so the two can coexist. Every file is MD5-checked after download, which means a truncated download turns into a fresh retry rather than a confusing crash later. Point it somewhere else with PROPAINTER_X_MODEL_DIR, and set HF_ENDPOINT if Hugging Face is blocked or slow where you are.

Where people get burned

Feathering the mask. The mask is thresholded at 0.5 on the way in; soft edges buy you nothing but a slightly wrong boundary.

Testing on the whole clip. Do the first run on 100–200 frames, not all 600 - that's the advice ProPainter regulars give for a reason, and you learn nothing new from frame 400.

Assuming it can replace a generative remover. Big, textured, fast-moving occlusions come back as smears, because there is no content behind them to propagate. The honest split: wires, logos, watermarks, small props, occasional passers-by - this node. A character you need gone gone - a generative model with a mask in front of it, in which case the fill you describe matters more than which pack you installed.

License diligence if you ship it commercially. The pack is MIT, but ProPainter is Apache-2.0 and MemFOF is BSD-3-Clause - fine for most uses, worth reading before you redistribute.

Category😺dzNodes/CineStyle

Inputs (9)

NameTypeDefaultDescription
imageIMAGEVideo frames as a ComfyUI IMAGE batch.
maskMASKMatched per-frame masks marking what to remove; one shared mask broadcasts to every frame.
deviceCOMBOauto2 options: auto, cpu
subvideo_lengthINT808–300Frames the transformer stage reasons over at once. This is what sets peak VRAM, and the node lowers it automatically when memory is tight.
neighbor_lengthINT102–100—
ref_strideINT101–100—
mask_dilationINT40–64ProPainterX's own dilation of the removal region.
force_unload_modelBOOLEANfalseRelease the models when this run ends so other nodes can take the VRAM back.
batch_overlapINT40–64Frames two consecutive passes share; they are cross-faded to hide the seam.

Outputs (1)

NameTypeDescription
IMAGEIMAGE—