video segmentation · Object selection · Masking
VideoNew

Keep your selection moving

sam3_video_segment_fp16

Choose an object on one frame and keep its selection through the clip. Get a lossless mask with the source’s dimensions and timing.

One object. One video job. A mask aligned to the whole clip.

About

A character walks past your title. A hand moves in front of a product. The thing you selected keeps moving, and its mask needs to move with it. SAM 3.1 video selection follows one chosen object through an original clip and returns its mask as a lossless MP4.

Name the visible object, click it, or mark it with a box on any frame. Tracking runs in both directions from that frame. Negative points and boxes help separate the chosen instance from its neighbours.

The mask keeps the original width, height, frame count and frame rate. White marks the selected object; black marks everything else. Use it in your compositor or editor for occlusion, selective effects and moving selections.

Call sam3_video_segment_fp16 from the JavaScript or Python SDK, or use --segment-video in the Creative Agent CLI. Upload a constant-frame-rate SDR source up to 30 seconds, 900 frames, 2560 pixels on either edge and 100 MB.

Prompting tips

Choose what is visible on the selected frame.

  • Name the object — Use a short noun phrase such as "unicorn horn".
  • Choose the frame — frameIndex is a zero-based source-frame index. The selection is tracked in both directions from it.
  • Pick one instance — objectIndex chooses among matches ranked by score; zero is the strongest match. Use spatial prompts to distinguish lookalikes.

Use the mask in your edit

The highlighted horn is selected with text: "unicorn horn" on frame 127. Its mask follows the motion through the full clip.

Download the original lossless mask MP4 · Read the SDK and CLI guide

Pricing

Use pay-as-you-go Spark packs for each clip (1 Spark = $0.005), or choose a flat-rate Sogni plan for credit-free fair-use generation in the app.

Configuration Spark USD
1920 × 1080 · 120 frames · 24 fps (5 seconds) (approximate; request a live estimate) 5.24 Spark $0.026
1920 × 1080 · 255 frames · 24 fps (10.625 seconds) (approximate; request a live estimate) 10.3 Spark $0.052
1920 × 1080 · 720 frames · 24 fps (30 seconds) (approximate; request a live estimate) 27.9 Spark $0.14

Hard binary selection masks; fine hair and fur need a separate matting step.

SDR, square pixels and applied rotation are required. Text and points cannot be combined in one request.

One 1920 × 1080, 255-frame clip at 24 fps took 38.27 seconds end to end on an RTX 4090 in a single qualification run. Network and queue time vary.

API

One Sogni API key reaches every model on the Supernet — call SAM 3.1 Video with the exact model id.

import { readFileSync } from 'node:fs';
import { SogniClient, SAM3_VIDEO_SEGMENT_MODEL_ID } from '@sogni-ai/sogni-client';

const client = await SogniClient.createInstance({
  appId: 'video-selection-app',
  apiKey: process.env.SOGNI_API_KEY,
  network: 'fast'
});
const project = await client.projects.create({
  type: 'video', modelId: SAM3_VIDEO_SEGMENT_MODEL_ID,
  positivePrompt: '', numberOfMedia: 1,
  referenceVideo: readFileSync('clip.mp4'),
  sam3VideoPrompt: { text: 'unicorn horn', frameIndex: 127 }
});
console.log(await project.waitForCompletion());
client.disconnect();
# sam3_video_segment_fp16 is addressable by id via the JavaScript SDK (see the JavaScript tab).
# The REST workflow API routes this family through its flagship alias instead:

curl https://api.sogni.ai/v1/creative-agent/workflows \
  -H "Content-Type: application/json" \
  -H "Authorization: Bearer $SOGNI_API_KEY" \
  -d '{
    "input": {
      "title": "First render",
      "steps": [{
        "id": "step1",
        "toolName": "generate_video",
        "arguments": { "prompt": "a slothicorn surfing a wave of liquid paint, slow push-in, cinematic", "duration": 5 }
      }]
    },
    "confirm_cost": true
  }'

Use the JavaScript or Python SDK, or sogni-agent --segment-video clip.mp4 --segment-text "unicorn horn" --segment-frame 127 -o mask.mp4. Full reference at docs.sogni.ai.

Why run it on Sogni

Subscriptions or Spark

Use a flat monthly plan for credit-free fair-use generation, or buy Spark packs when pay-as-you-go fits better. Both run on the same creator-owned GPU network.

∞

Unlimited plans

One flat price in the app. Generate under fair use without a per-image meter.

🧩

200+ models

Image, video, music, and language models in one workspace and one API key.

⚡

Pay-as-you-go Spark

Prefer pay-as-you-go? Call SAM 3.1 Video by id and pay with Spark packs.

🌐

Powered by people

Runs on a decentralized GPU network where workers share subscription revenue.

FAQ

SAM 3.1 Video on Sogni

Does this produce a transparent cutout video?

It returns a hard black-and-white mask video. Use the mask with the original clip in an editor or compositor. It has no audio or alpha channel.

Can I select on a frame in the middle?

Yes. Set frameIndex to that source frame. Tracking runs forward and backward from the selected instance.

Does it change my video size or timing?

The mask has the original dimensions, frame count and frame rate. The server verifies the upload before charging. Explicit dimensions and timing must match it.

How is video selection priced?

By the source frame count and pixel area, with per-frame tracking work. Use a live estimate for the concrete source. The still-image SAM 3 workflow retains its separate flat image price.

Start with SAM 3.1 Video today

Build with the Sogni API, or use the Creative Agent Skill for agentic creation.