Skip to content

Seededit API Examples

Seededit is an image editing model provided by BytePlus, supporting image editing and repainting based on reference images (i2i).

Basic Configuration

Before starting to use the API, please ensure you have obtained an API Key. If not, please refer to Create API Key.

Basic Information

  • API Base URL: https://api.agentsflare.com/byteplus/v3/images/edits
  • Authentication Method: Bearer Token
  • Content Type: application/json

Request Examples

bash
curl --location --request POST 'https://api.agentsflare.com/byteplus/v3/images/edits' \
    --header 'Content-Type: application/json' \
    --header 'Authorization: Bearer {API-KEY}' \
    --data-raw '{
        "model": "seededit-3-0-i2i-250628",
        "image": "https://example.com/source-image.jpg",
        "prompt": "Change the background to a starry sky, keep the subject unchanged",
        "size": "2K",
        "stream": true,
        "watermark": false
    }'
python
import requests
import json

url = "https://api.agentsflare.com/byteplus/v3/images/edits"

headers = {
    "Content-Type": "application/json",
    "Authorization": "Bearer {API-KEY}"
}

payload = {
    "model": "seededit-3-0-i2i-250628",
    "image": "https://example.com/source-image.jpg",
    "prompt": "Change the background to a starry sky, keep the subject unchanged",
    "size": "2K",
    "stream": True,
    "watermark": False
}

response = requests.post(url, headers=headers, json=payload)

if payload["stream"]:
    for line in response.iter_lines():
        if line:
            print(line.decode('utf-8'))
else:
    print(response.json())
javascript
const fetch = require('node-fetch');

const url = 'https://api.agentsflare.com/byteplus/v3/images/edits';

const payload = {
    model: 'seededit-3-0-i2i-250628',
    image: 'https://example.com/source-image.jpg',
    prompt: 'Change the background to a starry sky, keep the subject unchanged',
    size: '2K',
    stream: true,
    watermark: false
};

const options = {
    method: 'POST',
    headers: {
        'Content-Type': 'application/json',
        'Authorization': 'Bearer {API-KEY}'
    },
    body: JSON.stringify(payload)
};

fetch(url, options)
    .then(response => response.json())
    .then(data => console.log(data))
    .catch(error => console.error('Error:', error));

Response Example

The response contains the download URL of the edited image, which you can directly access to download.

event: image_generation.partial_succeeded
data: {"type":"image_generation.partial_succeeded","model":"seededit-3-0-i2i-250628","created":1768273118,"image_index":0,"url":"https://example.com/edited-image.jpg","size":"2848x1600"}

event: image_generation.completed
data: {"type":"image_generation.completed","model":"seededit-3-0-i2i-250628","created":1768273118,"usage":{"generated_images":1,"output_tokens":17800,"total_tokens":17800}}

data: [DONE]

Request Parameters

ParameterTypeRequiredDescription
modelstringYesModel name, e.g. seededit-3-0-i2i-250628
imagestringYesSource image URL
promptstringYesEditing prompt
sizestringNoOutput resolution, e.g. 2K
streambooleanNoWhether to stream response, default true
watermarkbooleanNoWhether to add watermark, default false

Supported Models

The following models are available through this interface (sorted by recommendation):

  • seededit-3-0-i2i-250628 New

💡 Tip

The model field in the request example can be replaced with any model name above.

This documentation is licensed under CC BY-SA 4.0.