Generation Tools
Reframe
Extends or re-crops an existing photo to a new aspect ratio — e.g. turning a square product shot into a 9:16 story crop or 16:9 banner — filling in new canvas content around the original subject rather than stretching or letterboxing it.
toolId: "photo_reframe"
2 credits
deterministic
targetRatio (default 1:1)
What it does
Reframe changes the canvas, not the subject: it fills in new content around the original photo so it fits a different aspect ratio, instead of stretching or letterboxing the existing pixels. Setting the target ratio is the entire purpose of this tool.
!
This tool uses a different field name than every other tool:
targetRatio, not
ratio. Sending ratio here by habit is silently ignored — the request will
succeed but default to 1:1 instead of the ratio you meant to request.Request body
| Field | Type | Description | |
|---|---|---|---|
toolId | string | required | Always "photo_reframe". |
images.user_photo | string | required | URL of the source photo to reframe (from POST /v1/uploads or your own hosting). |
targetRatio | string | optional | One of 1:1, 4:5, 3:4, 9:16, 16:9. Defaults to 1:1 — but set it, since it's the whole point of this tool. |
Example request
curl -X POST https://api.fashiolabs.com/v1/generations \
-H "Authorization: Bearer fio_live_YOUR_KEY" \
-H "Content-Type: application/json" \
-d '{
"toolId": "photo_reframe",
"images": {
"user_photo": "https://your-cdn.com/photo.jpg"
},
"targetRatio": "9:16"
}'
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_reframe",
images: {
user_photo: "https://your-cdn.com/photo.jpg",
},
targetRatio: "9:16",
}),
});
const { id } = await res.json();
import os, requests
res = requests.post(
"https://api.fashiolabs.com/v1/generations",
headers={"Authorization": f"Bearer {os.environ['FASHIO_API_KEY']}"},
json={
"toolId": "photo_reframe",
"images": {
"user_photo": "https://your-cdn.com/photo.jpg",
},
"targetRatio": "9:16",
},
)
job_id = res.json()["id"]
Response
202 Accepted
{ "success": true, "id": "8b1e...", "status": "processing" }Poll GET /v1/generations/:id (see Quickstart) until it completes:
200 · completed
{
"success": true,
"id": "8b1e...",
"status": "completed",
"resultUrls": ["https://.../result.jpg"],
"errorMessage": null
}Common errors
| Status | Meaning |
|---|---|
| 400 | photo_reframe: missing required image "user_photo" — required image field wasn't resolvable. |
| 402 | Insufficient diamonds. Required 2, have <n>. |
| 429 | Daily request cap reached for this key — see Rate Limits. |
Related tools
- Remove Background — another deterministic, no-prompt pass on an existing photo.
- Enhance / Upscale — resolution/clarity pass instead of a canvas change.