Skip to content

Segment with SAM 2 Node

AI/ML/Vision

Predict image masks from foreground points, background points, a box or a previous mask

ml_prompt_sam2ml
Inputs2
Outputs2
Security exposureUnrated
Packageml

Ratings

Scores range from 0 to 10. Higher values mean more impact, exposure, or operational weight.

No score metadata has been set for this node yet.

Input Pins

2

Input

Execution
exec_in

Run this operation

Configuration

Struct
request

Inputs and configuration

PromptSam2RequestPromptSam2Request4 fields
source_idstringrequired
imagesTensorDatarequired

A CHW image or NCHW batch resized to 1024 and normalized with ImageNet mean and standard deviation.

shapeArray<integer:uint>required
itemsinteger:uintarray item
format uintmin 0
valuesArray<number:float>required
itemsnumber:floatarray item
format float
promptsArray<Sam2Prompt>required
itemsSam2Promptarray item
pointsArray<Sam2Point>
default []
itemsSam2Pointarray item
bboxarray | null

Pixel coordinates [left, top, right, bottom] in the resized image.

default null
itemsnumber:floatarray item
format float
maskanyOf (2)

Previous low-resolution mask logits with shape [1, 256, 256].

default null
variant 1TensorData2variant

Temporal inputs use [batch, time, channels]; images use [batch, channels, height, width]. Video adds time before channels: [batch, time, channels, height, width].

variant 2nullvariant
computeComputeConfig
default {"backend":"auto","device_index":0,"all...
backendComputeBackend
enum "cpu", "wgpu", "cuda", "rocm"...default "auto"
device_indexinteger:uint
format uintdefault 0min 0
allow_cpu_fallbackboolean
default true
memory_limit_bytesinteger:uint64
format uint64default 2147483648min 0
Schema enforced

Output Pins

2

Done

Execution
exec_out

Operation completed

Result

Struct
result

Operation result

Sam2PredictionSam2Prediction3 fields
mask_logitsTensorDatarequired

Temporal inputs use [batch, time, channels]; images use [batch, channels, height, width]. Video adds time before channels: [batch, time, channels, height, width].

shapeArray<integer:uint>required
itemsinteger:uintarray item
format uintmin 0
valuesArray<number:float>required
itemsnumber:floatarray item
format float
iouTensorDatarequired

Temporal inputs use [batch, time, channels]; images use [batch, channels, height, width]. Video adds time before channels: [batch, time, channels, height, width].

shapeArray<integer:uint>required
itemsinteger:uintarray item
format uintmin 0
valuesArray<number:float>required
itemsnumber:floatarray item
format float
object_score_logitsTensorDatarequired

Temporal inputs use [batch, time, channels]; images use [batch, channels, height, width]. Video adds time before channels: [batch, time, channels, height, width].

shapeArray<integer:uint>required
itemsinteger:uintarray item
format uintmin 0
valuesArray<number:float>required
itemsnumber:floatarray item
format float

Node Info

Internal name
ml_prompt_sam2
Category
AI/ML/Vision