# GroundedSAM

## Try it in the Widget Center

Click this [url](https://app.myshell.ai/robot-workshop/widget/1781992144279887872) to try this widget and copy the Pro Config template.

## Usage

\<TODO: enter description here, and remove useless inputs>

**Input Parameters**

<table><thead><tr><th>Name</th><th>Type</th><th>Description</th><th>Default</th><th data-type="checkbox">Required</th></tr></thead><tbody><tr><td>image</td><td><code>string</code></td><td>HTTP url. Input image for Grounded SAM. We will create a mask for the image based on your text prompt.</td><td></td><td>true</td></tr><tr><td>mask_prompt</td><td><code>string</code></td><td>The text prompt for masking</td><td></td><td>true</td></tr><tr><td>negative_mask_prompt</td><td><code>string</code></td><td>The negative text prompt for masking (exclude something here)</td><td></td><td>false</td></tr><tr><td>adjustment_factor</td><td><code>integer</code></td><td>Mask Adjustment Factor</td><td>0</td><td>false</td></tr></tbody></table>

**Output Parameters**

| Name       | Type     | Description                                                                                                                                                       | File Type |
| ---------- | -------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------- |
| url\_image | `string` | Annotated image with mask bbox and text. The image that was generated has been saved as an online URL. This link is temporary, so please save it for your own use | `image`   |
| url\_mask  | `string` | The binary mask. The video that was generated has been saved as an online URL. This link is temporary, so please save it for your own use                         | `image`   |

**Output Example**

{% tabs %}
{% tab title="success" %}
{% code fullWidth="false" %}

```json
{ // input image = https://image.myshell.ai/image/chat/embed_obj/40295/20240423/1bfc157b73284d028e9217ce380c8363.png, mask_prompt = person, negative_mask_prompt = pants, adjustment_factor = 0
  "url_image": "https://image.myshell.ai/image/chat/embed_obj/40295/20240423/25431166f5d74e058832b0811c04806c.jpg",
  "url_mask": "https://image.myshell.ai/image/chat/embed_obj/40295/20240423/4dfc2764d4914460a2ffd8506b328b7d.jpg"
}
```

{% endcode %}
{% endtab %}

{% tab title="fail" %}
{% code fullWidth="false" %}

```json
{
   "results": "<the example results of this widget>"
}
```

{% endcode %}
{% endtab %}
{% endtabs %}


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.myshell.ai/create/pro-config-mode/api-reference/widgets/11-groundedsam.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
