segmentImage

Asynchronously segments an image, creating a mask of a specified area.

Return

a com.google.genai.types.SegmentImageResponse instance that contains the generated mask.

Parameters

model

the name of the GenAI model to use for image segmentation

source

a com.google.genai.types.SegmentImageSource An object containing the source inputs (prompt, image, scribbleImmage) for image segmentation. The prompt is required for prompt mode and semantic mode, disallowed for other modes. scribbleImage is required for the interactive mode, disallowed for other modes.

config

a com.google.genai.types.SegmentImageConfig instance that specifies the optional configurations