Frame Blender
Pull a clean still (or a watermark mask) out of your video
- video
- image
- mask
- info
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, orgaussian), 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 inframe_indices, e.g.1,10,20,30),range(frame_range_start/end),interval(every Nth frame viaframe_interval), orall. - 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 theinfo-style console output for the video's real frame count. - Watermark mask looks noisy -
maxcatches the watermark and every bright moving object. Pick frames where the subject is elsewhere, and bumpmask_thresholdto 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
intervalso 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.
Inputs (12)
| Name | Type | Default | Description |
|---|---|---|---|
| video | VIDEO | 视频文件路径 | |
| frame_selection_mode | COMBO | interval | 帧选择模式:manual=手动指定, range=范围, interval=间隔采样, all=全部帧 |
| blend_mode | COMBO | average | 混合模式:average=平均, max=最大值(检测水印), min=最小值, median=中位数(背景提取), weighted=加权平均 |
| opacity | FLOAT | 0.500–1 | 每帧的透明度/混合强度(仅average模式使用) |
| normalize | BOOLEAN | true | 是否归一化到0-255范围 |
| output_mask | BOOLEAN | false | 是否输出二值化mask(用于ProPainter) |
| frame_indicesopt | STRING | 1,10,20,30 | 手动指定帧号(逗号分隔),如:1,10,20,30(manual模式使用) |
| frame_range_startopt | INT | 1 | 起始帧号(range模式使用) |
| frame_range_endopt | INT | 100 | 结束帧号(range模式使用) |
| frame_intervalopt | INT | 10 | 帧间隔(interval模式:每N帧取1帧) |
| mask_thresholdopt | INT | 1280–255 | mask二值化阈值(output_mask=True时使用) |
| weight_modeopt | COMBO | linear | 加权模式(weighted混合模式使用):linear=线性, exponential=指数, gaussian=高斯 |
Outputs (3)
| Name | Type | Description |
|---|---|---|
| image | IMAGE | — |
| mask | MASK | — |
| info | STRING | — |