⌘K

Spark Style Template

spark_style_template

Based on image-to-image technology, stylizes input images to generate high-quality images with artistic beauty for users

API Tips

Image Requirements

Image Format: Only supports JPG, JPEG, PNG formats. JPG format is recommended

Image File Size: Maximum 5 MB

Image Resolution: Minimum 600 * 800, maximum 4096 * 4096


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_style_template


req_key string required

Image stylization style key. Different styles use different req_key values

Options:
img2img_ghibli_style_usage: Influencer Anime Style
img2img_real_mix_style_usage: Realistic Style
img2img_makoto_style_usage: Angel Style
img2img_cartoon_style_usage: Anime Style
img2img_rev_animated_style_usage: Princess Style
img2img_blueline_style_usage: Dreamy Style
img2img_water_ink_style_usage: Ink Wash Style
i2i_ai_create_monet_usage: New Monet Garden
img2img_water_paint_style_usage: Watercolor Style
img2img_comic_style_usage: Monet Garden / Exquisite Marvel / Cyber Mechanical (use with sub_req_key)
img2img_exquisite_style_usage: Exquisite Korean Comic
img2img_pretty_style_usage: Chinese Ink Style / Romantic Light (use with sub_req_key)
img2img_ceramics_style_usage: Ceramic Doll
img2img_chinese_style_usage: Chinese Red
img2img_clay_style_usage: Cute Clay / Cute Doll (use with sub_req_key)
img2img_3d_style_usage: 3D Game Z-Era / Animation Movie / Doll (use with sub_req_key)


sub_req_key string

Sub-style key. Must match the selected req_key. Some styles require this parameter, some do not

Options:
img2img_comic_style_monet: Monet Garden
img2img_comic_style_marvel: Exquisite Marvel
img2img_comic_style_future: Cyber Mechanical
img2img_pretty_style_ink: Chinese Ink Style
img2img_pretty_style_light: Romantic Light
img2img_clay_style_3d: Cute Clay
img2img_clay_style_bubble: Cute Doll
img2img_3d_style_era: 3D Game Z-Era
img2img_3d_style_movie: Animation Movie
img2img_3d_style_doll: Doll


image_urls array required (one of two)

Image URL array. Only supports 1 image

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


binary_data_base64 array required (one of two)

Base64 encoded image array. Only supports 1 image

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


return_url boolean

Whether to return image URL (URL valid for 24 hours)


logo_info object

Watermark information

add_logo boolean

Whether to add watermark. true to add, false to not add

Default: false

position integer

Watermark position

0: Bottom right
1: Bottom left
2: Top left
3: Top right

Options: 0, 1, 2, 3

Default: 0

language integer

Watermark language

0: Chinese (AI生成)
1: English (Generated by AI)

Options: 0, 1

Default: 0

opacity number

Watermark opacity. 1 means completely opaque

Range: 0-1

Default: 1

logo_text_content string

Custom watermark text content


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

Image URL

size integer

Image size in bytes

jobId string

Remote 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
003008001Missing req_key
003008002Invalid req_key
003008003Invalid sub_req_key
003008004Missing image
003008005Invalid image count
003008095Internal generation error
003008096Result parsing error
003008097HTTP error response
003008098Status check error
003008099Task creation error / Service unavailable