Roboflow

Segment Anything Model (SAM) vs Segment Anything Model 2 (SAM 2)

Compare Segment Anything Model (SAM) and Segment Anything Model 2 (SAM 2) side-by-side.

Compare Segment Anything Model (SAM) vs Segment Anything Model 2 (SAM 2) live

Run the same image across every model that supports a task and compare their outputs side-by-side.

These models don't share enough common tasks for a side-by-side demo. See the comparison table below for their capabilities.

Models in this comparison

Segment Anything Model (SAM) vs Segment Anything Model 2 (SAM 2) Comparison Table

Evals updated July 10, 2026Pricing updated July 21, 2026

PropertySegment Anything Model (SAM)Segment Anything Model 2 (SAM 2)
OrganizationMetaMeta
Categoryopenopen
Modalityvisionvision
Release DateApr 2023Jul 2024
Context Window
Parameters91M-636M38.9M-224.4M
LicenseApache 2.0Apache 2.0
Vision Tasks
Instance Segmentation
Model Features
Foundation Vision

Segment Anything Model (SAM) vs Segment Anything Model 2 (SAM 2): Overview

Segment Anything Model (SAM)

The Segment Anything Model is a promptable image segmentation foundation model developed by Meta AI, released in April 2023 under the Apache 2.0 license. It introduces a general-purpose segmentation architecture trained on SA-1B, a dataset of over 1 billion masks across 11 million images collected using a data engine that leveraged the model itself. SAM accepts point, bounding box, and mask prompts and generates high-quality segmentation masks for any object in an image, including objects not seen during training.

SAM achieves strong zero-shot performance across a wide range of segmentation tasks and domains. Its promptable interface makes it suitable as a building block for automated annotation, interactive segmentation tools, and integration with detection models such as Grounding DINO. SAM has been extended by subsequent works including SAM 2, SAM 3, and Grounded-SAM.

Segment Anything Model 2 (SAM 2)

SAM 2 is a real-time image and video segmentation model developed by Meta AI, released in July 2024 under the Apache 2.0 license. It extends the original Segment Anything Model to support video inputs by introducing a streaming memory architecture that maintains object state across frames, enabling consistent segmentation of objects through occlusion, motion, and scene changes. For image inputs, SAM 2 operates similarly to its predecessor with improved mask quality and speed.

SAM 2 accepts point, box, and mask prompts and produces object masks interactively or in a fully automated mode. Its memory architecture enables video segmentation at real-time speeds. SAM 2 is used in annotation pipelines, video analysis, robotic perception, and any application requiring high-quality promptable segmentation across both images and video.

MetaSegment Anything Model (SAM)
MetaSegment Anything Model 2 (SAM 2)