Nodes/ComfyUI_Sora/Frame Blender
ComfyUI Node

Frame Blender

Pull a clean still (or a watermark mask) out of your video

By xuchenxu168·Created 11 months ago·Updated 9 months ago· 5
Frame Blender
  • video
  • image
  • mask
  • info
frame_selection_modeinterval
blend_modeaverage
opacity0.50
normalizetrue
output_maskfalse
frame_indices1,10,20,30
frame_range_start1
frame_range_end100
frame_interval10
mask_threshold128
weight_modelinear

FrameBlender is the pack's forensic-ish utility: instead of producing a video, it samples frames out of one and combines them into a single image - or a mask. Same OpenCV-and-local spirit as the watermark nodes (no API, no per-call cost), but aimed at a different job. The classic use is catching watermarks: if a static logo sits on top of moving footage, the per-pixel maximum across frames is the watermark, clean as a whistle. The median across frames does the opposite - it hands you the background with the moving subject stripped out. And the mask output exists so you can feed the result into an inpainting pipeline like ProPainter to actually remove what you found.

How it works

The node opens the video with OpenCV, picks frames according to your selection mode, then combines them with one of five blend operations:

  • average - a recursive opacity blend; opacity (0.0–1.0, only used here) controls how much each new frame contributes. Good for temporal noise reduction / mild motion blur.
  • max - per-pixel maximum. This is the watermark-detection trick: a static bright logo wins every frame.
  • min - per-pixel minimum. Less flashy but handy for shadows/dark artifacts.
  • median - per-pixel median. The background-extraction workhorse: a moving subject gets outvoted, the static scene stays.
  • weighted - weighted average with weight_mode (linear, exponential, or gaussian), so you can bias toward early or middle frames.

Frame selection is separate from blending, and it's where you'll spend most of your time:

  • frame_selection_mode - manual (comma list in frame_indices, e.g. 1,10,20,30), range (frame_range_start/end), interval (every Nth frame via frame_interval), or all.
  • normalize - clamp the result to 0–255 (keep it on).
  • output_mask - if true, produces a binary MASK (grayscale of the result thresholded at mask_threshold, default 128) instead of just the image. The tooltip's stated purpose: feeding ProPainter.

Outputs: image (a single IMAGE tensor), mask (MASK), and info (a STRING summarizing video stats, selection, and blend settings - read it when the result surprises you).

Install

Standard pack install - ComfyUI Manager → search "ComfyUI_Sora", or:

cd ComfyUI/custom_nodes
git clone https://github.com/xuchenxu168/ComfyUI_Sora
cd ComfyUI_Sora && pip install -r requirements.txt

No key, no config, no model download - opencv-python does all the work. Restart and it's ready.

Common issues

  • "没有选择任何帧" (no frames selected) - your selection didn't match the clip: frame indices past the end, a range that's entirely beyond total_frames, or an empty manual list. Check the info-style console output for the video's real frame count.
  • Watermark mask looks noisy - max catches the watermark and every bright moving object. Pick frames where the subject is elsewhere, and bump mask_threshold to kill low-level noise in the mask.
  • Subject ghosts in the background - median removes small moving subjects but a slow, large subject can survive. Feed it a wider interval so the subject isn't in the same spot in every sampled frame.
  • It's one image, not a video - worth saying twice, because the pack is video-first: FrameBlender emits a still. If you expected a denoised video, this isn't it; it's the frame-sampling tool that feeds video cleanup.

For watermark removal, background plates, or a clean still from a noisy clip, this is the pack's most underrated node - one blend mode, one mask output, and you've got the exact input ProPainter-style inpainting wants.

CategoryKen-Chen/sora

Inputs (12)

NameTypeDefaultDescription
videoVIDEO视频文件路径
frame_selection_modeCOMBOinterval帧选择模式:manual=手动指定, range=范围, interval=间隔采样, all=全部帧
blend_modeCOMBOaverage混合模式:average=平均, max=最大值(检测水印), min=最小值, median=中位数(背景提取), weighted=加权平均
opacityFLOAT0.500–1每帧的透明度/混合强度(仅average模式使用)
normalizeBOOLEANtrue是否归一化到0-255范围
output_maskBOOLEANfalse是否输出二值化mask(用于ProPainter)
frame_indicesoptSTRING1,10,20,30手动指定帧号(逗号分隔),如:1,10,20,30(manual模式使用)
frame_range_startoptINT1起始帧号(range模式使用)
frame_range_endoptINT100结束帧号(range模式使用)
frame_intervaloptINT10帧间隔(interval模式:每N帧取1帧)
mask_thresholdoptINT1280–255mask二值化阈值(output_mask=True时使用)
weight_modeoptCOMBOlinear加权模式(weighted混合模式使用):linear=线性, exponential=指数, gaussian=高斯

Outputs (3)

NameTypeDescription
imageIMAGE
maskMASK
infoSTRING