⌘K

Spark DreamO - Single IP

spark_dreamo

Spark DreamO - Single IP image-to-image model with character feature preservation. Intelligent image editing based on a single reference image, supports image generation and editing while maintaining character features. Suitable for portrait photography, character consistency generation and other scenarios.

API Tips

Input images must meet the following requirements:

Supported formats: JPEG, PNG only (JPEG format recommended)

File size: Maximum 4.7 MB

Image resolution: Maximum 4096 * 4096

Aspect ratio: Recommended range 16:9 to 9:16 (extreme aspect ratios may have poor results and may cause errors)

Subject requirement: Strongly recommend uploading single subject (supported types include realistic portraits, cartoon/anime characters, animals, and other objects). Multiple subjects significantly reduce quality and may cause errors


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_dreamo


prompt string required

Prompt for image editing, supports both Chinese and English

Recommended length around 300 characters. Prompts that are too long may not take effect and may cause errors


image_urls array required (one of two)

Image file URLs (must be publicly accessible). Requires exactly 1 input image

Either image_urls or binary_data_base64 must be provided (one of two)


binary_data_base64 array required (one of two)

Image files in Base64 encoding. Requires exactly 1 input image

Either image_urls or binary_data_base64 must be provided (one of two)


seed integer

Random seed as the basis for determining the initial diffusion state. If the random seed is the same positive integer and other parameters are consistent, the generated content will most likely have consistent results

Default: -1 (random)


use_rephraser boolean

Whether to rephrase the input text prompt to optimize results. It is recommended to keep this enabled under normal conditions

If the input text is very long, or you have a strong requirement not to change the prompt content, or you want to reduce processing time, you can disable this parameter

Default: true


width integer

Width of the generated image

Exceeding the upper limit requires ensuring width * height product is less than 2048 * 2048, and may cause abnormal results or timeout issues

Recommended ratios and corresponding dimensions (width * height):
1:1: 1328 * 1328
4:3: 1472 * 1104
3:2: 1584 * 1056
16:9: 1664 * 936
21:9: 2016 * 864

Range: 512-2048

Default: 1328


height integer

Height of the generated image

Exceeding the upper limit requires ensuring width * height product is less than 2048 * 2048, and may cause abnormal results or timeout issues

Range: 512-2048

Default: 1328


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 content

type string

Resource type

Value: image

url string

Content URL

size integer

Image size in bytes

jobId string

Job ID


usage object

Usage statistics. Only present when status is completed

cost string

Total cost in USD

discount number

Discount amount


metadata object

Metadata information


Error Codes

Error CodeDescription
003011001Missing prompt
003011002Missing image
003011003Invalid prompt length
003011004Invalid parameter
003011095Internal generation error
003011096Result parsing error
003011097HTTP error response
003011098Status check error
003011099Task creation error