---
title: "Tool Text To Seg"
method: POST
path: "/v1/tools/text-to-instance-segmentation"
tags: ["Tools"]
---

# Tool Text To Seg

`POST /v1/tools/text-to-instance-segmentation`

Performs text-to-instance segmentation to detect and segment objects based on
text descriptions.

Args:
    data (FormData): The form data containing the following fields:
        - prompt (str): Text description of objects to detect and segment.
        - model (TextToSegModel): The segmentation model to use.
            Currently supports florence2sam2.
        - image: Image file to analyze for segmentation.
        - video: Video file to analyze for temporal segmentation.
        - chunk_length_frames: Number of frames per chunk for video processing.
        - iou_threshold: IoU threshold for filtering detections.
            Range: 0.1-1.0.
        - nms_threshold: Non-maximum suppression threshold.
            Range: 0.1-1.0.
        - job_id (UUID, *optional*): Unique identifier for tracking the job.
    baseten_inference_sender:
        Dependency Injection for sending inference requests to the Baseten model
        server for text-to-segmentation processing.

Returns:
    TextToInstanceSegmentationResponse | JSONResponse
        Success: TextToInstanceSegmentationResponse containing segmented instances
        with masks.
        Error: JSONResponse with error details and appropriate status code.

## Query parameters

- `timeout` integer, nullable

## Response `200`

Successful Response

- TextToInstanceSegmentationResponse
  - `data` array[], nullable, required
    - union[]
      - union
        - Florence2SAM2IdInstance
          - `id` integer, required
          - `label` string, required
          - `mask` SegmentationBitMaskRLE, required
            - `counts` integer[], required
            - `size` integer[], required
          - `bounding_box` union[], required
            - union
              - …
        - InstanceSegmentationResponseData
          - `label` string, required
          - `score` number, required
          - `mask` SegmentationBitMaskRLE, required
            - `counts` integer[], required
            - `size` integer[], required
          - `bounding_box` union[], required
            - union
              - …

## Other responses

- `422` — Validation Error

## Changes

- **2026-02-13** `eeb4eb7952ab` — 1 info
  - endpoint added
- **2026-02-13** `62ce42134d4b` — 1 breaking
  - api path removed without deprecation
- **2026-02-13** `eeb4eb7952ab` — 1 info
  - endpoint added

[Change history](https://skmtc.dev/landing-ai/apis/ade-api/changes/v1/tools/text-to-instance-segmentation/post.md)

---

[API](https://skmtc.dev/landing-ai/apis/ade-api.md) · [All operations](https://skmtc.dev/landing-ai/apis/ade-api/llms.txt) · [OpenAPI document](https://skmtc-service-production.skmtc.workers.dev/v1/apis/landing-ai/ade-api/revisions/eeb4eb7952ab/schema)
