FL Black Frame Reject
Strip fade-to-black frames out of a video batch
- images
- filtered_images
- kept_count
- rejected_count
You've got a batch of frames - from a video load, or from a generation run that produced some dead output - and you want the near-black ones gone before export. FL_BlackFrameReject measures how black each frame is and drops anything over your threshold, handing back the survivors plus kept/rejected counts so you can sanity-check how much got cut without eyeballing the whole batch.
How it works
For each frame, it computes a black-pixel percentage using one of four methods, set via channels: luminance (the default - perceptual brightness, Rec. 601-weighted) judges darkness the way the eye would; average is a flat mean across channels; rgb requires all channels individually below the threshold; all is the strictest combined check. Two thresholds work together: black_level (0–0.5, default 0.05) is the per-pixel darkness cutoff, and threshold (0–100%, default 95) is the frame-level cutoff - a frame gets rejected once that percentage of its pixels qualify as black under black_level.
The inputs and outputs that matter
Required: images, threshold, black_level - these two are the ones you'll actually tune.
Optional: channels (pick the measurement method above), invert (flips the logic to keep only the black frames instead of rejecting them - useful if you're isolating fade transitions rather than removing them), show_progress (console progress bar, default on).
Outputs: filtered_images (the surviving batch - wire this downstream), plus kept_count and rejected_count as plain INTs, handy for a quick check via a text-display node without counting frames by hand.
How to install it
ComfyUI Manager: search ComfyUI_Fill-Nodes, install, restart. Or:
cd ComfyUI/custom_nodes
git clone https://github.com/filliptm/ComfyUI_Fill-Nodes
then restart. Pure torch/PIL math - no extra dependencies, no downloads.
Common issues & troubleshooting
Everything gets rejected, or nothing does. The default threshold of 95% is fairly aggressive - it only rejects frames that are almost entirely black. If you're trying to catch frames with a large-but-not-total dark region, lower threshold substantially (try 40–60%) rather than assume the node is broken.
A genuinely dark but non-black scene gets wrongly rejected. Lower black_level - it's the per-pixel darkness definition, and a dim, moody shot can trip a loosely-set black_level even when the frame isn't actually black. luminance mode is generally the most forgiving of the four; try it before all, which is the strictest.
Batch size shrinks and something downstream breaks. This node's whole job is changing the batch size by design - a fixed-length WebM export or a node expecting the frame count to match a paired audio track needs to account for the new count. That's exactly what kept_count/rejected_count are for: check them before assuming your downstream export length is still correct.
Inputs (6)
| Name | Type | Default | Description |
|---|---|---|---|
| images | IMAGE | — | |
| threshold | FLOAT | 95.00–100 | — |
| black_level | FLOAT | 0.050–0.5 | — |
| channelsopt | COMBO | luminance | 4 options: all, average, luminance, rgb |
| invertopt | BOOLEAN | false | — |
| show_progressopt | BOOLEAN | true | — |
Outputs (3)
| Name | Type | Description |
|---|---|---|
| filtered_images | IMAGE | — |
| kept_count | INT | — |
| rejected_count | INT | — |