Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 4 additions & 16 deletions packages/cli/src/commands/video/generate.ts
Original file line number Diff line number Diff line change
Expand Up @@ -28,18 +28,6 @@ import {
BOOL_FLAG_WATERMARK,
} from "../../utils/flag-descriptions.ts";

// Normalize shorthand resolution (720P, 1080P) to pixel format for video generation models
const RESOLUTION_SHORTCUTS: Record<string, string> = {
"720p": "1280*720",
"1080p": "1920*1080",
"480p": "832*480",
};

function normalizeResolution(res: string | undefined): string | undefined {
if (!res) return undefined;
return RESOLUTION_SHORTCUTS[res.toLowerCase()] || res;
}

export default defineCommand({
name: "video generate",
description:
Expand All @@ -56,8 +44,8 @@ export default defineCommand({
flag: "--negative-prompt <text>",
description: "Negative prompt to exclude unwanted content",
},
{ flag: "--resolution <res>", description: "Resolution (e.g. 1280*720, 960*960)" },
{ flag: "--ratio <ratio>", description: "Aspect ratio (e.g. 16:9, 1:1)" },
{ flag: "--resolution <res>", description: "Resolution: 720P or 1080P (default: 1080P)" },
{ flag: "--ratio <ratio>", description: "Aspect ratio (e.g. 16:9, 9:16, 1:1)" },
{
flag: "--duration <seconds>",
description: "Video duration in seconds (default: 5)",
Expand Down Expand Up @@ -88,7 +76,7 @@ export default defineCommand({
'bl video generate --prompt "A person reading a book, static shot"',
'bl video generate --prompt "Ocean waves at sunset." --download sunset.mp4',
'bl video generate --image https://example.com/cat.png --prompt "Make the cat in the scene move"',
'bl video generate --prompt "Mountain landscape" --resolution 1280*720 --duration 5',
'bl video generate --prompt "Mountain landscape" --resolution 720P --duration 5',
'bl video generate --prompt "A cat playing with a ball" --watermark false',
],
async run(config: Config, flags: GlobalFlags) {
Expand Down Expand Up @@ -136,7 +124,7 @@ export default defineCommand({
: {}),
},
parameters: {
resolution: normalizeResolution(flags.resolution as string) || undefined,
resolution: (flags.resolution as string) || undefined,
ratio: (flags.ratio as string) || undefined,
duration: (flags.duration as number) || undefined,
prompt_extend: promptExtend,
Expand Down
4 changes: 2 additions & 2 deletions packages/cli/src/commands/video/ref.ts
Original file line number Diff line number Diff line change
Expand Up @@ -59,11 +59,11 @@ export default defineCommand({
description: "Voice URL for corresponding ref-video (pairs by position)",
type: "array",
},
{ flag: "--resolution <res>", description: "Resolution: 720P or 1080P (default: 720P)" },
{ flag: "--resolution <res>", description: "Resolution: 720P or 1080P (default: 1080P)" },
{ flag: "--ratio <ratio>", description: "Aspect ratio (16:9, 9:16, 1:1)" },
{
flag: "--duration <seconds>",
description: "Video duration in seconds (2-10, default: 5)",
description: "Video duration in seconds (default: 5)",
type: "number",
},
{
Expand Down
10 changes: 5 additions & 5 deletions skills/bailian-cli/reference/video.md
Original file line number Diff line number Diff line change
Expand Up @@ -105,8 +105,8 @@ bl video edit --video https://example.com/input.mp4 --prompt "Put clothes on the
| `--prompt <text>` | string | yes | Video description |
| `--image <url>` | string | no | Input image URL for image-to-video generation |
| `--negative-prompt <text>` | string | no | Negative prompt to exclude unwanted content |
| `--resolution <res>` | string | no | Resolution (e.g. 1280*720, 960*960) |
| `--ratio <ratio>` | string | no | Aspect ratio (e.g. 16:9, 1:1) |
| `--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>` | string | no | Enable prompt extend (true/false). Omit flag to omit the parameter (DashScope default). |
| `--watermark <bool>` | string | no | Enable watermark (true/false). Omit flag to use CLI default (true). |
Expand All @@ -131,7 +131,7 @@ bl video generate --image https://example.com/cat.png --prompt "Make the cat in
```

```bash
bl video generate --prompt "Mountain landscape" --resolution 1280*720 --duration 5
bl video generate --prompt "Mountain landscape" --resolution 720P --duration 5
```

```bash
Expand All @@ -156,9 +156,9 @@ bl video generate --prompt "A cat playing with a ball" --watermark false
| `--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) |
| `--video-voice <url>` | array | no | Voice URL for corresponding ref-video (pairs by position) |
| `--resolution <res>` | string | no | Resolution: 720P or 1080P (default: 720P) |
| `--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 (2-10, default: 5) |
| `--duration <seconds>` | number | no | Video duration in seconds (default: 5) |
| `--prompt-extend <bool>` | string | no | Enable prompt extend (true/false). Omit flag to omit the parameter (DashScope default). |
| `--watermark <bool>` | string | no | Enable watermark (true/false). Omit flag to use CLI default (true). |
| `--seed <n>` | number | no | Random seed for reproducible generation |
Expand Down