# Run Segment Anything 2

Cuts objects out of photos and video, including moving ones. Ready in about 90 seconds on an RTX 4090, from $0.45/hr. No install, no code.

## What it does

Segment Anything 2 separates an object from its background. Click the thing you want and it traces the edge, including hair, glass, and motion blur.

On video it keeps tracking the same object across every frame, so a cut-out you make once follows the subject through the whole clip.

The usual jobs are removing backgrounds from product photos at volume, isolating a person for a composite, and masking an object so a color change only affects that object.

## Your setup

We run Segment Anything 2 on an RTX 4090 with 24GB of memory, at $0.45 per hour, billed by the minute. It takes about 2 seconds per image.

The large version of Segment Anything 2 needs about 10GB of memory for images and more for video, because it holds a memory of previous frames to keep the same object selected. A 24GB card gives it room for that frame memory at 4K without dropping to a smaller window, which is what keeps the mask from drifting on longer clips.

## What it costs

500 images takes about 17 minutes of GPU time, which is about $0.13.

## Two ways to run it

- **Open the app.** Click on the object you want in your browser, drag the edges if you need to, export the cut-out.
- **Run a batch job.** Send a folder of product photos with one rule, such as "keep the largest object", and get transparent PNGs back.

## Model facts

| Field | Value |
|---|---|
| Parameters | 224M (hiera-large) |
| License | Apache 2.0 |
| Memory required | 10GB minimum |
| Base model | Trained from scratch by Meta |
| Publisher | Meta |
| Recommended hardware | RTX 4090, 24GB |
| Category | [Image generation](https://gpuvault.io/working-on/image-generation/) |

## Questions people ask

### Do I need to install anything to use Segment Anything 2?

No. We start a machine with Segment Anything 2 already loaded and hand you a link. Everything runs in your browser, there is nothing to download, and nothing is left on your computer afterwards. It works the same on a Mac, a Windows laptop, or a Chromebook. A workspace is usually ready in about 90 seconds.

### How much does it cost to run 500 images?

About $0.13. Segment Anything 2 takes about 2 seconds per image on the RTX 4090 we recommend, so 500 images is roughly 17 minutes of GPU time at $0.45 per hour. Billing is by the minute, and a batch job shuts the GPU off the moment the last item finishes. The calculator above works this out for your own numbers.

### Can I run Segment Anything 2 on a cheaper card?

Sometimes, and the calculator will not always make it look worth it. The large version of Segment Anything 2 needs about 10GB of memory for images and more for video, because it holds a memory of previous frames to keep the same object selected. A 24GB card gives it room for that frame memory at 4K without dropping to a smaller window, which is what keeps the mask from drifting on longer clips. If you want to try a different card anyway, the advanced catalog lets you pick one and shows the estimated time before you commit.

### Can I use Segment Anything 2 commercially?

Yes. Segment Anything 2 is released under the Apache 2.0 license, which permits commercial use with no conditions worth worrying about. You can use the output in paid client work and in products you sell.

### What happens to my files after I stop?

Anything you save into your workspace folder stays in your account and is there when you come back. Everything else is destroyed: the machine is terminated and its disk is wiped. Batch job inputs and outputs are deleted from our storage 24 hours after you download them. We do not read your files or use them to train anything.

### What if it fails partway through?

You are not charged for work that did not complete, and failed sessions are refunded automatically. Batch jobs write each output as it finishes rather than at the end, so a failure at item 380 of 400 leaves you 379 usable files and a message saying what broke. Restarting picks up where it stopped rather than redoing the work.

---

*Source: https://gpuvault.io/model/sam-2/ — GPUVault, GPU rental by the minute.*
