Video Generation & Editing
Bailian CLI command reference for video generation, reference-to-video, and video editing.
A single command invokes Bailian's video generation and editing capabilities from the terminal.
ImportantAppend --help to any command for full parameter details, e.g. bl video generate --help. Parameters marked <url-or-path> also accept local paths — the CLI auto-uploads them to temporary storage (valid for 48 hours), so you never need to host files as URLs yourself. Command details for existing commands on this page are verified against bl 2.8.0; bl video retalk and bl video style are verified against bl 2.12.0.
Command reference
bl video generate
Generate a video from text or image (wan3.0-video / wan2.6-t2v / happyhorse-1.1-i2v). Requires API Key authentication.
Usage
bl video generate --prompt <text> [--image <url>] [flags]
| Parameter | Type | Required | Description |
|---|---|---|---|
--model <model> | string | no | Model ID (default: wan3.0-video) |
--prompt <text> | string | yes | Video description |
--image <url> | string | no | Input image URL for image-to-video generation |
--last-frame <url> | string | no | Last frame image URL (with --image, enables kf2v first+last frame mode) |
--negative-prompt <text> | string | no | Negative prompt to exclude unwanted content |
--resolution <res> | string | no | Resolution: 720P or 1080P (default: 1080P) |
--ratio <ratio> | string | no | Aspect ratio (e.g. 16:9, 9:16, 1:1) |
--duration <seconds> | number | no | Video duration in seconds (default: 5) |
--prompt-extend <bool> | boolean | no | Enable prompt extend (true/false). Omit flag to omit the parameter (DashScope default). |
--watermark <bool> | boolean | no | Enable watermark (true/false). Omit flag to use the Profile setting or CLI default (true). |
--seed <n> | number | no | Random seed for reproducible generation |
--download <path> | string | no | Save video to file on completion |
--file <url-or-path> | string | no | Reference file URL or local path for file-to-video (wan3.0-video only; mutually exclusive with --image/--last-frame) |
--prime | switch | no | Use Prime mode with a workspace-scoped endpoint |
--workspace-id <id> | string | no | Workspace ID for the default Prime endpoint (or set BAILIAN_WORKSPACE_ID) |
--async | switch | no | Return async task id without waiting |
--concurrent <n> | number | no | Run N parallel requests (default: 1) |
--poll-interval <seconds> | number | no | Polling interval when waiting (default: 5) |
Example: Generate a video from a text description
bl video generate --prompt "A person reading a book, static shot"
-
--model auto(or a config default model ofauto) routes AIGC models automatically through Bailian's self-developed MCP and uses only the parameters supported by the MCP tools. Incompatible parameters such as--seed,--watermark,--prime, and--asyncfail with a usage error instead of falling back to REST. -
Prime mode requires an explicit model.
-
Prime endpoint: configured --base-url, DASHSCOPE_BASE_URL, or profile base_url takes precedence; otherwise workspace is resolved from --workspace-id, BAILIAN_WORKSPACE_ID, then config workspace_id.
bl video ref
Reference-to-video generation (wan3.0-video / happyhorse-1.1-r2v / wan2.6-r2v): multi-subject, multi-shot with voice. Requires API Key authentication.
Usage
bl video ref --prompt <text> --image <url>... [--ref-video <url>...] [flags]
| Parameter | Type | Required | Description |
|---|---|---|---|
--model <model> | string | no | Model ID (default: wan3.0-video) |
--prompt <text> | string | yes | Video description with reference markers (image1, video1, etc.) |
--image <url> | array | no | Reference image URL or local file (repeatable for multiple subjects) |
--ref-video <url> | array | no | Reference video URL or local file (repeatable) |
--image-voice <url> | array | no | Voice URL for corresponding image (pairs by position). On wan3.0-video emitted as reference_audio (refer to Audio 1, Audio 2 in prompt) |
--video-voice <url> | array | no | Voice URL for corresponding ref-video (pairs by position). On wan3.0-video emitted as reference_audio (refer to Audio 1, Audio 2 in prompt) |
--resolution <res> | string | no | Resolution: 720P or 1080P (default: 1080P) |
--ratio <ratio> | string | no | Aspect ratio (16:9, 9:16, 1:1) |
--duration <seconds> | number | no | Video duration in seconds (default: 5) |
--prompt-extend <bool> | boolean | no | Enable prompt extend (true/false). Omit flag to omit the parameter (DashScope default). |
--watermark <bool> | boolean | no | Enable watermark (true/false). Omit flag to use the Profile setting or CLI default (true). |
--seed <n> | number | no | Random seed for reproducible generation |
--download <path> | string | no | Save video to file on completion |
--async | switch | no | Return async task id without waiting |
--concurrent <n> | number | no | Run N parallel requests (default: 1) |
--poll-interval <seconds> | number | no | Polling interval when waiting (default: 15) |
Example: Create a video using a reference image and description
bl video ref --prompt "Image1 running on the grass" --image person.jpg
bl video edit
Edit a video with happyhorse-1.0-video-edit (style transfer, object replacement, etc.). Requires API Key authentication.
Usage
bl video edit --video <url> --prompt <text> [flags]
| Parameter | Type | Required | Description |
|---|---|---|---|
--model <model> | string | no | Model ID (default: happyhorse-1.0-video-edit) |
--video <url> | string | yes | Input video URL or local file (mp4/mov, 2-10s) |
--prompt <text> | string | no | Edit instruction (e.g. "Convert the scene to a claymation style") |
--ref-image <url> | string | no | Reference image URL (up to 4, comma-separated) |
--negative-prompt <text> | string | no | Negative prompt to exclude unwanted content |
--resolution <res> | string | no | Resolution: 720P or 1080P (default: 1080P) |
--ratio <ratio> | string | no | Aspect ratio (16:9, 9:16, 1:1, 4:3, 3:4) |
--duration <seconds> | number | no | Output video duration in seconds (2-10) |
--audio-setting <mode> | string | no | Audio: auto (default) or origin (keep original) |
--prompt-extend <bool> | boolean | no | Enable prompt extend (true/false). Omit flag to omit the parameter (DashScope default). |
--watermark <bool> | boolean | no | Enable watermark (true/false). Omit flag to use the Profile setting or CLI default (true). |
--seed <n> | number | no | Random seed for reproducible generation |
--download <path> | string | no | Save video to file on completion |
--async | switch | no | Return async task id without waiting |
--concurrent <n> | number | no | Run N parallel requests (default: 1) |
--poll-interval <seconds> | number | no | Polling interval when waiting (default: 15) |
Example: Edit a video with style or object changes
bl video edit --video https://example.com/input.mp4 --prompt "Convert the entire scene to claymation style"
bl video retalk
Drive a talking-head video with audio (fixed model videoretalk, Beijing only). Requires API Key authentication.
Usage
bl video retalk --video <url-or-path> --audio <url-or-path> [flags]
| Parameter | Type | Required | Description |
|---|---|---|---|
--video <url-or-path> | string | yes | Input video URL or local file (mp4/avi/mov) |
--audio <url-or-path> | string | yes | Driving audio URL or local file (wav/mp3/aac) |
--ref-image <url-or-path> | string | no | Optional reference face image when the video has multiple people |
--video-extension <bool> | boolean | no | Extend the video by alternating reverse and forward playback when the audio is longer (default: false) |
--face-threshold <n> | number | no | Face match threshold 120-200 (default: 170; only with --ref-image) |
--download <path> | string | no | Save video to this file on completion (default: <output-dir>/videos/<task_id>.mp4) |
--async | switch | no | Return async task id without waiting |
--poll-interval <seconds> | number | no | Polling interval when waiting (default: 15) |
Example: Drive a talking-head video with audio
bl video retalk --video ./face.mp4 --audio ./speech.wav --download out.mp4
- Wait-mode polling timeout is at least 600 seconds;
--timeoutvalues below 600 are raised to 600.
bl video style
Restyle a video with eight presets (fixed model video-style-transform, Beijing only). Requires API Key authentication.
Usage
bl video style --video <url> [flags]
| Parameter | Type | Required | Description |
|---|---|---|---|
--video <url> | string | yes | Input video public URL (local paths not supported in v1) |
--style <n> | number | no | Style ID 0-7 (default: 0): 0 Japanese comic, 1 American comic, 2 fresh comic, 3 3D cartoon, 4 Chinese cartoon, 5 paper art, 6 simple illustration, 7 Chinese ink |
--fps <n> | number | no | Output video FPS 15-25 (default: 15) |
--animate-emotion <bool> | boolean | no | Animate facial emotion (server default: true) |
--min-len <n> | number | no | Short-side length 540 or 720 (server default: 720; 720P costs more than 540P) |
--super-resolution <bool> | boolean | no | Enable super-resolution (server default: false; with min-len 540, outputs 1080P billed as 540P) |
--download <path> | string | no | Save video to this file on completion (default: <output-dir>/videos/<task_id>.mp4) |
--async | switch | no | Return async task id without waiting |
--poll-interval <seconds> | number | no | Polling interval when waiting (default: 15) |
Example: Restyle a video with a preset
bl video style --video https://example.com/clip.mp4 --style 4 --download styled.mp4
- For prompt-based edits, use
bl video edit. - Wait-mode polling timeout is at least 600 seconds;
--timeoutvalues below 600 are raised to 600.
bl video download
Download a completed video by task ID. Requires API Key authentication.
Usage
bl video download --task-id <id> --out <path>
| Parameter | Type | Required | Description |
|---|---|---|---|
--task-id <id> | string | yes | Task ID to download from |
--out <path> | string | yes | Output file path |
Example: Download a video by task ID
bl video download --task-id 3b256896-xxxx --out video.mp4
bl video task get
Query async task status. Requires API Key authentication.
Usage
bl video task get --task-id <id>
| Parameter | Type | Required | Description |
|---|---|---|---|
--task-id <id> | string | yes | Async task ID |
Example: Check the status of an async video task
bl video task get --task-id 3b256896-3e70-xxxx-xxxx-xxxxxxxxxxxx