Skip to page content
SAVRN
Search Plan a project

Open-weight model · Mask generation

slimsam-77-uniform-boxes

by Anirudh Aravalli ArAnirudh/slimsam-77-uniform-boxes

slimsam-77-uniform-boxes is an open-weight model for mask generation from Anirudh Aravalli, released under Apache License 2.0. Its published files total 53.4 MB.

SlimSAM (nielsr/slimsam-77-uniform) in ONNX for transformers.js, like Xenova/slimsam-77-uniform — whose image encoder files are reused here unchanged — but with a prompt encoder / mask decoder that takes box prompts.

Parameters—
Context—
Weights53.4 MB
Licenseapache-2.0
AccessOpen weights
Monthly Downloads—

Model Card

By Anirudh Aravalli, published under apache-2.0, revision 6a74f508b2cb.

SlimSAM (nielsr/slimsam-77-uniform) in ONNX for transformers.js, like Xenova/slimsam-77-uniform — whose image encoder files are reused here unchanged — but with a prompt encoder / mask decoder that takes box prompts. Xenova/slimsam-77-uniform's decoder declares no inputboxes, and transformers.js drops inputs a session does not declare, so a box passed to it is silently ignored. This decoder follows Meta's own SAM ONNX convention instead: a box is two extra points in inputpoints, labelled 2 (top-left corner) and 3 (bottom-right corner). Inputs and outputs keep transformers.js's names, so SamModel / SamProcessor drive it unchanged. One rule the caller must follow: a prompt without a box…

Read Anirudh Aravalli's full model card

SlimSAM-77 (uniform) for transformers.js — with box prompts

SlimSAM (nielsr/slimsam-77-uniform) in ONNX for transformers.js, like Xenova/slimsam-77-uniform — whose image encoder files are reused here unchanged — but with a prompt encoder / mask decoder that takes box prompts.

Xenova/slimsam-77-uniform's decoder declares no input_boxes, and transformers.js drops inputs a session does not declare, so a box passed to it is silently ignored. This decoder follows Meta's own SAM ONNX convention instead: a box is two extra points in input_points, labelled 2 (top-left corner) and 3 (bottom-right corner). Inputs and outputs keep transformers.js's names, so SamModel / SamProcessor drive it unchanged.

One rule the caller must follow: a prompt without a box carries a padding point (0, 0) with label -1 (what Hugging Face's SamPromptEncoder adds internally when no box is given). A prompt with a box has no pad.

// click: one positive point + the pad
input_points: [[[[x, y], [0, 0]]]], input_labels: [[[1, -1]]]
// box with a seed point: point, then the two corners
input_points: [[[[x, y], [x0, y0], [x1, y1]]]], input_labels: [[[1, 2, 3]]]
file
onnx/prompt_encoder_mask_decoder.onnx fp32 (WebGPU default) — matches PyTorch SamModel exactly on points, points + box
onnx/prompt_encoder_mask_decoder_quantized.onnx dynamic uint8 (WASM default) — 99.2–99.96% mask agreement with fp32
onnx/vision_encoder*.onnx, config.json, preprocessor_config.json from Xenova/slimsam-77-uniform, unchanged

Exported by export_decoder.py (in this repo), which also checks the export against PyTorch. Apache-2.0, as the SlimSAM weights and the Xenova export it builds on.

Configuration

Architecture
SamModel
Model type
sam

Identity and Version

Repository
ArAnirudh/slimsam-77-uniform-boxes
Publisher
Anirudh Aravalli
Task
Mask generation
Modality
Other
Library
transformers.js
Parameters
Not stated by the source
Languages
sam
Revision
6a74f508b2cb129eda9f9519d67574f1ec27429f
First published
2026-10-13
Last updated
2026-10-13

Files and Weights

9 files, 53.4 MB in total. The weights are 4 files totalling 53.4 MB in onnx.

Weights4 files · 53.4 MB
Configuration3 files · 7.7 KB
Documentation1 file · 2.1 KB
Repository1 file · 1.5 KB
Every file
FileTypeSizeSHA-256
onnx/prompt_encoder_mask_decoder.onnxWeights16.5 MB 0f2d40e6e750
onnx/prompt_encoder_mask_decoder_quantized.onnxWeights4.8 MB 45f97f705ff1
onnx/vision_encoder.onnxWeights23.3 MB 9f8433273a67
onnx/vision_encoder_quantized.onnxWeights8.9 MB cce23c7b2e5d
config.jsonConfiguration379 B —
export_decoder.pyConfiguration6.9 KB —
preprocessor_config.jsonConfiguration466 B —
README.mdDocumentation2.1 KB —
.gitattributesRepository1.5 KB —

License and Download

License
apache-2.0
Access
Open weights, no gate
Download size
53.4 MB
Download from Anirudh Aravalli

Released by Anirudh Aravalli through its official repository on Hugging Face. Read the license.

Built From

  • Derived from nielsr/slimsam-77-uniform
  • Quantized from nielsr/slimsam-77-uniform

Memory Requirements

PrecisionWeights in memory
As published53.4 MB

Weights only, from the published parameter count; the key-value cache and runtime add to this.

Questions About slimsam-77-uniform-boxes

Can I use slimsam-77-uniform-boxes commercially?

Yes. slimsam-77-uniform-boxes is released under Apache License 2.0. The Apache License 2.0 is a permissive open-source license. It permits commercial use, modification and redistribution. It requires keeping the license and copyright notices and any NOTICE file, stating significant changes, and it includes an express patent grant from contributors.

Similar Models

Model · Mask generation

finegrain-box-segmenter

Finegrain

If you want to give the Finegrain Box Segmenter a try, the best way to is take a look at the Finegrain Object Cutter Space we shipped on Hugging Face: it's a fun "prompt to cut out" experience that will enable you to create pixel quality and high resolution cutouts for any object in a photo, by just naming the object. While building Finegrain, we needed a way to create pixel perfect and high resolution cutouts for objects in images. We looked at off-the-shelf solutions, but they simply didn't work for us: - On the one hand, traditional background removal models are great at producing HD cutouts, but unfortunately, different people will have different definitions for background and…

Open weights mit 95M parameters refiners

Model · Mask generation

sam3

AI at Meta

SAM 3 is a unified foundation model for promptable segmentation in images and videos. It can detect, segment, and track objects using text or visual prompts such as points, boxes, and masks. Compared to its predecessor SAM 2, SAM 3 introduces the ability to exhaustively segment all instances of an open-vocabulary concept specified by a short text phrase or exemplars. Unlike prior work, SAM 3 can handle a vastly larger set of open-vocabulary prompts. It achieves 75-80% of human performance on our new SA-CO benchmark which contains 270K unique concepts, over 50 times more than existing benchmarks. The official code is publicly released in the sam3 repo. SAM3 performs Promptable Concept…

Access requested at publisher other 860M parameters transformers