File size: 2,617 Bytes
109666a
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
5eac5d5
109666a
 
5eac5d5
 
 
 
 
 
 
 
 
 
 
 
 
 
109666a
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
---
license: other
license_name: sam-license
license_link: LICENSE
tags:
  - segmentation
  - image-segmentation
  - video-segmentation
  - sam3
  - meta
  - pytorch
  - safetensors
pipeline_tag: image-segmentation
base_model: facebook/sam3
---

# SAM3 — Segment Anything Model 3

This is an **ungated mirror** of Meta's [SAM3](https://github.com/facebookresearch/sam3) model weights, redistributed under the [SAM License](LICENSE) for easier access.

## What is SAM3?

SAM3 (Segment Anything Model 3) is Meta AI's state-of-the-art foundation model for **promptable segmentation** in images and videos. It supports:

- **Text prompts** — segment objects by describing them (e.g. *"the dog"*)
- **Bounding box prompts** — precise region targeting
- **Point prompts** — click-to-segment
- **Video tracking** — track and segment objects across video frames
- **Automatic mask generation** — segment all objects in a scene

## Files

| File | Description |
|---|---|
| `sam3.safetensors` | Model weights (safetensors format, converted from official `.pt`) |
| `LICENSE` | SAM License (required for redistribution) |

## ⚠️ Conversion Note

The `sam3.safetensors` in this repo is converted **directly from the official `sam3.pt`** checkpoint using:

```python
import torch
from safetensors.torch import save_file

state_dict = torch.load("sam3.pt", map_location="cpu")
save_file(state_dict, "sam3.safetensors")
```

This preserves the original key names (`detector.*`, `tracker.*`). Do **not** use the HuggingFace Transformers-format safetensors from `facebook/sam3` — those have different key names (`detector_model.*`) and are **incompatible** with `build_sam3_video_model()`.

## Usage

```python
# With the official sam3 package
pip install sam3

from sam3.model_builder import build_sam3_image_model
model = build_sam3_image_model(checkpoint_path="sam3.safetensors")
```

## License

This model is distributed under the **SAM License** — see the [LICENSE](LICENSE) file. Key points:

- ✅ Commercial use permitted
- ✅ Redistribution permitted (with license included)
- ✅ Derivative works permitted
- ❌ No military/warfare, nuclear, or espionage use
- ❌ No reverse engineering

## Credits

- **Original model by**: [Meta AI (FAIR)](https://github.com/facebookresearch/sam3)
- **Original HuggingFace repo**: [facebook/sam3](https://huggingface.co/facebook/sam3)
- **Paper**: *Segment Anything Model 3* (submitted to ICLR 2026)
- **Redistributed by**: [Æmotion Studio](https://huggingface.co/AEmotionStudio) for use with [ComfyUI-FFMPEGA](https://github.com/AEmotionStudio/ComfyUI-FFMPEGA)