Nodes/ComfyUI-Koolook/Koolook Matte — Loader
ComfyUI Node

Koolook Matte — Loader

Load the VideoMaMa matting pipeline (and its big model downloads)

By malkuthro·Created 11 months ago·Updated 2 days ago· 8
Koolook Matte — Loader
    • KOOLOOK_MATTE_PIPELINE
    base_model_pathcheckpoints/stabilityai/stable-video-diffusion-img2vid-xt
    unet_checkpoint_pathcheckpoints/VideoMaMa
    precisionfp16
    enable_model_cpu_offloadtrue
    vae_encode_chunk_size1
    attention_modeauto
    enable_vae_tilingfalse
    enable_vae_slicingtrue

    Koolook Matte Loader is where the Matte workflow's heavy lifting gets set up. It loads a mask-guided one-step video matting pipeline built from two models: Stable Video Diffusion as the base (for its temporal VAE) and VideoMaMa, a fine-tuned SVD UNet that turns a video plus rough masks into a clean alpha matte. This is the node that downloads the weights, so it's also the node that eats your first-run time and disk.

    VideoMaMa is the obscure one here. It's a CVPR 2026 method (mask-guided video matting via generative prior), and it's quiet enough that you won't find much community chatter about it - the Koolook pack's own pipeline is an independent implementation of the published method built on the standard diffusers API, not a wrapper around someone's repo. The model's premise: a single denoising step at timestep 1, with the video frame and the guide mask VAE-encoded alongside the noise, and the CLIP cross-attention zeroed because the fine-tune ignores it. Decode with SVD's temporal VAE, take the luminance, that's your alpha. One step, that's the whole trick - video matting fast enough to be practical.

    The inputs that matter

    • base_model_path - defaults to checkpoints/stabilityai/stable-video-diffusion-img2vid-xt. The SVD base provides the VAE. If the path doesn't exist, the node tries to download it from Hugging Face (huggingface_hub) into that folder on first run.
    • unet_checkpoint_path - defaults to checkpoints/VideoMaMa, the fine-tuned UNet. Same deal: missing → snapshot_download of SammyLim/VideoMaMa.
    • vae_encode_chunk_size - frames the VAE encodes/decodes at once. Leave at 1. The tooltip is blunt: raising it makes the VAE decode spike "proportionally bigger and is the usual cause of OOM at high resolution / 4K." Only touch it if you have VRAM to spare.
    • precision - fp16 (default) or bf16. On a CPU-only machine it force-falls back to float32, with a log warning that a GPU is strongly recommended - SVD on CPU is a misery you can avoid.
    • enable_model_cpu_offload - on by default, and worth keeping on: it streams model weights to CPU when idle, which is how this fits on consumer cards.
    • attention_mode - auto/xformers/sdpa/none, for people who know which attention backend their build prefers. auto is the right answer for almost everyone.
    • enable_vae_slicing / enable_vae_tiling - memory knobs. Slicing defaults on, tiling defaults off. Turn tiling on only if you're drowning at high res.

    Output is a single KOOLOOK_MATTE_PIPELINE that wires straight into the Sampler.

    The license asterisk

    The code is GPL-3.0, but the weights it downloads carry their own licenses - VideoMaMa is CC BY-NC 4.0 and SVD is under the Stability Community License. Non-commercial. The pack doesn't redistribute them, and the README says plainly the end user is responsible for compliance. If your project is commercial, this pipeline isn't for you.

    Install

    Part of ComfyUI-Koolook:

    cd ComfyUI/custom_nodes
    git clone https://github.com/malkuthro/ComfyUI-Koolook.git
    

    or via Manager by Git URL https://github.com/malkuthro/ComfyUI-Koolook.git, then restart. The Matte group needs diffusers (the pack's forks pull it in) plus huggingface_hub for the runtime downloads. First run downloads two models - budget some time and disk. Install once, per the pack rule: two installs (Manager's custom_nodes/koolook/ plus a clone) load both and corrupt the workflow store on every boot.

    Common issues

    • First run is slow / huge - that's the SVD and VideoMaMa weights downloading. It's a one-time cost, not a bug.
    • OOM on decode - vae_encode_chunk_size is above 1. Back it to 1.
    • "diffusers isn't installed" - the Matte group is skipped if diffusers can't import; install it into the ComfyUI environment (usually python -m pip install diffusers huggingface_hub inside the venv that runs ComfyUI).
    CategoryKoolook Matte

    Inputs (8)

    NameTypeDefaultDescription
    base_model_pathSTRINGcheckpoints/stabilityai/stable-video-diffusion-img2vid-xt
    unet_checkpoint_pathSTRINGcheckpoints/VideoMaMa
    precisionCOMBOfp162 options: fp16, bf16
    enable_model_cpu_offloadBOOLEANtrue
    vae_encode_chunk_sizeINT11–25Frames the VAE encodes/decodes at once. 1 = desktop (Sammie) default and lowest VRAM; raising it makes the VAE decode spike proportionally bigger and is the usual cause of OOM at high resolution / 4K. Leave at 1 unless you have VRAM to spare and want a small speedup.
    attention_modeCOMBOauto4 options: auto, xformers, sdpa, none
    enable_vae_tilingBOOLEANfalse
    enable_vae_slicingBOOLEANtrue

    Outputs (1)

    NameTypeDescription
    KOOLOOK_MATTE_PIPELINEKOOLOOK_MATTE_PIPELINE