Single Image/First-Last Frame/Reference Frame/Intelligent Multi-Frame Video Generation VQ2P
/api/v1/video/generationHeader Parameters
Format: Authorization: Bearer sk-xxxxxx
Request Body
application/json
Fixed value i2v
Model name, supported: viduq2-pro
Resolution, supported: 540p / 720p / 1080p; default 720p for reference-to-video non-subject invocation mode; default 720p for reference-to-video subject invocation mode.
Random Seed
Whether to enable background music, default false. In the non-subject invocation mode for reference-to-video, the 9-second and 10-second durations do not take effect.
Image Information (supported only in single-image-to-video mode)
Image Link
Generated prompt text (for Smart Multi-frame Video Generation mode, use "placeholder text, just enter text as a placeholder (to be adjusted later)")
Video duration in seconds (not supported for intelligent multi-frame video generation). Single-image-to-video mode: [1,10]. First-and-last-frame-to-video mode: [1,8]. Reference-to-video non-subject invocation mode: [1,10]. Reference-to-video subject invocation mode: optional 0-10 (0 seconds for auto-recommendation).
Voice ID (supported only in single-image-to-video mode)
First and last frame image information (only supported in reference-to-video mode)
First Frame Image Information
Last Frame Image Information
Reference image information (supported only in reference-to-video non-subject invocation mode). Note: If no video is uploaded, 1-7 images are supported; if a video is uploaded, 1-4 images are supported.
Image Link
Video Information (Supported only in non-subject invocation mode for reference-based video generation) Note: Supports uploading 1 to 2 videos.
Video Link
Media Asset ID
Aspect ratio, default 16:9. Reference-to-video non-subject invocation mode: 16:9 / 9:16 / 3:4 / 4:3 / 1:1. Reference-to-video subject invocation mode supports: 16:9 / 9:16 / 1:1.
Reference subject information (supported only in reference-to-video subject invocation mode) Note: serverId mode: the ID returned by the subject API; video, text, and image subjects can be used, with a maximum of 4 image or text subjects and up to 2 video subjects.
Refer to the main image information
Image URL
Refer to the subject identifier information, which must be generated by calling the Create Subject API.
Identification information of the prompt, where @xxx is used in the prompt. When serverId is passed, the value of this parameter must be set to the elementName of the entity.
Reference subject voice, optional
Whether to enable audio (only supported in the reference-to-video subject invocation mode). false: Direct audio and video output is not required, outputting a silent video. true: Direct audio and video output is required, outputting a video with dialogue and background audio. Note 1: The voice_id parameter takes effect only when this parameter is set to true.
Motion amplitude, optional, defaults to auto (supported only in reference-to-video subject call mode): auto, small, medium, large
First frame image (used only in the intelligent multi-frame video generation mode, required. Note: Supports PNG, JPEG, JPG, and WEBP formats; image size must not exceed 50 MB; aspect ratio must be less than 1:4 or 4:1)
Image Link
Smart Multi-Frame Configuration (used only in Smart Multi-Frame Video Generation mode, required. Note: Minimum 2 frames and maximum 9 frames per task)
Keyframe image, serving as the last frame of this video segment or the first frame of the next segment
Image Link
Extension prompt used to control the extended video content, with a maximum length of 1500 characters.
Multi-frame duration, the video duration between different keyframes, defaults to 5 seconds, with options ranging from 2 to 7 seconds.
Metadata identifier, JSON-formatted string, pass-through field (supported only in intelligent multi-frame video generation mode, optional)
Callback URL (supported only in Smart Multi-Frame Video Generation mode, optional)
Pass-through parameters without any processing, for data transmission only, up to 1048576 characters (supported only in intelligent multi-frame video generation mode, optional)
Response Body
application/json
Success
TypeScript Definitions
Use the response body type in TypeScript.
Status Code
Data Object
Result Set
Usage Information
Image Count
Video Duration in Seconds
Input Token Count
Total Tokens
Output token count
Validity Period
Task ID
Task Status
Status Information
Request ID
curl -X POST "https://api.ygw.ai/api/v1/video/generation" \ -H "Authorization: string" \ -H "Content-Type: application/json" \ -d '{ "_action": "string", "model": "string", "image": { "imageUrl": "string" }, "prompt": "string", "headtailImages": { "headImage": "string", "tailmage": "string" }, "characterImages": [ { "imageUrl": "string" } ], "videos": [ { "videoUrl": "string", "mediaId": "string" } ], "subjects": [ { "images": [ { "imageUrl": "string" } ], "serverId": "string", "id": "string" } ], "startImage": { "imageUrl": "string" }, "imageSettings": [ { "keyImage": { "imageUrl": "string" } } ] }'{
"code": 0,
"data": {
"urls": [
"string"
],
"usage": {
"images": 0,
"seconds": 0,
"input_tokens": 0,
"total_tokens": 0,
"output_tokens": 0
},
"expired": "string",
"task_id": "string",
"task_status": "string"
},
"message": "string",
"request_id": "string"
}