Show HN: 3–5x faster inference for computer vision models, fastforks Fastforks launched a unified API that serves faster versions of published computer vision models, including stereo matching, monocular and multi-view depth, image classification, SAM/SAM 2 segmentation, object detection and DINOv2/DINOv3 backbones, with documentation and benchmarks at fastforks.dev. Each model ships with two backends: a portable plain-PyTorch implementation validated on CPU, NVIDIA CUDA and Apple MPS, and CUDA kernels (NVIDIA sm_80 or newer, Linux or Windows x86-64) plus Metal kernels for 19 model families on Apple silicon. Across the models and sizes measured, the kernel backend has a median speedup of 1.6x over portable, with a quarter at 2.5x or more and a best case of 11x on small classifiers at batch 1, while a few plain ViT classifiers gain nothing. Faster versions of published vision models behind one API: stereo matching, monocular and multi-view depth, image classification, semantic and promptable segmentation SAM , object detection and feature backbones DINOv2, DINOv3 . You load a model by its id and get the original network's output, faster. Docs, model tables and benchmarks: fastforks.dev https://fastforks.dev . Also available as ComfyUI nodes comfyui . Every model has two backends; kernels run only where the GPU and driver fit otherwise auto uses portable : - portable : the original network in plain PyTorch, checked against the authors' code. Validated on CPU, NVIDIA CUDA and Apple MPS; other PyTorch devices are untested. On Apple silicon, many models also have an MLX https://fastforks.dev/usage apple-silicon-mlx port. - kernels : the same network with our CUDA kernels NVIDIA sm 80 or newer, Linux or Windows x86-64 and, for 19 families, Metal kernels on Apple silicon. Across the models and sizes we measured, the median is 1.6x faster than portable, with a quarter at 2.5x or more and the best at 11x small classifiers at batch 1 . A few plain ViT classifiers gain nothing benchmarks https://fastforks.dev/benchmarks . By default mode="auto" fastforks uses kernels where they can run and the recorded measurements prefer them, and portable everywhere else. | task | package | call → result | example models | |---|---|---|---| | stereo matching https://fastforks.dev/tasks/stereo | fastforks.stereo | model left, right → disparity | igev-stereo-sceneflow , raft-stereo-middlebury , las2-s | | optical flow https://fastforks.dev/tasks/flow | fastforks.flow | model image1, image2 → per-pixel motion 2, H, W dx, dy in pixels | raft-large , raft-small | | dense matching https://fastforks.dev/tasks/matching | fastforks.matching | model image1, image2 → for every pixel of image1 its position in image2 2, H1, W1 pixels and a certainty H1, W1 | romav2 , romav1 | | structure from motion https://fastforks.dev/sfm | fastforks.matching.sfm | colmap database images, db → COLMAP database retrieval, matching, verification ; reconstruct images, out → camera poses + sparse points | loma-b default , aliked-lightglue fast , disk-lightglue | | monocular depth https://fastforks.dev/tasks/depth | fastforks.depth | model image → depth or inverse depth | depth-anything-v2-s , moge-2-vitl-normal , depth-pro | | multi-view depth https://fastforks.dev/tasks/multiview | fastforks.multiview | model images → depth, points, cameras per view; calibrated MVS mvsanywhere, patchmatchnet also take intrinsics= , cam to world= patchmatchnet also needs depth range= near, far and returns the reference view only ; VGGT / MapAnything / AnySplat: images only; AnySplat also returns result.gaussians 3DGS, .save "x.ply" | mvsanywhere , vggt-1b , mapanything-apache | | image classification https://fastforks.dev/tasks/classification | fastforks.classification | model image → logits, top k | resnet50.tv2 in1k , efficientnet b0.tv in1k , vit base patch16 224.augreg2 in21k ft in1k , wd-vit-tagger-v3 , falconsai-nsfw-vit | | semantic segmentation https://fastforks.dev/tasks/segmentation | fastforks.segmentation | model image → label map | segformer-b0-ade20k , mask2former-swinl-ade20k , eomt-l-dinov2-ade20k , segformer-b2-clothes , bisenet-face-parsing | | promptable segmentation: SAM / SAM 2 https://fastforks.dev/tasks/promptable segmentation | fastforks.promptable segmentation | model image, input points= x, y , input labels= 1 or input boxes= → masks 3, H, W bool + iou scores 3 one point | sam-vit-b , sam2.1-hiera-large | | promptable segmentation: SAM 3 concepts https://fastforks.dev/tasks/promptable segmentation | fastforks.promptable segmentation | model image, text="cat" and / or exemplar boxes input boxes= → every instance of the concept | sam3 | | object detection https://fastforks.dev/tasks/detection | fastforks.detection | model image → boxes, labels, scores | faster-rcnn-r50-fpn-3x-coco , mask-rcnn-r50-fpn-3x-coco | | matting / background removal https://fastforks.dev/tasks/matting | fastforks.matting | model image → alpha H, W in 0, 1 1 = foreground | birefnet , birefnet-lite , ben2 , isnet-general-use , u2net , inspyrenet | | line art / edge maps https://fastforks.dev/tasks/edges | fastforks.edges | model image → edges H, W in 0, 1 1 = line , ControlNet preprocessors | lineart , lineart-coarse | | text recognition OCR https://fastforks.dev/tasks/ocr | fastforks.ocr | model image → text lines in reading order: quads N, 4, 2 , texts, scores | ppocrv5-server , ppocrv5-mobile , parseq | | point tracking https://fastforks.dev/tasks/tracking | fastforks.tracking | model frames, queries with queries Q, 3 t, x, y → tracks T, Q, 2 pixels + visibility T, Q | tapnext , tapnext-pp , bootstapir , tapir , alltracker , alltracker-tiny , track-on2 , track-on-r , locotrack-b , locotrack-s | | frame interpolation https://fastforks.dev/tasks/interpolation | fastforks.interpolation | model frame1, frame2, timestep=0.5 → frame 3, H, W RGB in 0, 1 | rife-4.25 , rife-4.26 , rife-4.25-lite , gimm-vfi-r , gimm-vfi-r-p , ema-vfi , ema-vfi-small , ema-vfi-t , ema-vfi-small-t , film | | image retrieval / place recognition https://fastforks.dev/tasks/retrieval | fastforks.retrieval | model image → descriptor D unit norm ; retrieval.top k queries, database , retrieval.pairs descriptors | megaloc | | camera calibration https://fastforks.dev/tasks/calibration | fastforks.calibration | model image → intrinsics 3, 3 , gravity 3 , roll / pitch / vertical FoV rad | geocalib-pinhole , anycalib-pinhole | | image restoration / upscaling https://fastforks.dev/tasks/restoration | fastforks.restoration | model image tile=512 for large images → image 3, sH, sW RGB in 0, 1 , s = model.scale | realesrgan-x4plus , realesrgan-x2plus , realesrgan-x4plus-anime-6b , hat-x4 , dat-x4 , codeformer , realesr-general-x4v3 , realplksr-nomoswebphoto-x4 , gfpgan-v1.4 | | human pose https://fastforks.dev/tasks/pose | fastforks.pose | model image, boxes=person boxes → 17 COCO keypoints 133 whole-body for DWPose with scores per person | rtmpose-m , vitpose-plus-base , rtmpose-l-384 | | 3D medical segmentation https://fastforks.dev/tasks/volume | fastforks.volume | model ct, meta=meta volume.read nifti or model ct, spacing=... → labels D, H, W per voxel 117 TotalSegmentator classes ; volume.load folder for any nnU-Net v2 export | totalsegmentator-total , totalsegmentator-total-3mm | | feature backbones https://fastforks.dev/tasks/features | fastforks.features | model image → token features, image embedding | dinov2-vitb14 , dinov3-vitl16 , dinov3-convnext-small | The task links go to the model pages, which list every model of the task with its licences, accuracy, speed and memory. Not sure which model to use? The overview https://fastforks.dev/models compares them per task and names the fastest, the most accurate and the best commercially usable ones. python from fastforks import stereo model = stereo.load "igev-stereo-sceneflow" kernels on a supported NVIDIA GPU or Apple silicon, else portable result = model "left.png", "right.png" result.disparity H, W float32 tensor, pixels result.backend which backend ran, on which device cpu model = stereo.load "igev-stereo-sceneflow", device="cpu" also with a CUDA build of PyTorch One line per task families built on timm, torchvision or transformers need that extra; see the install table below : python needs: pip install "fastforks-core torchvision " from fastforks import classification, depth, detection, segmentation depth.load "depth-anything-v2-s" "room.jpg" .inverse depth H, W float32 relative inverse depth detection.load "rtdetrv2-s-coco" "street.jpg", score threshold=0.5 .to list dicts: box, class name, score classification.load "resnet50.tv2 in1k" "cat.jpg" .top 3 class name, probability , ... segmentation.load "dinov2-s-linear-ade20k" "street.jpg" .labels H, W class index per pixel mode="kernels" or mode="portable" forces a backend; kernels raises with the reason if it cannot run here instead of silently falling back. fastforks bench igev-stereo-sceneflow times both on your machine. For deployment, TensorRT can be faster than kernels for a few models see export https://fastforks.dev/export . The usage guide https://fastforks.dev/usage has a quickstart per task and covers precision, batches, video, several GPUs, torch.compile , ONNX and TensorRT export, and loading your own weights. Install PyTorch for your platform first pytorch.org https://pytorch.org/get-started/locally/ ; fastforks uses the build you have, CUDA or CPU-only. Then: pip install fastforks everything: all models + timm, torchvision, transformers, ONNX pip install "fastforks tensorrt " everything + TensorRT export pip install fastforks-core lean: every model whose code licence is permissive, no extra libraries pip install "fastforks-core nc " + models with non-commercial or GPL code S2M2, FoundationStereo, MonSter, ... pip install "fastforks-core timm " libraries some model families are built on pip install "fastforks-core torchvision " pip install "fastforks-core transformers " pip install "fastforks-core onnx " ONNX export pip install "fastforks-core tensorrt " TensorRT export pip install "fastforks-core sfm " pycolmap: fastforks sfm --reconstruct the COLMAP mapper pip install "fastforks-core nifti " nibabel: fastforks.volume.read nifti / write nifti pip install "fastforks-core dicom " + pydicom: fastforks.volume.read dicom pip install "fastforks-core codes " tapirscan: fastforks.ocr.scan codes barcodes, QR / Data Matrix codes pip install "fastforks-core mlx " Apple MLX backend device="mlx", Apple silicon pip install "fastforks-core libs " timm, torchvision, transformers and ONNX at once Without an extra, every task works except these MissingDependencyError names the extra when one is missing : | Task | Needs | |---|---| | classification | timm 11 models or torchvision 15 models | | segmentation | transformers SegFormer, Mask2Former, ... ; the other 10 models need none | | detection | torchvision for the R-CNN models | | volume | nifti for read nifti / write nifti , dicom for read dicom | | stereo, depth, features, promptable segmentation, multi-view | none | | ONNX / TensorRT export | onnx / tensorrt | pip install fastforks pulls a default torch build, which may be CPU-only on your platform. For a CUDA build install torch first from pytorch.org https://pytorch.org/get-started/locally/ e.g. pip install torch torchvision --index-url https://download.pytorch.org/whl/cu130 , or .../whl/cpu for a CPU-only machine; install torchvision from the same index, or the torchvision extra pulls a mismatched build and import torchvision fails ; python -c "import torch; print torch.cuda.is available " should print True . From a git checkout every model, like fastforks : uv pip install -e '. libs ' or pip install -e '. libs '; pip install . no -e works too fastforks is fastforks-core nc,libs ; both install the same import fastforks . For commercial products start from fastforks-core . Weights with a non-commercial licence S2M2, FoundationStereo, but also bridgedepth-sf with permissive code are never downloaded unless you set FASTFORKS NONCOMMERCIAL=1 ; weights=PATH uses a copy you have. A model whose library is missing fails in load with the extra to install. Weights and kernels are downloaded on first use into ~/.cache/fastforks and checked against a recorded SHA-256; fastforks download MODEL fetches them ahead of time, and the Docker guide https://fastforks.dev/docker covers offline machines and Docker images. Weights you already have are used in place: files in the Hugging Face hub cache e.g. from hf download or in a directory on FASTFORKS WEIGHTS PATH , or one file passed as load ..., weights=PATH . Gated weights e.g. DINOv3 : accept the licence on the model's Hugging Face page, log in hf auth login , or huggingface hub.login in Python , and load the model; the download goes through huggingface hub . fastforks never handles your Hugging Face token. Requirements: Python = 3.11 and PyTorch = 2.8. Metal kernels run on Apple silicon see the usage guide . The CUDA kernels need Linux or Windows on x86-64, an NVIDIA GPU of compute capability 8.0 or newer RTX 30 series, A100 and later and a driver = 570. So far it is tested only on an RTX 5060 Ti: fastforks env shows what your GPU would use, and Other GPUs https://fastforks.dev/other-gpus explains how to measure it and send us the numbers. The fastforks node pack brings these models to ComfyUI: one node per task with a model dropdown and automatic weight download, on Windows, Linux and macOS. Install it with ComfyUI-Manager search for fastforks or with comfy node install fastforks then restart ComfyUI; example workflows are among its templates. The same models run up to 29x faster than in popular nodes, with less VRAM RTX 5060 Ti: Metric3D v2 normals 29x, Depth Anything V2 6x . Unlike the Python package, installing the pack allows downloading non-commercial weights tagged non-commercial ; set FASTFORKS COMMERCIAL ONLY=1 to refuse every model not cleared for commercial use. See the nodes and models https://github.com/kleinicke/fastforks/tree/main/integrations/comfyui and the node reference https://github.com/kleinicke/fastforks/blob/main/docs/comfyui.md . Many models are licensed for non-commercial use only. Each model page lists the code licence, the weights licence, the training data and a commercial-use flag, which is yes only if both the code and the weights licence allow commercial use. Each model directory keeps the original licence file, and weights are downloaded from the authors' own hosts a few from a mirror of the same files . python import fastforks from fastforks import stereo stereo.list models commercial="yes" stereo models whose code and weights licences allow commercial use print fastforks.describe models stereo.list models "igev " licences, and what blocks a "yes" Training-data terms SceneFlow, KITTI, ImageNet, ... are shown as a note next to the flag; the usage guide https://fastforks.dev/usage licences-and-commercial-use explains how the flag is set. None of this is legal advice. fastforks list PATTERN --task TASK --commercial yes|no|unclear --tier stable|experimental|deprecated --format text|json|csv fastforks info depth-anything-v2-s one model in detail fastforks download MODEL ... --kernels fetch weights and kernels ahead of time fastforks stereo run LEFT RIGHT --model MODEL --out DIR a stereo model over many pairs folders or globs fastforks sfm IMAGES OUT --reconstruct --matcher MODEL image folder - COLMAP database - poses + points fastforks bench igev-stereo-sceneflow --mode auto|portable|kernels --size HxW portable and kernels side by side fastforks export MODEL --format onnx|trt --size HxW --fp16 -o FILE fastforks doctor which models can run here, and what blocks the others fastforks env versions, GPU, kernel binaries for bug reports fastforks COMMAND --help lists all options. The fastforks core, the wrappers and our kernels are Apache-2.0 LICENSE . Vendored model code keeps its original licence the LICENSE file in each model directory , and so do our modifications of it. See CONTRIBUTING.md https://github.com/kleinicke/fastforks/blob/main/CONTRIBUTING.md ; the checklist for adding a model is there. What changed between releases: CHANGELOG.md https://github.com/kleinicke/fastforks/blob/main/CHANGELOG.md .