Generate AI videos and images with Vidu (生数) via vidu-cli — text-to-image, text-to-video, image-to-video, start-end frame, reference-based generation, and material elements, up to 1080p/2K/4K.
All execution is done via the vidu-cli CLI tool. Parameters are CLI flags (not raw JSON bodies).
Environment variables
VIDU_TOKEN (required) — Vidu API tokenVIDU_BASE_URL (optional) — Default https://service.vidu.cn (mainland China); use https://service.vidu.com for overseasVIDU_DEBUG (optional) — Set to 1 to print full response body to stderr for debuggingStdout contract
{"ok": true, "trace_id": "...", ...} — exit code 0{"ok": false, "error": {"type": "...", "http_status": ..., "code": "...", "message": "..."}} — exit code 1trace_id appears on API-backed responses for support/debugging.error exactly. Full shapes and edge cases: references/parameters.md.Error type values
http_error — API 4xx/5xx (http_status, code, message)network_error — Connection failure or timeoutparse_error — Response is not valid JSONclient_error — Local issues (missing token, bad path, validation)Main commands
| Command | Purpose |
|---|---|
| --------- | --------- |
vidu-cli upload | Upload image → upload_id, ssupload_uri |
vidu-cli task submit --type ... --prompt ... [options] | Submit task → task_id. --image: local path, URL, or ssupload:?id=... (auto-upload). |
vidu-cli task get | Query task → state, media_urls when successful |
vidu-cli task sse | Stream SSE state events |
vidu-cli element create --name ... --image ... [--description ...] [--style ...] | Create reference element (check → preprocess → create). Returns id, version. |
vidu-cli element check --name ... | Check name availability |
vidu-cli element list [--keyword kw] | List personal elements |
vidu-cli element search --keyword kw | Search community elements |
Smart image handling (task submit --image, element create --image)
http(s): URL → download then uploadssupload:?id=... → use as-iselement createelement create (single command)element searchtask get / task ssecargo install vidu-cliVIDU_TOKEN (e.g. Vidu console).export VIDU_TOKEN="..." — required; export VIDU_BASE_URL=... if not using default region.vidu-cli task submit --helpContent you send (prompts, images, task settings) goes to Vidu’s API. Confirm this meets your privacy and IP needs. Prefer least-privilege tokens for testing. Terms: https://www.vidu.com/terms (overseas), https://www.vidu.cn/terms (mainland China).
task submit → task_id → poll task get until terminal state.3.0, Q2 → 3.1, Q3 → 3.2 (see references/parameters.md for per-task allowed versions).--type and options using references/parameters.md (matrix + validation).--image and/or --material so combined count is 1–7; optional [@name] in prompt per references/parameters.md.vidu-cli task submit ... → store task_id and trace_id.vidu-cli task get until success or failed (or use task sse if appropriate).media_urls; on task failure return err_code / err_msg; on CLI ok: false return error fields verbatim.task_id and trace_id; state that processing is in progress.state is success, return media_urls; if failed, return err_code and err_msg exactly (note: response may still have ok: true while state is failed).ok: false): report error.type, http_status, code, message exactly — do not infer causes.| File | Contents |
|---|---|
| ------ | ---------- |
| references/parameters.md | Task matrix, CLI flags, examples, prompt tips, validation |
| references/errors_and_retry.md | States, retries, polling |
If cargo / vidu-cli cannot be installed, this skill cannot run. Require vidu-cli ≥ 0.2.0 and point users to references/parameters.md for parameter details.
共 1 个版本