Ultralytics / README.md
MidnightRunner's picture
Update README.md
644870a verified
metadata
license: agpl-3.0
tags:
  - pytorch
  - yolo
  - yolov8
  - yolov11
library_name: ultralytics
base_model:
  - Ultralytics/YOLOv8
  - Ultralytics/YOLO11
datasets:
  - wider_face
  - skytnt/anime-segmentation
pipeline_tag: object-detection
metrics:
  - mAP50
  - mAP50-95
language:
  - en

ComfyUI Ultralytics Integration – Midnight1111 Model Collection

For ComfyUI, here’s how to load these models:

  1. Locate your ComfyUI folder (e.g. ~/ComfyUI/ or C:\ComfyUI\).
  2. Create directories:
    cd /path/to/ComfyUI/models
    mkdir -p ultralytics/segm ultralytics/bbox
    
  3. Place your .pt files: • Segmentation → models/ultralytics/segm/ • Detection (bbox) → models/ultralytics/bbox/
  4. Restart ComfyUI
    cd /path/to/ComfyUI
    
  5. In the UI: Add Node → Model → Ultralytics → choose segm/… or bbox/…. Connect an Image Loader → Ultralytics node → Previewer

Unsafe files

Since getattr is classified as a dangerous pickle function, any segmentation model that uses it is classified as unsafe.

All models were created and saved using the official Ultralytics library, so it’s safe to use files downloaded from a trusted source.

See also: https://huggingface.co/docs/hub/security-pickle

Note on Loading Weights

If you encounter an error like:

Weights-only load failed. Unsupported global: builtins.set

This happens because PyTorch (for safety) blocks loading some objects by default. To fix it safely, add this code before loading:

python
import torch
torch.serialization.add_safe_globals([set])

This whitelists set and allows safe loading with weights_only=True.

Otherwise, never disable weights_only unless you 100% trust the file.

Check PyTorch's torch.load docs for more info.