Edit images
curl --request POST \
--url https://inference.scrapist.bot/private/image_edit \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"requestId": "req_image_edit_01",
"prompt": "Change the red jacket to a blue hoodie. Keep the face and background unchanged.",
"images": [
"https://assets.example.com/posts/terminal-1.png"
]
}
'const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
requestId: 'req_image_edit_01',
prompt: 'Change the red jacket to a blue hoodie. Keep the face and background unchanged.',
images: ['https://assets.example.com/posts/terminal-1.png']
})
};
fetch('https://inference.scrapist.bot/private/image_edit', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));import requests
url = "https://inference.scrapist.bot/private/image_edit"
payload = {
"requestId": "req_image_edit_01",
"prompt": "Change the red jacket to a blue hoodie. Keep the face and background unchanged.",
"images": ["https://assets.example.com/posts/terminal-1.png"]
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text){
"requestId": "<string>",
"images": [
"<string>"
]
}{
"requestId": "req_image_edit_01",
"error": {
"code": "invalid_image",
"message": "an input image could not be loaded; send a public http(s) image URL or a base64 image data URL"
}
}{
"requestId": "<string>",
"error": {
"code": "invalid_message",
"message": "<string>"
}
}{
"requestId": "req_image_edit_01",
"error": {
"code": "image_edit_not_enabled",
"message": "image edits are not enabled for this API key"
}
}{
"requestId": "<string>",
"error": {
"code": "invalid_message",
"message": "<string>"
}
}{
"requestId": "<string>",
"error": {
"code": "invalid_message",
"message": "<string>"
}
}{
"requestId": "req_image_edit_01",
"error": {
"code": "image_edit_busy",
"message": "image editing is busy, retry shortly"
}
}Inference
Edit images
Edit up to three input images with a text prompt and receive one 512x512 JPEG. Without input images, the prompt is drawn on a blank white canvas. Image Edit has its own per-minute limit, separate from your RPM limit.
POST
/
private
/
image_edit
Edit images
curl --request POST \
--url https://inference.scrapist.bot/private/image_edit \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"requestId": "req_image_edit_01",
"prompt": "Change the red jacket to a blue hoodie. Keep the face and background unchanged.",
"images": [
"https://assets.example.com/posts/terminal-1.png"
]
}
'const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
requestId: 'req_image_edit_01',
prompt: 'Change the red jacket to a blue hoodie. Keep the face and background unchanged.',
images: ['https://assets.example.com/posts/terminal-1.png']
})
};
fetch('https://inference.scrapist.bot/private/image_edit', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));import requests
url = "https://inference.scrapist.bot/private/image_edit"
payload = {
"requestId": "req_image_edit_01",
"prompt": "Change the red jacket to a blue hoodie. Keep the face and background unchanged.",
"images": ["https://assets.example.com/posts/terminal-1.png"]
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text){
"requestId": "<string>",
"images": [
"<string>"
]
}{
"requestId": "req_image_edit_01",
"error": {
"code": "invalid_image",
"message": "an input image could not be loaded; send a public http(s) image URL or a base64 image data URL"
}
}{
"requestId": "<string>",
"error": {
"code": "invalid_message",
"message": "<string>"
}
}{
"requestId": "req_image_edit_01",
"error": {
"code": "image_edit_not_enabled",
"message": "image edits are not enabled for this API key"
}
}{
"requestId": "<string>",
"error": {
"code": "invalid_message",
"message": "<string>"
}
}{
"requestId": "<string>",
"error": {
"code": "invalid_message",
"message": "<string>"
}
}{
"requestId": "req_image_edit_01",
"error": {
"code": "image_edit_busy",
"message": "image editing is busy, retry shortly"
}
}Authorizations
BearerAuthApiKeyAuth
Your server-side Scrapist API key.
Body
application/json
Edit instructions. Leading and trailing whitespace is trimmed.
Required string length:
1 - 2000Optional correlation ID. Scrapist generates one when omitted.
Minimum string length:
1Up to three input images, each a public http(s) URL or a base64 data:image/...;base64, URL. Each image is fitted onto a 512x512 canvas. Omit to draw on a blank white canvas.
Maximum array length:
3Minimum string length:
1⌘I