# Photo Edit (free-text)

For AI agents: this is the Markdown version of https://docs.fashiolabs.com/tools/photo_edit.html. The index of all Fashio API docs is at https://docs.fashiolabs.com/llms.txt, and the complete reference in one file is at https://docs.fashiolabs.com/llms-full.txt.

Describe any change in plain English and it's applied to an existing photo — everything you didn't mention stays identical. The one tool where you aren't limited to a fixed set of controls.

`toolId: "photo_edit"` · 4 credits · single\_image\_edit · ratio: ignored — in-place edit

![Photo edit — free-text instruction applied to an existing photo](https://firebasestorage.googleapis.com/v0/b/fashio-ai-app.firebasestorage.app/o/admin%2Ftool_samples%2F746219bb-2dfd-4796-ae79-2f01cc2d9be3.jpeg?alt=media&token=55ace926-1bec-4963-8f33-64db027a5960)

## What it does

You supply a source photo and a plain-English instruction — e.g. "change the background to a beige studio wall" or "remove the necklace" — and Fashio applies exactly that change while preserving the original frame. Like Pose Variation or Model Swap, this is an in-place edit: the same subject, composition and everything else that wasn't called out in the instruction come through unchanged. There's no fixed menu of selectors here; the instruction text is the control surface.

## Request body

| Field | Type |  | Description |
| --- | --- | --- | --- |
| `toolId` | string | required | Always `"photo_edit"`. |
| `images.user_photo` | string | required | URL of the source photo to edit (from `POST /v1/uploads` or your own hosting). |
| `customPrompt` | string | required | Plain-English instruction describing the change to apply, e.g. `"change the background to a beige studio wall"` or `"remove the necklace"`. |

## Example request

**cURL**

```bash
curl -X POST https://api.fashiolabs.com/v1/generations \
  -H "Authorization: Bearer fio_live_YOUR_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "toolId": "photo_edit",
    "images": {
      "user_photo": "https://your-cdn.com/photo.jpg"
    },
    "customPrompt": "change the background to a beige studio wall"
  }'
```

**Node.js**

```javascript
const res = await fetch("https://api.fashiolabs.com/v1/generations", {
  method: "POST",
  headers: {
    Authorization: "Bearer " + process.env.FASHIO_API_KEY,
    "Content-Type": "application/json",
  },
  body: JSON.stringify({
    toolId: "photo_edit",
    images: {
      user_photo: "https://your-cdn.com/photo.jpg",
    },
    customPrompt: "change the background to a beige studio wall",
  }),
});
const { id } = await res.json();
```

**Python**

```python
import os, requests

res = requests.post(
    "https://api.fashiolabs.com/v1/generations",
    headers={"Authorization": f"Bearer {os.environ['FASHIO_API_KEY']}"},
    json={
        "toolId": "photo_edit",
        "images": {
            "user_photo": "https://your-cdn.com/photo.jpg",
        },
        "customPrompt": "change the background to a beige studio wall",
    },
)
job_id = res.json()["id"]
```

## Response

**202 Accepted**

```json
{ "success": true, "id": "8b1e...", "status": "processing" }
```

Poll `GET /v1/generations/:id` (see [Quickstart](https://docs.fashiolabs.com/quickstart.md)) until it completes:

**200 · completed**

```json
{
  "success": true,
  "id": "8b1e...",
  "status": "completed",
  "resultUrls": ["https://.../result.jpg"],
  "errorMessage": null
}
```

## Common errors

| Status | Meaning |
| --- | --- |
| 400 | `photo_edit: missing required image "user_photo"` — required image field wasn't resolvable. |
| 402 | `Insufficient diamonds. Required 4, have <n>.` |
| 429 | Daily request cap reached for this key — see [Rate Limits](https://docs.fashiolabs.com/rate-limits.md). |

## Related tools

- [Pose Variation](https://docs.fashiolabs.com/tools/pose_angle_switch.md) — same in-place editing model, applied to pose specifically.
- [Model Swap](https://docs.fashiolabs.com/tools/model_swap.md) — change who's wearing an existing photo instead.

---

Source: https://docs.fashiolabs.com/tools/photo_edit.html · OpenAPI spec: https://docs.fashiolabs.com/openapi.yaml · Docs index: https://docs.fashiolabs.com/llms.txt
