[Integrations](https://spiral.ai/integrations) › [Google Antigravity](https://spiral.ai/integrations/antigravity) › [SAM 3 image embedding](https://spiral.ai/integrations/antigravity/sam-3-image-embedding)

# How to Use SAM 3 image embedding in Google Antigravity

Returns a base64-encoded image embedding for segmentation workflows. Use it to prepare visual features for later mask generation; the response contains an embedding rather than finished masks.

|  |  |
| --- | --- |
| Model | SAM 3 image embedding |
| Available through | fal |
| Category | Data |
| Price | $0.0065 per run at the default inputs. |
| Returns | json |
| Runs | In the background |
| Setup | About 2 minutes, no API key |

## Prompts to try with SAM 3 image embedding in Google Antigravity

- Use SAM 3 image embedding on https://raw.githubusercontent.com/facebookresearch/sam2/main/notebooks/images/truck.jpg and save the returned response as a fixture for our image preprocessing code.
- Use SAM 3 image embedding on https://raw.githubusercontent.com/facebookresearch/sam2/main/notebooks/images/groceries.jpg and add the returned embedding to our annotation prototype's image record.
- Use SAM 3 image embedding on https://raw.githubusercontent.com/facebookresearch/sam2/main/notebooks/images/cars.jpg and store the result under a hash of the source image contents.
- Use SAM 3 image embedding on https://raw.githubusercontent.com/facebookresearch/sam2/main/notebooks/images/truck.jpg and update our response parser to read the actual returned string.
- Use SAM 3 image embedding on https://raw.githubusercontent.com/facebookresearch/sam2/main/notebooks/images/groceries.jpg and add the result to our segmentation experiment manifest, separate from mask outputs.

## How to set up SAM 3 image embedding in Google Antigravity

Pick the way that suits you. Each takes about two minutes.

### Use Spiral's MCP server

1. **Open the MCP config**: * Antigravity App: click Customizations, then Installed. In the MCP Servers section, click Copy Config File Path and open that file. * Antigravity IDE: click … at the top of the agent side panel, select MCP Servers, then Manage MCP Servers › View raw config. * Antigravity CLI: edit `~/.gemini/config/mcp_config.json`.

2. **Add the server**: Add Spiral under `mcpServers`:

```json
{
  "mcpServers": {
    "spiral": {
      "serverUrl": "https://api.spiral.ai/mcp"
    }
  }
}
```

3. **Sign in**: In the Antigravity App, open Customizations › Installed. Under MCP Servers, click Authenticate next to Spiral. Sign in to Spiral, pick the organization and click Authorize. Copy the authorization code the browser shows, paste it into Enter authorization code and click Submit. No API key.

### Use the Spiral skill

1. **Send Google Antigravity this message**: Your agent reads Spiral's skill and sets itself up.

```
set up https://spiral.ai/SKILL.md
```

2. **Sign in or paste a key**: Approve Spiral in the browser, or give the agent a key from the console.

### Use the Spiral CLI

1. **Install and sign in**: Installs the Spiral CLI, signs you in and adds its skill to your coding agents.

```bash
npx -y spiral-cli@latest init
```

### Call the Spiral API

1. **Create an API key**: In the console, under API keys.

2. **Run SAM 3 image embedding**: One request; the result comes back by polling or a webhook.

```bash
curl https://api.spiral.ai/v1/runs \
  -H "Authorization: Bearer $SPIRAL_API_KEY" \
  -H "Content-Type: application/json" \
  -H "Idempotency-Key: $(uuidgen)" \
  -d '{
    "provider": "fal",
    "model": "fal-ai/sam-3/image/embed",
    "input": {
      "image_url": "https://raw.githubusercontent.com/facebookresearch/segment-anything-2/main/notebooks/images/truck.jpg"
    }
  }'
```

Then paste one of the prompts above: Google Antigravity finds SAM 3 image embedding on Spiral, shows the price and runs it.

Setup guide in the docs: https://spiral.ai/docs/quickstarts/antigravity

## SAM 3 image embedding tools and prices

- [Sam 3 · Image Embeddings](https://spiral.ai/tools/fal/fal-ai/sam-3/image/embed) (fal): $0.0065 per run at the default inputs.

## What can you do with SAM 3 image embedding in Google Antigravity?

Build an annotation tool that prepares SAM 3 image features before users start selecting objects. Keep embedding extraction separate from the code that produces masks.

### Prepare images for interactive annotation

Extract visual features before an annotator starts trying segmentation prompts. Keep the embedding available for a compatible downstream mask workflow.

### Prepare product photos for cutouts

Generate embeddings for approved product photography before a separate segmentation step selects products and removes backgrounds.

### Build a vehicle segmentation test set

Extract embeddings from public vehicle sample images as inputs for later experiments that isolate wheels, body panels, or whole vehicles.

### Precompute features for an image archive

Prepare an archive for later segmentation experiments by extracting one embedding per image ahead of the annotation work.

### Process new catalog photography

Generate embeddings when approved catalog images arrive or change. Associate each result with the exact image contents used for extraction.

### Compare downstream segmentation approaches

Use prepared image features when evaluating compatible mask workflows. Keep feature extraction separate from the experiment that generates and evaluates masks.

## Overview

- [fal](https://spiral.ai/providers/fal)
- [All Google Antigravity guides](https://spiral.ai/integrations/antigravity)

## SAM 3 image embedding in other agents

- [Amp](https://spiral.ai/integrations/amp/sam-3-image-embedding)
- [ChatGPT](https://spiral.ai/integrations/chatgpt/sam-3-image-embedding)
- [Claude](https://spiral.ai/integrations/claude-desktop/sam-3-image-embedding)
- [Claude Code](https://spiral.ai/integrations/claude-code/sam-3-image-embedding)
- [Cline](https://spiral.ai/integrations/cline/sam-3-image-embedding)
- [Codex](https://spiral.ai/integrations/codex/sam-3-image-embedding)
- [Cursor](https://spiral.ai/integrations/cursor/sam-3-image-embedding)
- [Devin](https://spiral.ai/integrations/devin/sam-3-image-embedding)
- [dots](https://spiral.ai/integrations/dots/sam-3-image-embedding)
- [Factory Droid](https://spiral.ai/integrations/factory-droid/sam-3-image-embedding)
- [Gemini](https://spiral.ai/integrations/gemini/sam-3-image-embedding)
- [Gemini CLI](https://spiral.ai/integrations/gemini-cli/sam-3-image-embedding)
- [goose](https://spiral.ai/integrations/goose/sam-3-image-embedding)
- [Grok](https://spiral.ai/integrations/grok/sam-3-image-embedding)
- [Grok Build](https://spiral.ai/integrations/grok-build/sam-3-image-embedding)
- [Hermes](https://spiral.ai/integrations/hermes/sam-3-image-embedding)
- [Instinct](https://spiral.ai/integrations/instinct/sam-3-image-embedding)
- [Manus](https://spiral.ai/integrations/manus/sam-3-image-embedding)
- [Muse](https://spiral.ai/integrations/muse/sam-3-image-embedding)
- [Muse Code](https://spiral.ai/integrations/muse-code/sam-3-image-embedding)
- [n8n](https://spiral.ai/integrations/n8n/sam-3-image-embedding)
- [Notion](https://spiral.ai/integrations/notion/sam-3-image-embedding)
- [OpenClaw](https://spiral.ai/integrations/openclaw/sam-3-image-embedding)
- [opencode](https://spiral.ai/integrations/opencode/sam-3-image-embedding)
- [Perplexity](https://spiral.ai/integrations/perplexity/sam-3-image-embedding)
- [Raycast](https://spiral.ai/integrations/raycast/sam-3-image-embedding)
- [VS Code](https://spiral.ai/integrations/vscode/sam-3-image-embedding)
- [Windsurf](https://spiral.ai/integrations/windsurf/sam-3-image-embedding)
- [Zapier](https://spiral.ai/integrations/zapier/sam-3-image-embedding)

## More Google Antigravity guides

- [Moondream 2 object coordinates](https://spiral.ai/integrations/antigravity/moondream-2-object-coordinates)
- [Sa2VA 4B image segmentation](https://spiral.ai/integrations/antigravity/sa2va-4b-image-segmentation)
- [Moondream 2 object bounding boxes](https://spiral.ai/integrations/antigravity/moondream-2-object-bounding-boxes)
- [Sa2VA 4B video segmentation](https://spiral.ai/integrations/antigravity/sa2va-4b-video-segmentation)
- [Mistral document text extraction](https://spiral.ai/integrations/antigravity/mistral-document-text-extraction)
- [Sa2VA 8B image segmentation](https://spiral.ai/integrations/antigravity/sa2va-8b-image-segmentation)

## Questions about SAM 3 image embedding in Google Antigravity

**Can Google Antigravity use SAM 3 image embedding?**

Yes. Add Spiral to Google Antigravity as an MCP server, and Google Antigravity can find and run SAM 3 image embedding like any built-in tool.

**How much does SAM 3 image embedding cost in Google Antigravity?**

$0.0065 per run at the default inputs. You pay from your Spiral balance as you go, with no subscription, and a failed run is not charged. Your Google Antigravity plan is separate.

**Do I need a fal account to use SAM 3 image embedding in Google Antigravity?**

No. Spiral runs SAM 3 image embedding on its own fal account. You sign in to Spiral once and never paste a key.

**How long does it take to set up SAM 3 image embedding in Google Antigravity?**

About two minutes: open the MCP config, then add the server, then sign in.

**Does Google Antigravity wait while SAM 3 image embedding runs?**

SAM 3 image embedding runs in the background. Google Antigravity starts the run, checks on it and gives you the json when it's ready.

**What does SAM 3 return for an image?**

It returns one base64-encoded image embedding. The published response schema names this string embedding_b64.

**Does the result include masks or detected objects?**

The embedding response lists no masks, object labels, bounding boxes, or confidence scores. Mask generation is a later segmentation step.

**How many images does one call process?**

This endpoint processes one image per call. Preparing a collection requires a separate extraction for each image.

**Can the same image features support several segmentation attempts?**

Yes. fal describes extracting embeddings once and reusing those features for multiple mask prompts without reprocessing the source image.

**Does an embedding stay current when the original image changes?**

The documented result represents the single image supplied for extraction. It follows that a saved embedding represents those image contents, so a replacement image needs a new extraction.

