---
canonical_url: "https://docs.composio.dev/toolkits/photoroom"
markdown_url: "https://docs.composio.dev/toolkits/photoroom.md"
product: "platform"
version: null
last_updated: null
---

# PhotoRoom

PhotoRoom provides AI-powered APIs for removing backgrounds, editing and resizing product photos, generating images from prompts, and checking account credit usage.

- **Category:** images & design
- **Auth:** API_KEY
- **Composio-managed OAuth available?** N/A
- **Tools:** 4
- **Triggers:** 0
- **Slug:** `PHOTOROOM`
- **Version:** 00000000_00

## Tools

### Edit Image

**Slug:** `PHOTOROOM_EDIT_IMAGE`

Apply one or more combined PhotoRoom v2 edits to an image URL or uploaded file; sandbox output is watermarked, while live calls consume plan credits.

#### Input Parameters

| Parameter | Type | Required | Description |
|-----------|------|----------|-------------|
| `margin` | string | No | Uniform outer margin: a ratio from 0 to 0.49, a percentage from 0% to 49% such as 30%, or a pixel value such as 100px. |
| `padding` | string | No | Uniform padding around the subject: a ratio from 0 to 0.49, a percentage from 0% to 49% such as 30%, or a pixel value such as 100px. |
| `image_url` | string | No | Publicly reachable direct image URL. Provide exactly one of image_url or image_file. |
| `export_dpi` | number | No | Optional output pixel density from 72 to 1200 DPI. |
| `image_file` | object | No | Image file to upload. Provide exactly one of image_file or image_url. |
| `edit_prompt` | string | No | Describe an AI edit to apply through PhotoRoom's editWithAI operation. |
| `environment` | string ("sandbox" | "live") | Yes | Choose live for non-watermarked output that consumes plan credits, or sandbox for free watermarked output. |
| `output_size` | string | No | Output size: WIDTHxHEIGHT such as 128x128, auto, originalImage, or croppedSubject. |
| `shadow_mode` | string ("ai.soft" | "ai.hard" | "ai.floating" | "ai.preset-soft" | "ai.preset-hard" | "ai.auto-with-overrides") | No | Shadow generation mode to apply; omit to leave shadows unchanged. |
| `template_id` | string | No | PhotoRoom template UUID to apply as part of the v2 edit. |
| `upscale_mode` | string ("ai.fast" | "ai.slow") | No | Use ai.fast for speed or ai.slow for higher quality; omit to skip upscaling. |
| `export_format` | string ("png" | "jpeg" | "jpg" | "webp" | "avif") | No | Output image format. |
| `background_color` | string | No | Replace the background with a color name such as red or blue, or a hex value without # such as FF0000 or FF0000EE. Pass remove_background explicitly as false to instead only fill padding and transparent areas with this color. |
| `background_prompt` | string | No | Generate a replacement background from this text prompt. |
| `remove_background` | boolean | No | Remove the source image background as part of this edit. Setting any background replacement field implies this, since PhotoRoom only replaces a background it has removed. |
| `text_removal_mode` | string ("ai.artificial" | "ai.natural" | "ai.all") | No | Remove artificial text, natural text, or all text; omit to keep detected text. |
| `background_image_url` | string | No | Replace the background with an image from this public URL. |

#### Output

| Parameter | Type | Required | Description |
|-----------|------|----------|-------------|
| `data` | string | Yes | Data from the action execution |
| `error` | string | No | Error if any occurred during the execution of the action |
| `successful` | boolean | Yes | Whether or not the action execution was successful or not |

### Generate Image

**Slug:** `PHOTOROOM_GENERATE_IMAGE`

Generate a new image from a text prompt with PhotoRoom v2; sandbox output is watermarked, while live calls consume plan credits.

#### Input Parameters

| Parameter | Type | Required | Description |
|-----------|------|----------|-------------|
| `seed` | integer | No | Optional generation seed for reproducible output when supported. |
| `size` | string ("LANDSCAPE_16_9" | "LANDSCAPE_4_3" | "PORTRAIT_16_9" | "PORTRAIT_4_3" | "SQUARE_HD") | No | Requested generated-image size. |
| `prompt` | string | Yes | Text description of the image to generate. |
| `environment` | string ("sandbox" | "live") | Yes | Choose live for non-watermarked output that consumes plan credits, or sandbox for free watermarked output. |
| `export_format` | string ("png" | "jpeg" | "jpg" | "webp" | "avif") | No | Output image format. |
| `remove_background` | boolean | No | Remove the generated image background. Defaults to false so the scene described by the prompt is retained. |

#### Output

| Parameter | Type | Required | Description |
|-----------|------|----------|-------------|
| `data` | string | Yes | Data from the action execution |
| `error` | string | No | Error if any occurred during the execution of the action |
| `successful` | boolean | Yes | Whether or not the action execution was successful or not |

### Get Account Usage

**Slug:** `PHOTOROOM_GET_ACCOUNT_USAGE`

Return the connected live PhotoRoom account's reported plan and remaining image credits.

#### Output

| Parameter | Type | Required | Description |
|-----------|------|----------|-------------|
| `data` | string | Yes | Data from the action execution |
| `error` | string | No | Error if any occurred during the execution of the action |
| `successful` | boolean | Yes | Whether or not the action execution was successful or not |

### Remove Background

**Slug:** `PHOTOROOM_REMOVE_BACKGROUND`

Remove the background from one uploaded image with PhotoRoom's dedicated Basic API; sandbox output is watermarked, while live calls consume plan credits.

#### Input Parameters

| Parameter | Type | Required | Description |
|-----------|------|----------|-------------|
| `crop` | boolean | No | Crop the result around the detected foreground subject. |
| `size` | string ("preview" | "medium" | "hd" | "full") | No | Output resolution tier. |
| `format` | string ("png" | "jpg" | "webp") | No | Output image format. |
| `despill` | boolean | No | Reduce background color spill around foreground edges. |
| `channels` | string ("rgba" | "alpha") | No | Return the color image with transparency (rgba) or only the alpha mask (alpha). |
| `image_file` | object | Yes | Image file whose background will be removed. |
| `environment` | string ("sandbox" | "live") | Yes | Choose live for non-watermarked output that consumes plan credits, or sandbox for free watermarked output. |
| `background_color` | string | No | Optional output background color accepted by PhotoRoom instead of transparency. |

#### Output

| Parameter | Type | Required | Description |
|-----------|------|----------|-------------|
| `data` | string | Yes | Data from the action execution |
| `error` | string | No | Error if any occurred during the execution of the action |
| `successful` | boolean | Yes | Whether or not the action execution was successful or not |
