[Integrations](https://spiral.ai/integrations) › [Devin](https://spiral.ai/integrations/devin) › [EVF-SAM2](https://spiral.ai/integrations/devin/evf-sam2)

# How to Use EVF-SAM2 in Devin

EVF-SAM2 turns an English description into a selection mask for an existing image. Use it to isolate a named object or select hair and background regions with semantic segmentation for later editing.

|  |  |
| --- | --- |
| Model | EVF-SAM2 |
| Available through | fal |
| Category | Image |
| Price | $0.0065 per run at the default inputs. |
| Returns | image |
| Runs | In the background |
| Setup | About 2 minutes, no API key |

## Prompts to try with EVF-SAM2 in Devin

- Use EVF-SAM2 on assets/product.jpg to select 'the shoe on the left.' Save the binary mask beside the original and create an overlay for review.
- Use EVF-SAM2 on assets/portrait.jpg with semantic segmentation to select 'hair.' Save the mask and add a preview so I can inspect the selection.
- Use EVF-SAM2 on assets/room.jpg to select 'the chair beside the window.' Prepare the mask for a later recoloring step.
- Use EVF-SAM2 on assets/table.jpg to select 'the plate' and exclude 'the fork.' Show the resulting selection over the original.
- Use EVF-SAM2 on the project's sample landscape image with semantic segmentation to select 'sea.' Add the mask to our image-editing preview.

## How to set up EVF-SAM2 in Devin

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

### Use Spiral's MCP server

1. **Add a custom MCP**: Open Customize › MCPs. Click + and choose New MCP. Fill in:

2. **Sign in to Spiral and approve**: In Customize › MCPs, open Spiral and choose Connect. Spiral opens: sign in, pick the organization and click Authorize. No API key.

3. **Check it**: On Spiral's configuration page, click Test tools. Devin lists Spiral's tools.

### Use the Spiral skill

1. **Send Devin 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 EVF-SAM2**: 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/evf-sam",
    "input": {
      "prompt": "Cat in the middle of the image",
      "image_url": "https://storage.googleapis.com/falserverless/web-examples/evf-sam2/evfsam2-cat.png"
    }
  }'
```

Then paste one of the prompts above: Devin finds EVF-SAM2 on Spiral, shows the price and runs it.

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

## EVF-SAM2 tools and prices

- [EVF-SAM2 Segmentation](https://spiral.ai/tools/fal/fal-ai/evf-sam) (fal): $0.0065 per run at the default inputs.

## Settings you can ask for

| Setting | Allowed values | Default | Description |
| --- | --- | --- | --- |
| negative_prompt |  | — | Areas to exclude from segmentation (will be subtracted from prompt results) |
| semantic_type |  | false | Enable semantic level segmentation for body parts, background or multi objects |
| mask_only |  | true | Output only the binary mask instead of masked image |
| use_grounding_dino |  | false | Use GroundingDINO instead of SAM for segmentation |
| revert_mask |  | false | Invert the mask (background becomes foreground and vice versa) |
| blur_mask | 0 to 50 | 0 | Apply Gaussian blur to the mask. Value determines kernel size (must be odd number) |

## What can you do with EVF-SAM2 in Devin?

Turn image assets in your project into selections for editing and annotation. Use EVF-SAM2 to describe the target in English, then build a review step around the returned mask.

### Product selections for recoloring

Use EVF-SAM2 to mask a specific shoe, bag, or chair in a product photo, then pass the selection to an editing tool.

### Background replacement preparation

Use EVF-SAM2 with semantic segmentation to select a photo's background before replacing it in a separate editing step.

### Hair color previews

Use EVF-SAM2 with semantic segmentation to select hair for a color preview. Inspect the selection before applying the edit.

### One object in a crowded photo

Use EVF-SAM2 to select a target by its location or relationship to another object, such as the cup beside a plate.

### Draft annotation masks

Use EVF-SAM2 to propose object masks from English descriptions, then have an annotator review them before adding them to a dataset.

### Landscape editing selections

Use EVF-SAM2 with semantic segmentation to select a region such as the sea for a later color adjustment.

## Overview

- [fal](https://spiral.ai/providers/fal)
- [All Devin guides](https://spiral.ai/integrations/devin)

## EVF-SAM2 in other agents

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

## More Devin guides

- [Dodge Burn](https://spiral.ai/integrations/devin/dodge-burn)
- [Expression Change](https://spiral.ai/integrations/devin/expression-change)
- [Dissolve](https://spiral.ai/integrations/devin/dissolve)
- [FASHN Virtual Try-On v1.5](https://spiral.ai/integrations/devin/fashn-virtual-try-on-v1-5)
- [DDColor](https://spiral.ai/integrations/devin/ddcolor)
- [FASHN Virtual Try-On v1.6](https://spiral.ai/integrations/devin/fashn-virtual-try-on-v1-6)

## Questions about EVF-SAM2 in Devin

**Can Devin use EVF-SAM2?**

Yes. Add Spiral to Devin as an MCP server, and Devin can find and run EVF-SAM2 like any built-in tool.

**How much does EVF-SAM2 cost in Devin?**

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

**Do I need a fal account to use EVF-SAM2 in Devin?**

No. Spiral runs EVF-SAM2 on its own fal account. You sign in to Spiral once and never paste a key.

**How long does it take to set up EVF-SAM2 in Devin?**

About two minutes: add a custom MCP, then sign in to Spiral and approve, then check it.

**Does Devin wait while EVF-SAM2 runs?**

EVF-SAM2 runs in the background. Devin starts the run, checks on it and gives you the image when it's ready.

**What is EVF-SAM2 useful for?**

Use EVF-SAM2 to select a region in an existing image by describing it. The resulting mask can serve as the selection for a later edit, such as changing a product's color or replacing a background.

**How do I select one object when several look alike?**

Name the object and add a visible detail or location, such as 'the red cup beside the plate.' EVF-SAM supports spatial descriptions, so a relationship to another object can help distinguish your target.

**Which language should I use for EVF-SAM2 prompts?**

Use English. The official demo specifies English-only support, so translate other languages before submitting the target description.

**Can EVF-SAM2 select hair or a background region?**

Yes. Use semantic segmentation for body parts, background regions, or multiple objects, then describe the region you want.

**How do I exclude something from a selection?**

Describe the region to keep in the positive description and the unwanted region in the negative description. EVF-SAM2 subtracts the negative selection from the positive result.

