ComfyUI Node
SAM2Matting Streaming Options
Optional advanced controls for the streaming background node. Lossless Zstandard is the quality-safe default; JPEG saves disk space and raw RGB trades disk space for cache speed. Auto encoding prefers NVENC and falls back to libx264.
SAM2Matting Streaming Options
- streaming_options
◄cache_modelossless_zstd►
◄worker_threads4►
◄pipeline_depth8►
◄video_encoderauto►
◄output_fps0.00►
◄crf18►
◄preserve_audiotrue►
◄verbose_logtrue►
◄edge_stabilization0.35►
CategorySAM2Matting/video
Inputs (9)
| Name | Type | Default | Description |
|---|---|---|---|
| cache_mode | COMBO | lossless_zstd | Temporary model-resolution frame format. lossless_zstd preserves the exact resized RGB (recommended); jpeg_low_disk uses less disk but is slightly lossy; raw_fast avoids compression but uses the most temporary disk space. |
| worker_threads | INT | 41–32 | Maximum CPU workers used for frame preparation, alpha PNG writing, and background compositing. More workers can help until the CPU or disk is saturated. This does not parallelize temporal SAM inference. |
| pipeline_depth | INT | 81–64 | Maximum frames allowed in flight in each bounded CPU pipeline. 8 is recommended. Higher values may hide CPU/disk latency but use more RAM; try 2–4 under RAM pressure. This is a queue limit, not a SAM batch size. |
| video_encoder | COMBO | auto | H.264 encoder for the final composited video. auto tries NVIDIA NVENC first and falls back to CPU libx264 if NVENC cannot start. |
| output_fps | FLOAT | 0.000–240 | Final frame rate. 0 keeps the source rate. A positive value drops or duplicates frames while preserving the clip duration. |
| crf | INT | 180–51 | Final H.264 quality target. Lower values preserve more detail and create larger files. With NVENC this is mapped to its comparable constant-quality control. |
| preserve_audio | BOOLEAN | true | Keep the active source audio by streaming it into the result as AAC. Disable for a silent output. |
| verbose_log | BOOLEAN | true | Log stage progress, throughput, actual compute device, temporary cache sizes, and CUDA memory. |
| edge_stabilizationopt | FLOAT | 0.350–1 | Suppress one-frame matte-edge flicker by blending each alpha toward the three-frame temporal median. 0 keeps the raw matte; 0.35 is a gentle default; high values can flatten very fast, thin, or translucent details. Uses only neighboring disk-backed mattes. |
Outputs (1)
| Name | Type | Description |
|---|---|---|
| streaming_options | SAM2MATTING_STREAMING_OPTIONS | Advanced bounded-pipeline and output controls for the streaming node. |