YUYU_M6 Reference to Video
YUYU_M6 uses the character in your reference image as the lead and generates entirely new footage based on your prompt. You can choose a video length of 5 or 10 seconds, and pick one of 6 aspect ratios with aspect_ratio; if you don't set one, the video follows the reference image.
There are two ways to provide reference images. Use one or the other:
- One character, one image: put 1 image in
images. - Multiple people, multiple images of the same person (for example, different angles, or clothes you want them to wear), or you want to attach reference audio: use
peopleinstead, with up to 3 people and up to 3 images in total. See the "Multiple people, multiple images, and reference audio" section below.
POST /api/tasks/reference2video
X-Api-Key: sk-live-xxxx
Content-Type: application/json
Idempotency-Key: optional, see Reference to Video
Full example
images takes base64 data URIs and supports PNG, JPEG, and WebP. The actual base64 content is omitted in the example. duration can only be 5 or 10, and it is required. aspect_ratio is optional; the example sets it to portrait 3:4 (576×768). If you leave it out, the video follows the reference image:
curl -X POST https://yuyuvideo.com/api/tasks/reference2video \
-H "X-Api-Key: sk-live-xxxx" \
-H "Content-Type: application/json" \
-H "Idempotency-Key: order-20261001-00043" \
-d '{
"model": "YUYU_M6",
"prompt": "she walks along the beach at sunset, the wind gently blowing her hair, cinematic",
"images": ["data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAA..."],
"duration": 5,
"seed": 1234567,
"aspect_ratio": "3:4",
"payload": { "external_order_id": "order-20261001-00043" },
"callback_url": "https://example.com/webhooks/yuyu-video"
}'
On success, you get 201 Created with the task data. At this point the task is still queued and files is empty. credits is the number of credits charged for this request; the number in the example is for reference only:
{
"public_id": "01K6A1B2C3D4E5F6G7H8J9K0LN",
"type": 4,
"status": 0,
"credits": 10,
"params": {
"model": "YUYU_M6",
"prompt": "she walks along the beach at sunset, the wind gently blowing her hair, cinematic",
"images": ["data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAA..."],
"duration": 5,
"seed": 1234567,
"aspect_ratio": "3:4",
"prompt_enhance": false,
"payload": { "external_order_id": "order-20261001-00043" },
"callback_url": "https://example.com/webhooks/yuyu-video"
},
"error_code": null,
"error_message": null,
"created_at": "2026-10-01T08:00:00.000000Z",
"finished_at": null,
"files_expire_at": null,
"files_expired": false,
"files": []
}
To check progress and download the video next, see Query Tasks and Download Results.
Parameters
| Field | Type | Required | Description |
|---|---|---|---|
model |
string | Yes | Set to YUYU_M6 |
prompt |
string | Yes | Video description, up to 10000 characters |
images |
string[] | One of the two | Exactly 1 reference image; 0 or 2 or more returns 422. Base64 data URI (data:image/{png|jpeg|webp};base64,...). Send either this or people, not both |
people |
object[] | One of the two | 1–3 people, each with their own reference images, optional reference audio, name, and other data. See the next section. Send either this or images, not both |
duration |
integer | Yes | Video length in seconds. Only 5 or 10; it can't be omitted, and any other value returns 422. 10 seconds counts as 2 billing units and costs twice as many credits as 5 seconds |
seed |
integer | No | Random seed, 1–2147483647. If omitted, a random seed is used each time |
aspect_ratio |
string | No | Aspect ratio. The actual video size (width×height) is in parentheses: 9:16 (448×768, portrait), 16:9 (768×448, landscape), 1:1 (640×640), 3:4 (576×768), 4:3 (768×576), 2:3 (512×768). If omitted, the video follows the reference image; see "Video size" below |
prompt_enhance |
boolean | No | Prompt enhancement, default false. When set to true, the system first expands your prompt into a full description of shots, action, and sound before generating the video, which is especially useful when your prompt is short. Dialogue in quotation marks is kept word for word. Costs additional credits; the actual amount is the credits value in the response |
payload |
object | No | Custom data, such as your order number. The system never reads or modifies it, and returns it as-is when you query the task and in webhook notifications |
callback_url |
string | No | The URL to notify when the task finishes. Must start with https://, up to 2000 characters. See Callbacks (Webhook) |
YUYU_M6 doesn't support resolution or audio; sending either returns 422. The resolution is fixed at about 480p (longest side up to 768), and the price is the same for every aspect ratio.
Video size:
- With
aspect_ratio: the video uses the size in parentheses in the table above. The reference image is scaled proportionally until it just covers that size, then the excess is center-cropped; a reference image smaller than that size is enlarged first - Without it: the video follows the reference image. The reference image's longest side is scaled down to 768 or less (never scaled up), then the width and height are rounded down to multiples of 32. For example, a 1080×1920 reference image gives a 416×768 video. A small reference image gives a small video: for example, a 400×600 reference image gives a video of only 384×576, and faces tend to look blurry
- With
people: if you sendaspect_ratio, every reference image is cropped to the same size as described above; if you don't, the video follows the first image of the first person
If model is a model that doesn't exist, you get 422: Unknown model alias: {model}.
Parameters not listed in the table (except age_declared; see Pre-generation Age Check) return 422; they are not ignored.
Multiple people, multiple images, and reference audio (people)
people is an array of 1–3 people. The order is each person's number (starting from 1). For each person:
| Field | Type | Required | Description |
|---|---|---|---|
images |
string[] | Yes | Reference images for this person, at least 1. Up to 3 images in total across all people. Same format as the images parameter (data:image/{png|jpeg|webp};base64,...). You can provide several images of the same person, such as different angles or clothes you want them to wear, to get results closer to the reference |
audio |
string | No | Reference audio for this person, at most one clip per person. Base64 data URI; supports data:audio/wav, data:audio/x-wav, and data:audio/mpeg (MP3). Each clip must be 2–15 seconds, up to 15 seconds in total across all people. The length is as measured by the system when it receives the file |
name |
string | No | Name, up to 20 characters. People without a name are called P1, P2, P3 (P plus the person's position in people, regardless of language) |
gender |
string | No | Gender, up to 20 characters, such as female or male |
desc |
string | No | Appearance description, up to 60 characters, such as long hair, gray knit sweater |
name,gender, anddescmust be single-line text, with no line breaks or other control characters.name,gender, anddescare used only whenprompt_enhanceis on. When it's off, the prompt is sent as-is and these three fields are not used.- Images in
peoplealso go through the Pre-generation Age Check;age_declaredworks the same way. - Credits are calculated the same way as with
imagesand don't change with the number of people, images, or audio clips. The actual amount is thecreditsvalue in the response.
Referring to people in the prompt
With prompt_enhance on: write each person's name directly in the prompt. For people without a name, write P1, P2 (P is an uppercase English letter and must not touch other English letters or digits; for example, P1 hugs P2 works, and in a Chinese prompt P1跟P2擁抱 with no spaces also works).
{
"model": "YUYU_M6",
"prompt": "Mei and Ming stand in a cafe on a rainy day, and Mei smiles at the camera and says \"How do I look?\"",
"prompt_enhance": true,
"duration": 5,
"people": [
{
"name": "Mei",
"gender": "female",
"desc": "long hair, gray knit sweater",
"images": ["data:image/jpeg;base64,/9j/4AAQSkZJRgABAQ..."],
"audio": "data:audio/wav;base64,UklGRiQAAABXQVZF..."
},
{
"name": "Ming",
"gender": "male",
"images": ["data:image/jpeg;base64,/9j/4AAQSkZJRgABAQ..."]
}
]
}
With prompt_enhance off: the prompt is sent as-is. Use <Picture N> to refer to the Nth image and <Audio N> to refer to the Nth audio clip:
- Image numbering: count from 1, in
peopleorder and then in the order of each person'simages. For example, if person 1 has 2 images and person 2 has 1, person 2's image is<Picture 3>. - Audio numbering: in
peopleorder, counting only people who includeaudio.
Write the prompt in the six-section format described in the next section, "Writing prompts without prompt enhancement", and place <Picture N> and <Audio N> in the corresponding positions in the format. With prompt_enhance off, which person an image belongs to doesn't affect the result, only the numbering.
Writing prompts without prompt enhancement
When prompt_enhance is false or omitted, prompt is sent to generation as-is, and you can write it in the six-section format below. Write all six sections in English, and don't change the field names or their order; only dialogue, lyrics, and on-screen text stay in their original language. Don't turn on prompt_enhance when you use this format.
| Field | What to write |
|---|---|
subject_definitions |
Define the people, scenes, and objects from the reference images that you'll use |
summary |
Start with the task type (e.g. [reference generation]) and summarize the video in one paragraph |
retention_analysis |
One line per tag, stating its retention level |
detailed_description |
Describe the style in a sentence or two, then starting from [Shot 1], describe composition, people, lighting, action, camera, and sound |
overall_soundscape |
Ambient sound, action sounds, and non-verbal vocal sounds, 1–4 sentences |
non_diegetic_music |
Background music only the audience can hear, 1–3 sentences; write N/A if there is none |
Tags
| Tag | Description |
|---|---|
<Subject N> |
A person, scene, or object taken from the reference images and actually used in the video. Once defined, use the same name in every section, and don't redefine it in later shots |
<Picture 1> |
The image you sent in images; with people, <Picture N> is the Nth image (see the previous section for numbering). If an image only supplies a person, scene, clothing, or style, don't list it on its own line; include it in the corresponding <Subject N> definition |
<Audio N> |
The Nth reference audio clip sent with people (see the previous section for numbering) |
[Shot 1] |
The first shot, with no timestamp; write later shots as [Shot 2] At 00:03.000, … |
(S1) |
A speaker. Describe the voice the first time they appear (e.g. an adult woman with a soft, clear voice) |
<d>…</d> |
Dialogue. Inside, write the language first and then the original text: <d>[Chinese] 你來啦.</d>. End sentences with ASCII . ? ! |
Retention level (retention_analysis)
| Value | Description |
|---|---|
fully_preserved |
The defined content is fully preserved |
partially_preserved |
Still used, but some features change or only part is kept |
attribute_transfer |
Features are transferred to another recognizable subject |
weak_reference |
Only a rough similarity in style, category, composition, or mood is kept |
Full example
subject_definitions:
<Subject 1> is the woman in <Picture 1>, with long wavy light-gray hair and a gray sweatshirt.
<Subject 2> is the dim study corner in <Picture 1>, with a wooden desk, a desk lamp and a computer monitor.
summary:
[reference generation] <Subject 1> types at the desk in <Subject 2>, then turns to the camera, smiles and greets someone who has just arrived.
retention_analysis:
<Subject 1> (appears in [Shot 1]): fully_preserved - her face, hairstyle and gray sweatshirt match <Picture 1>.
<Subject 2> (appears in [Shot 1]): fully_preserved - the wooden desk, warm desk lamp and monitor match <Picture 1>.
detailed_description:
The target video is in a cinematic, realistic style with warm lamplight in a dark room.
[Shot 1] A medium close-up of <Subject 1> seated at the wooden desk in <Subject 2>, the desk lamp casting warm light across her face and hair. She types a few keys, then lifts her hands from the keyboard and turns her head toward the camera. The camera pushes in with small amplitude at slow speed as her expression softens into a smile. <Subject 1> (S1), an adult woman with a soft, clear voice at a relaxed pace, says, <d>[Chinese] 你來啦.</d> She keeps her gaze on the camera after speaking.
overall_soundscape: Soft keyboard clicks, then quiet room tone with the faint hum of the computer.
non_diegetic_music: N/A
Writing rules
- Don't introduce new tags in
summary; define all tags insubject_definitions. - Don't include speaker IDs such as
(S1)inretention_analysis. - Write the full dialogue only inside
<d>indetailed_description; don't repeat it in the two sound sections. - Don't condense
detailed_descriptioninto a plot summary. For every shot, describe composition, people, lighting, action, camera, and sound; typically about 350–500 English words, with dialogue taking priority when there's a lot of it.
Errors
| Status code | Cause | Response |
|---|---|---|
422 |
Invalid parameters, such as a missing required field, a wrong type, images not containing exactly 1 image, duration not 5 or 10, seed out of range, or aspect_ratio not one of the allowed values |
The errors field lists the reason for each field |
422 |
Both images and people are sent, or neither is |
errors.images or errors.people explains, e.g. Send either images or people, not both. |
422 |
people breaks the rules: more than 3 people, a person with no images, more than 3 images in total, or name/gender/desc too long or containing line breaks |
The error is attached to the corresponding field, e.g. errors["people.1.images"]; when the total number of images is exceeded, it's attached to errors.people: The people may not have more than 3 images in total. |
422 |
Reference audio breaks the rules: not WAV/MP3, length can't be measured, a clip not within 2–15 seconds, or more than 15 seconds in total | Problems with a single clip are attached to errors["people.N.audio"] (N starts at 0); exceeding the total is attached to errors.people |
422 |
people is temporarily unavailable |
{ "errors": { "people": ["The selected model does not support people."] } }. No task is created and no credits are charged. You can send 1 image in images instead |
422 |
prompt_enhance: true is set, but prompt enhancement is temporarily unavailable |
{ "message": "Prompt enhancement is temporarily unavailable", "errors": { "prompt_enhance": ["Prompt enhancement is temporarily unavailable"] } }. No task is created and no credits are charged. Change it to false or omit the parameter and send again |
422 |
model is a model that doesn't exist |
{ "message": "Unknown model alias: {model}" } |
402 |
Not enough credits | { "message": "Insufficient credits to complete this charge." } |
429 |
Too many Reference to Video tasks waiting in the queue | { "message": "Too many pending tasks of this type; please retry later." }. Use the Retry-After header in the response to decide when to retry |
For charging rules, see Credits and Billing.