Spiral gives your agent every tool with one account. Browse the tools →

n8n · Data

How to Use SAM 3 image embedding in n8n

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.

Prompts to try with SAM 3 image embedding in n8n

Copy an example into n8n, or ask in your own words.

Check https://raw.githubusercontent.com/facebookresearch/sam2/main/notebooks/images/truck.jpg daily and use SAM 3 image embedding whenever its image contents change; retain the new result.

SAM 3 image embeddingn8n
Try asking
  • Every Monday, use SAM 3 image embedding on https://raw.githubusercontent.com/facebookresearch/sam2/main/notebooks/images/groceries.jpg to prepare a fresh input for our weekly segmentation evaluation.

  • Each night, use SAM 3 image embedding on https://raw.githubusercontent.com/facebookresearch/sam2/main/notebooks/images/cars.jpg and report whether a nonempty embedding was returned.

  • Check https://github.com/facebookresearch/sam2/tree/main/notebooks/images weekly and use SAM 3 image embedding separately for newly added sample photos; keep each result with its source address.

  • On the first of each month, use SAM 3 image embedding on https://raw.githubusercontent.com/facebookresearch/sam2/main/notebooks/images/truck.jpg and report the returned response structure and embedding length.

How to set up SAM 3 image embedding in n8n

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

Use the Spiral skill

  1. Send n8n 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 Spiral's MCP server

  1. Create a key

    Create a key under API keys in the console.

  2. Add an MCP Client node

    In a workflow, add an MCP Client node (or, under an AI Agent node, an MCP Client Tool) and set:

    https://api.spiral.ai/mcp
  3. Pick a tool

    The node lists Spiral's tools. In an MCP Client node pick one, such as run, and give it its arguments:

    {
      "provider": "fal",
      "model": "fal-ai/flux/schnell",
      "input": { "prompt": "a lighthouse at dawn" },
      "wait": true
    }
  4. Run SAM 3 image embedding in a workflow step

    Give the step an instruction like the ones below and run it on your trigger or schedule. Spiral finds SAM 3 image embedding, prices it and runs it each time the step fires.

Use the Spiral CLI

  1. Install and sign in

    Installs the Spiral CLI, signs you in and adds its skill to your coding agents.

    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.

    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: n8n finds SAM 3 image embedding on Spiral, shows the price and runs it.

SAM 3 image embedding providers and prices

Spiral runs SAM 3 image embedding through fal. Open a card for today's price, with every fee included.

falData
Sam 3 · Image Embeddings
fal-ai/sam-3/image/embed

What can you do with SAM 3 image embedding in n8n?

Keep segmentation preparation current as approved images change. A scheduled agent can extract new SAM 3 features for changed images and leave unchanged images ready for later annotation.

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.

Questions about SAM 3 image embedding in n8n

Can n8n use SAM 3 image embedding?

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

How much does SAM 3 image embedding cost in n8n?

$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 n8n plan is separate.

Do I need a fal account to use SAM 3 image embedding in n8n?

You need no fal account. n8n uses one Spiral API key for every tool, and Spiral runs SAM 3 image embedding on its own fal account.

How long does it take to set up SAM 3 image embedding in n8n?

About two minutes: create a key, then add an MCP Client node, then pick a tool.

Does n8n wait while SAM 3 image embedding runs?

SAM 3 image embedding runs in the background. n8n 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.

Get started

Start using SAM 3 image embedding in n8n

One Spiral account for every tool your agent needs. No subscription; you pay per run.

Paste this into n8n:

Set up n8n

set up https://spiral.ai/SKILL.md
Are you an AI agent? See setup options