SlimSAM-77 uniform segment anything (fp16)
slimsam-77-uniform-fp16@5850ab45 fp16 vetted · active onnxruntime-web ≥ 1.17.0 webgpuwasm
Downloads 19.8 MB once from models.skillsafe.ai, then stays cached for every
SkillSafe app that uses it. Inference runs on your device; nothing you enter is uploaded to load it. Licensed
Apache-2.0 · source Hugging Face Xenova/slimsam-77-uniform at 5850ab45f587.
See it working
Public apps that declare this model. Open one and the download you see is this file.
- Image Cutout — Cut Out Anything From a Photo Online, FreeOpen app
Click on any object in a photo to cut it out: left-click adds a positive point, right-click adds a negative point, and a Segment-Anything model running entirely in your browser draws the mask. The cutout updates live after every click; add more objects, undo, then pick a background (transparent, white, blurred photo, colour, gradient or your own image) and download a PNG or JPG, or collage several cutouts on the design canvas. Two models to choose from: SlimSAM-77 (default, fast, about 17 MB) or the full SAM ViT-Base (higher quality, about 190 MB). Photos never leave your device. Free, no sign-up. Interface in 11 languages (EN, 简体中文, 日本語, 한국어, ES, PT, FR, DE, RU, ID, VI). Built on Meta's Segment Anything and SlimSAM (Apache-2.0, Xenova's ONNX exports) and onnxruntime-web (MIT), with weights served from SkillSafe's shared model registry.
Files
Every file is served at an immutable URL; the canonical form is the SHA-256 itself. Tokenizer and config JSON are not here by design — they ship in your app bundle.
| Path | Format | Size | SHA-256 | |
|---|---|---|---|---|
onnx/vision_encoder_fp16.onnx | onnx | 11.6 MB | 11aaeb49c75e…c8aa38 | |
onnx/prompt_encoder_mask_decoder_fp16.onnx | onnx | 8.2 MB | df24d49a6f1a…007f71 |
Signature
Graph inputs and outputs read from the ONNX bytes at vetting — these are the tensor names your session.run() call feeds and reads. Symbolic dimensions are shown by name.
onnx/vision_encoder_fp16.onnx
Inputs
pixel_valuesfloat32 [batch_size, 3, 1024, 1024]
Outputs
image_embeddingsfloat32 [batch_size, 256, 64, 64]image_positional_embeddingsfloat32 [batch_size, 256, 64, 64]
onnx/prompt_encoder_mask_decoder_fp16.onnx
Inputs
input_pointsfloat32 [batch_size, point_batch_size, nb_points_per_image, 2]input_labelsint64 [batch_size, point_batch_size, nb_points_per_image]image_embeddingsfloat32 [batch_size, 256, 64, 64]image_positional_embeddingsfloat32 [batch_size, 256, 64, 64]
Outputs
iou_scoresfloat32 [batch_size, point_batch_size, 3]pred_masksfloat32 [batch_size, point_batch_size, 3, 256, 256]
How to use it
Three steps: declare the model on your release, load it through the SDK (verified and cached), hand the bytes to the runtime. The examples below are generated from this entry, so ids, paths and tensor names are exact.
Add to the body of POST /v1/apps/{slug}/releases (or a release session). An unknown or withdrawn model is refused with a 400 naming it; the app page then shows "downloads 19.8 MB · runs on your device" and /models.txt carries the attribution.
{
"models": [
{
"id": "slimsam-77-uniform-fp16",
"revision": "5850ab45"
}
]
} Streams with progress, verifies the SHA-256 against the catalogue, keeps a durable copy in the app's Cache API and reports whether the bytes came from cache or the network.
<script src="/sdk.js"></script> <!-- vendored from https://skillsafe.ai/apps-sdk/v1.js -->
const ss = SkillSafe.init({ slug: "your-app" });
const caps = await ss.models.capabilities(); // { webgpu, wasm, wasmSimd, storage }
const files = await ss.models.loadAll("slimsam-77-uniform-fp16@5850ab45", {
onProgress: (p) => (bar.style.width = Math.round(p.ratio * 100) + "%"),
}); // { path: ArrayBuffer } — SHA-256 verified, cached
const vision_encoder_fp16 = files["onnx/vision_encoder_fp16.onnx"];
const prompt_encoder_mask_decoder_fp16 = files["onnx/prompt_encoder_mask_decoder_fp16.onnx"];
// Later visits: await ss.models.status("slimsam-77-uniform-fp16@5850ab45") → { cached: [...], missing: [] }
// Background prefetch on a landing page: ss.models.warm("slimsam-77-uniform-fp16@5850ab45") The runtime itself ships in your bundle as a vetted {path, sha256} reference — only the weights come from the registry. Pass the bytes in; do not re-fetch by URL.
// onnxruntime-web 1.17.0 ships in your bundle as a vetted {path, sha256} reference —
// dist/ort.wasm.bundle.min.mjs + dist/ort-wasm-simd-threaded.wasm (or the .jsep pair for WebGPU).
import * as ort from "./ort.wasm.bundle.min.mjs";
ort.env.wasm.wasmPaths = { wasm: "/ort-wasm-simd-threaded.wasm" }; // object form, never a prefix string
ort.env.wasm.numThreads = 1; // app hosts have no COOP/COEP
const bytes = await ss.models.load("slimsam-77-uniform-fp16@5850ab45", "onnx/vision_encoder_fp16.onnx", { onProgress });
const session = await ort.InferenceSession.create(new Uint8Array(bytes), {
executionProviders: ["webgpu", "wasm"],
});
// Feeds are named after the graph inputs (read from the file, see the signature above):
const feeds = {
"pixel_values": new ort.Tensor("float32", new Float32Array(n), [/* batch_size */ 1, 3, 1024, 1024]),
};
const out = await session.run(feeds);
const image_embeddings = out["image_embeddings"].data; // float32 [batch_size, 256, 64, 64]
const image_positional_embeddings = out["image_positional_embeddings"].data; // float32 [batch_size, 256, 64, 64] Immutable, credential-free, Access-Control-Allow-Origin: *, range requests honoured. The host refuses requests carrying a foreign Origin; a plain curl is fine.
https://models.skillsafe.ai/slimsam-77-uniform-fp16@5850ab45/onnx/vision_encoder_fp16.onnx
https://models.skillsafe.ai/slimsam-77-uniform-fp16@5850ab45/onnx/prompt_encoder_mask_decoder_fp16.onnx curl -sSL -o vision_encoder_fp16.onnx "https://models.skillsafe.ai/slimsam-77-uniform-fp16@5850ab45/onnx/vision_encoder_fp16.onnx"
shasum -a 256 vision_encoder_fp16.onnx # 11aaeb49c75e7b3f4cbf8a32c2c819406520c6b3affb4068ff474b2240c8aa38 Licence & attribution
Apache-2.0 · licence text · notice
SlimSAM: 0.1% Data Makes Segment Anything Slim (Chen et al., NeurIPS 2024), a structural pruning of Meta's Segment Anything ViT-B. ONNX fp16 export of the 77%-pruned uniform model published by Xenova on Hugging Face. Licensed under the Apache License 2.0.
Apps that declare this model get this text in their generated /models.txt, so a licence that requires a notice always carries one.