Nodes/Comfyui-SecNodes/SeC Model Loader
ComfyUI Node

SeC Model Loader

Load the SeC-4B weights and pick a precision (spoiler: FP16)

By 9nate-drake·Created 10 months ago·Updated 8 months ago· 371
SeC Model Loader
    • model
    model_file(No models found - see README for download instructions)
    deviceauto
    use_flash_attntrue
    allow_mask_overlaptrue

    This is the plumbing node. It loads the SeC-4B model off disk and hands it to the SeC Video Segmentation node, which does the actual work. You wire it up once at the top of your graph and mostly forget about it. But "mostly" is doing some work in that sentence - there are two things people trip on here, so it's worth a minute.

    SeC (Segment Concept) is a video object segmentation model built around a vision-language model that understands what an object is rather than just what it looks like, which is how it out-tracks SAM 2.1 through occlusions and scene cuts. None of that matters to this node. This node's whole job is: find the weights, load them at the right precision, get out of the way.

    How it works

    On load, it scans ComfyUI/models/sams/ and shows you whatever SeC models it finds in a dropdown. It loads them in their native precision - the format is the precision, there's no runtime conversion eating your memory savings. Config files are bundled in the repo, so single-file models need no separate download. The output is a SEC_MODEL that plugs into the segmentation node's model input.

    The inputs that matter

    Really just two required ones:

    • model_file - the dropdown of models it found in models/sams/. If you haven't downloaded anything, this reads (No models found - see README for download instructions), which is the single most common reason this node refuses to work. Download a model first (below).
    • device - auto is right for almost everyone (uses your GPU if there is one, falls back to CPU if not). cpu forces CPU and float32, which works but is roughly 10–20x slower - testing only. gpu0, gpu1 etc. show up if you have multiple cards.

    Two optional booleans, both fine on their defaults:

    • use_flash_attn (default on) - Flash Attention 2, roughly a 2x speedup, but it needs an Ampere/Ada/Hopper card (RTX 30/40 series, A100, H100) and CUDA 12+. On an RTX 20-series or older it won't apply, and it's auto-disabled for FP32 anyway. The node quietly falls back to standard attention when it can't use it, so leaving this on is safe.
    • allow_mask_overlap (default on) - lets multiple tracked objects overlap. Turn it off only if you want strict separation between objects.

    One output: model → straight into SeC Video Segmentation.

    Which precision to grab

    You download the actual weights from VeryAladeen/Sec-4B into ComfyUI/models/sams/. The choices:

    • SeC-4B-fp16.safetensors (7.35 GB) - the recommendation. Best balance, works on all CUDA GPUs. If you're not sure, this one.
    • SeC-4B-bf16.safetensors (7.35 GB) - same size, alternative that some GPUs prefer. Segmentation quality is identical to FP16.
    • SeC-4B-fp32.safetensors (14.14 GB) - full precision, double the VRAM, for older-GPU compatibility edge cases. Note Flash Attention can't run on this.

    And the one that isn't an option anymore: FP8 was removed in v1.2 because it produced NaN values in the language model during scene detection. If an old tutorial tells you to grab an FP8 build, ignore it - use FP16 or BF16, same quality, actually reliable.

    How to install it

    • ComfyUI Manager: search "SeC" or "SecNodes", install, restart.
    • Manual: cd ComfyUI/custom_nodes && git clone https://github.com/9nate-drake/Comfyui-SecNodes, then pip install -r requirements.txt from the folder, and restart.

    Common issues

    Dropdown says "No models found" - you haven't downloaded a model, or it's in the wrong folder. It must live in ComfyUI/models/sams/, not checkpoints, not sam2. Download one file, restart, and it appears.

    Flash Attention errors on an older card - RTX 20-series (Turing) and older don't support Flash Attention 2. Turn use_flash_attn off; standard attention works fine, just slower.

    Everything's crawling - check device. If it landed on cpu (no GPU detected, or you forced it), that's your 10–20x slowdown right there. Also confirm you're on FP16/BF16, not lugging the 14 GB FP32 file around for no reason.

    CategorySeC

    Inputs (4)

    NameTypeDefaultDescription
    model_fileCOMBO(No models found - see README for download instructions)Select SeC model file. Each file has a native precision that will be used automatically.
    deviceCOMBOautoDevice: auto (gpu0 if available, else CPU), cpu, gpu0/gpu1/etc (specific GPU)
    use_flash_attnoptBOOLEANtrueEnable Flash Attention 2 for faster inference. Automatically disabled for float32 precision.
    allow_mask_overlapoptBOOLEANtrueAllow tracked objects to overlap. Disable for strictly separate objects.

    Outputs (1)

    NameTypeDescription
    modelSEC_MODEL