Instructions to use MidnightRunner/Ultralytics with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- ultralytics
How to use MidnightRunner/Ultralytics with ultralytics:
from ultralytics import YOLOvv8 model = YOLOvv8.from_pretrained("MidnightRunner/Ultralytics") source = 'http://images.cocodataset.org/val2017/000000039769.jpg' model.predict(source=source, save=True) - Notebooks
- Google Colab
- Kaggle
| 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**: | |
| ```bash | |
| 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 | |
| ```bash | |
| 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: | |
| ```bash | |
| 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: | |
| ```bash | |
| python | |
| ``` | |
| ```bash | |
| 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](https://pytorch.org/docs/stable/generated/torch.load.html) for more info. |