Nodes/ComfyUI_DiffuEraser/Propainter_Sampler
ComfyUI Node

Propainter_Sampler

The fast pass that fills the mask first, so the diffusion pass has something to refine

By smthemex·Created 2 years ago·Updated 5 months ago· 279
Propainter_Sampler
  • model
  • conditioning
  • conditioning
  • images
fps
video_length10
mask_dilation_iter2
ref_stride10
neighbor_length10
subvideo_length50

The pack's full pipeline is diffusion-heavy and memory-hungry, but it doesn't start there. Propainter_Sampler is the workhorse that runs first: it takes the masked video, propagates the visible pixels along optical flow to fill the hole, and produces a clean, temporally consistent result - the "priori" - that the diffusion sampler then refines. The pack's README is blunt that for a lot of jobs (especially watermarks) this node's output alone is plenty: at a max edge of 960px, ProPainter's fill is often indistinguishable from the full diffusion pass at a fraction of the time and VRAM. Then just upscale after.

Inputs:

  • model - the bundle from Propainter_Loader (all three .pth weights loaded).
  • conditioning - the bundle from DiffuEraser_PreData (frames + masks + dims).
  • fps - a float, forced as an input rather than defaulted; it's used to build the output video timing.
  • mask_dilation_iter (default 2) - how many times the mask is dilated (expanded) before inpainting, so the fill covers a slightly larger area than the exact mask and avoids thin leftover edges. The README's watermark tip: keep it low, like 2. Bigger dilations eat more of the surrounding image.
  • ref_stride (default 10), neighbor_length (default 10), subvideo_length (default 50) - the ProPainter internals for how it samples reference frames and chunks the video for memory. Defaults are sane for most clips; you'll touch these mostly when a clip is long (raise subvideo_length or see it chunk) or when motion is heavy.

Outputs: conditioning (the original bundle with the ProPainter fill stashed inside as prioris) and images (the raw ProPainter frames, so you can preview or use them directly without the diffusion step).

The mechanism, in one line: RAFT estimates bidirectional optical flow, the recurrent completion network fills in flow inside the mask, and the ProPainter transformer generator paints the frames guided by sampled reference frames - all classic video-inpainting propagation, exactly the approach the ProPainter paper (Zhou et al., ICCV 2023) made standard. If you want to skip diffusion, wire the images output straight to a video saver and stop there.

Practical notes: this node loads the model onto the GPU for the run and then kicks it back to CPU and empties the cache when done - so the pack can swap between the ProPainter and diffusion models without blowing your VRAM budget. That back-and-forth makes the first run of each node slow while weights load, which is normal, not a hang. And since it writes the fill into the shared conditioning bundle, the order matters: Propainter_Sampler must run before DiffuEraser_Sampler in the graph. There's no latent path, no sampler-scheduler pairing, nothing to tune from the diffusion world - if you know ProPainter's parameters from the original repo, they map one-to-one here.

CategoryDiffuEraser

Inputs (8)

NameTypeDefaultDescription
modelPropainter_Loader
conditioningCONDITIONING
fpsFLOAT
video_lengthINT101–1024
mask_dilation_iterINT21–1024
ref_strideINT101–1024
neighbor_lengthINT101–1024
subvideo_lengthINT501–1024

Outputs (2)

NameTypeDescription
conditioningCONDITIONING
imagesIMAGE