⌘K

Spark Edit 3.0 I2I (Will be deprecated)

spark_edit_3_0_i2i

High-precision image-to-image editing with strong structure and subject preservation.

Authentication

authorization string required

All APIs require authentication via Bearer Token.

Get API Key:

Visit API Key Management Page to get your API Key.

Usage:

Add to request header:

Authorization: Bearer YOUR_API_KEY

Parameters

model string required

Model ID to use for the request

Value: spark_edit_3_0_i2i


prompt string required

Prompt for editing the image

Recommendations:

  • Recommended length 120 characters or less, maximum 800 characters. Prompts that are too long may cause abnormal output or not take effect
  • Use natural language for editing instructions
  • Single instruction per edit works better
  • For partial editing, describe precisely who to do what, especially when there are multiple entities in the image
  • If the editing effect is not obvious, adjust the scale value. Higher values follow instructions more closely
  • Use clear, high-resolution base images. Anime and images generated by Doubao model have better editing effects

Example instructions:

  • Add/Remove entity: Add/Remove xxx (Remove the girl from the image / Add a rainbow)
  • Modify entity: Change xxx to xxx (Change the drumstick in hand to a hamburger)
  • Modify style: Change to xxx style (Change to comic style)
  • Modify color: Change xxx to xx color (Change the clothes to pink)
  • Modify action: Modify expression/action (Make him cry/smile/angry)
  • Modify background: Change background to xxx (Change background to beach / Under the starry sky)

Default: "" (empty string)


image string required

Image file URL or Base64 encoding. This algorithm requires 1 input image


size string

Output image size, format like 1024x1024


seed integer

Random seed as the basis for determining the initial state of diffusion

If the random seed is the same positive integer and all other parameters are consistent, the generated image will have a very high probability of consistent results

Default: -1 (random)


scale number

Affects the degree of text description influence. Higher values mean greater text description influence and less input image influence

Range: 0 - 1

Default: 0.5



Polling

Since image generation takes time, you need to poll the task status after creation

The initial response returns the task ID and initial status. The actual generation results must be obtained through polling the task status endpoint

Response Format

error object

Error information. Only present when status is failed

code string

Error code

error_message string

Detailed error message


output array

Generation results. Only present when status is completed

content array

List of generated image content

type string

Resource type

Value: image

url string

Image URL

size integer

Image size (bytes)

b64_json string

Base64 encoded image data (only when response_format is b64_json)


usage object

Usage statistics. Only present when status is completed

input_tokens integer

Input tokens

output_tokens integer

Output tokens

total_tokens integer

Total tokens


metadata object

Metadata information


Error Codes

Error CodeDescription
3014001Missing model
3014002Missing prompt
3014003Missing image
3014004Invalid prompt length
3014005Invalid image format
3014006Invalid image size
3014007Invalid size parameter
3014008Invalid seed parameter
3014009Invalid guidance strength
3014010Invalid response format
3014095Internal generation error
3014096Result parsing error
3014097HTTP error response
3014098Status check error
3014099Task creation error / Service unavailable