fix(video): correct resolution/ratio flag descriptions

This commit is contained in:
若麒
2026-06-17 20:19:37 +08:00
parent 17c1f5f7b2
commit 0ceb15b0be
3 changed files with 11 additions and 23 deletions
+4 -16
View File
@@ -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:
@@ -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)",
@@ -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) {
@@ -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,
+2 -2
View File
@@ -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",
},
{
+5 -5
View File
@@ -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). |
@@ -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
@@ -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 |