Text to Subject
Text to Subject API
Description
The Text to Subject API generates reusable subject images from a name and description. Use name to define the subject's identity, description to describe its appearance, materials, clothing, features, and style, and use style and subject_type to control the generation direction. This endpoint is ideal for creating character, object, or brand IP assets first, then reusing them in endpoints such as the Elements to Video API.
Use Cases
- Create characters, products, props, or brand IP subjects from text.
- Prepare stable character or object references for the Elements to Video API.
- When no ready-made images are available, generate subject images first before moving on to the downstream creative workflow.
Endpoint Information
| Item | Description |
|---|---|
| Create task | POST /subject/text2image |
| Query task | GET /subject/text2image/{task_id} |
| Authentication | Bearer Token |
The full request URL consists of the base URL and the endpoint path; see API Basics.
Create Task
Request Parameters
| Parameter | Type | Required | Default | Description |
|---|---|---|---|---|
name | string | Yes | - | Subject name, length 1-50 characters |
description | string | Yes | - | Subject description, length 1-1000 characters |
style | string | No | realistic | Subject style. Allowed values: realistic, anime, cartoon, 3d, pixel |
subject_type | string | No | character | Subject type. Allowed values: character, object |
Constraints:
nameanddescriptionare required;styleandsubject_typeonly accept the enum values listed above.
Request Example
bash
Copycurl -X POST '<BASE_URL>/subject/text2image' \
-H 'Content-Type: application/json' \
-H 'Authorization: Bearer <API_TOKEN>' \
-d '{
"name": "Cyber Warrior",
"description": "A young warrior in silver futuristic armor with glowing blue circuit patterns, clean background, sharp details",
"style": "realistic",
"subject_type": "character"
}'
Success Response
json
Copy{
"code": 200,
"data": {
"task_id": "550e8400-e29b-41d4-a716-446655440000",
"created_at": 1778313600,
"status": "TASK_PENDING"
},
"timestamp": 1778313600
}
| Field | Type | Description |
|---|---|---|
task_id | string | Task ID, used to query the result |
created_at | number | Task creation time, Unix timestamp in seconds |
status | string | Task status; see Task Status |
Query Task
Path Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
task_id | string | Yes | Task ID returned by the create-task endpoint |
Request Example
bash
Copycurl -X GET '<BASE_URL>/subject/text2image/550e8400-e29b-41d4-a716-446655440000' \
-H 'Authorization: Bearer <API_TOKEN>'
Success Response
json
Copy{
"code": 200,
"data": {
"task_id": "550e8400-e29b-41d4-a716-446655440000",
"message": "TASK_SUCCEEDED",
"split_images": {
"top_left": "https://example.com/subject_top_left.jpg",
"top_right": "https://example.com/subject_top_right.jpg",
"bottom_left": "https://example.com/subject_bottom_left.jpg",
"bottom_right": "https://example.com/subject_bottom_right.jpg"
}
},
"timestamp": 1778313700
}
| Field | Type | Description |
|---|---|---|
task_id | string | Task ID |
message | string | Current task status; possible values: TASK_PROCESSING, TASK_SUCCEEDED, TASK_FAILED |
split_images | object | Returned on success; contains four subject images |
split_images.top_left | string | Top-left image URL |
split_images.top_right | string | Top-right image URL |
split_images.bottom_left | string | Bottom-left image URL |
split_images.bottom_right | string | Bottom-right image URL |
Notes
- We recommend that
descriptioncover the subject's appearance, colors, materials, clothing, pose, and key identifying features — avoid using only abstract keywords. - Text to Subject returns subject images that can be reused in the
subjectinput of the Elements to Video API. - The current query result returns the task status in the
messagefield; for detailed status semantics, see Task Status.
Related Documents
On this page