Nodes/ComfyUI-SAM2Matting/SAM2Matting Streaming Options
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.

By ethanfel·Created 17 days ago·Updated 9 days ago· 5
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)

    NameTypeDefaultDescription
    cache_modeCOMBOlossless_zstdTemporary 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_threadsINT41–32Maximum 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_depthINT81–64Maximum 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_encoderCOMBOautoH.264 encoder for the final composited video. auto tries NVIDIA NVENC first and falls back to CPU libx264 if NVENC cannot start.
    output_fpsFLOAT0.000–240Final frame rate. 0 keeps the source rate. A positive value drops or duplicates frames while preserving the clip duration.
    crfINT180–51Final 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_audioBOOLEANtrueKeep the active source audio by streaming it into the result as AAC. Disable for a silent output.
    verbose_logBOOLEANtrueLog stage progress, throughput, actual compute device, temporary cache sizes, and CUDA memory.
    edge_stabilizationoptFLOAT0.350–1Suppress 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)

    NameTypeDescription
    streaming_optionsSAM2MATTING_STREAMING_OPTIONSAdvanced bounded-pipeline and output controls for the streaming node.