Nodes/ComfyUI-YOLO/Ultralytics Model Loader
ComfyUI Node

Ultralytics Model Loader

The one node that hands YOLO to your whole graph

By kadirnar·Created 2 years ago·Updated 7 months ago· 121
Ultralytics Model Loader
    • ULTRALYTICS_MODEL
    model_name

    YOLO is the workhorse detector in this pack, and this is the node that gets it on the canvas. Pick a model from the dropdown, and the loader either finds it in ComfyUI/models/ultralytics or downloads it on the spot from Ultralytics' own asset releases. One output - ULTRALYTICS_MODEL - and it's the thing you feed into every other Ultralytics node in the pack. If you've used Impact Pack's UltralyticsDetectorProvider, this is the same idea stripped to the minimum: a dropdown, a download, a model object.

    The dropdown covers 26 pretrained checkpoints, so you get the whole modern YOLO family: yolov5n through yolov5x (plus the n6/x6 variants trained at higher resolution), yolov8 n/s/m/l/x, yolov9 t/s/m/c/e, yolov10 n/s/m/l/x, and mobile_sam.pt - the small SAM variant, the pack's nod to segmentation. The naming rule is worth internalizing: the letter is the size (nano < small < medium < large < x), and bigger means slower and more accurate. yolov8n is roughly 6MB and runs on a potato; yolov8x is over 130MB and eats VRAM. For a first workflow, yolov8s - the source's default when the field is left empty - is the boring, sensible pick.

    The mechanism is simple. The loader builds a URL from your selection, points it at https://github.com/ultralytics/assets/releases/download/v8.2.0/<name>.pt, and pulls the file into models/ultralytics if it isn't already there. Then it hands the path to Ultralytics' YOLO() constructor and caches the loaded model in a dict, so re-running the graph doesn't reload it from disk every time. First run on a fresh model pays a download; every run after is instant.

    Install the pack through ComfyUI Manager (search "ComfyUI-YOLO") or:

    cd ComfyUI/custom_nodes
    git clone https://github.com/kadirnar/ComfyUI-YOLO
    

    then restart ComfyUI and let Manager handle the ultralytics>=8.2.27 requirement. Note the README's cd custom/nodes is a typo - the real folder is custom_nodes. If you'd rather not depend on the auto-download, drop any .pt into ComfyUI/models/ultralytics yourself and it gets picked up without a network call.

    Two things to know before you rely on this. First, the Ultralytics stack is AGPL-3.0 - irrelevant for local tinkering, a real conversation if you ever ship a product around it. Second, the December 2024 supply-chain scare: a compromised Ultralytics release shipped a cryptominer and it reached ComfyUI users through Impact Pack. That package is long since patched and today's PyPI installs are fine, but it's the reason some packs keep YOLO providers in optional subpacks - and worth knowing where your ultralytics install came from. Load the model, wire it into UltralyticsInference, and you're done.

    CategoryUltralytics/Model

    Inputs (1)

    NameTypeDefaultDescription
    model_nameoptCOMBO26 options: yolov5nu.pt, yolov5su.pt, yolov5mu.pt, yolov5lu.pt, yolov5xu.pt, yolov5n6u.pt, +20

    Outputs (1)

    NameTypeDescription
    ULTRALYTICS_MODELULTRALYTICS_MODEL