seedance-2-prompt — Seedance 2.0 video clip generator (dual backend)
Submits a Seedance 2.0 generation job and downloads the resulting MP4.
Two backends share one CLI, picked via with.provider:
with.provider |
Endpoint |
Auth env |
Default model |
openrouter (default) |
https://openrouter.ai/api/v1/videos |
OPENROUTER_API_KEY |
bytedance/seedance-2.0 |
volcengine (CN) |
https://ark.cn-beijing.volces.com/api/v3/contents/generations/tasks |
ARK_API_KEY (or VOLC_ARK_API_KEY) |
doubao-seedance-2-0-260128 |
byteplus (intl) |
https://ark.ap-southeast.bytepluses.com/api/v3/contents/generations/tasks |
ARK_API_KEY (or BYTEPLUS_API_KEY) |
dreamina-seedance-2-0-260128 |
Both flavours follow submit-then-poll, but differ in request shape
(OpenRouter uses a flat prompt field; ARK packs everything into a
content[] array), polling URL (OpenRouter returns polling_url; ARK
gets id and you construct /contents/generations/tasks/{id}), the
terminal-success status (completed vs succeeded), and where the
final MP4 URL sits (top-level unsigned_urls[0] vs content.video_url).
This script normalises both into a single Python contract.
Inputs (with:)
| key |
required |
default |
notes |
prompt |
yes |
— |
Structured English video prompt (use this skill's recipes). |
filename |
yes |
— |
Output .mp4 path. |
provider |
no |
openrouter |
openrouter, volcengine, or byteplus. |
aspect_ratio |
no |
9:16 |
9:16, 16:9, 1:1, 4:3, 3:4, 21:9. |
duration |
no |
5 |
Seconds, 3-15. OpenRouter Seedance accepts 4-15; a 3-second request generates a real 4-second provider clip and is trimmed locally to exactly 3 seconds. |
resolution |
no |
720p |
480p, 720p, 1080p. Ignored by OpenRouter. |
model |
no |
provider default |
Override model id. Empty means use provider default. |
input_image |
no |
"" |
Strict first-frame path. If set, video starts from this image. |
input_reference |
no |
"" |
Primary soft identity/style anchor path. Used only when input_image is empty. Same anchor passed across shots locks the character. |
input_reference_2 |
no |
"" |
Optional second reference (e.g. per-shot scene composition). Forwarded as a second --input-reference so the underlying provider sees both. Empty strings are filtered out before the API call. |
max_retries |
no |
0 |
Extra retries for transient polling HTTP 429/5xx or transport failures after a job id is issued, capped at 5; every retry stays on that same job. A paid POST submit is never retried automatically, including an ambiguous 429/5xx or transport failure, because the provider may already have accepted and billed it. HTTP 401/403/other 4xx, terminal policy failures, and invalid downloaded media also stop immediately. 0 = no extra polling retry. |
input_image vs input_reference — input_image becomes the literal
first frame. input_reference is a softer style + identity hint the
model uses without locking the frame. For multi-shot drama, pass the
same input_reference to every shot; pass input_image only when you
want a specific opening frame.
Prompt rules (from upstream + OpenSquilla tightening)
- One major action per 3-5s segment. Don't pack multiple motions.
- Identity continuity — repeat the main character's full
description in every shot's prompt.
- Specific over poetic —
"a young woman in a red trench coat walks through rain-soaked neon streets" >> "a woman walking".
- Negative constraints inline — append
no watermark, no logo, no subtitles, no on-screen text.
- IP-safe — invent original character/brand names.
- Aspect ratio explicit — append
aspect_ratio: 9:16.
See references/recipes.md, references/modes-and-recipes.md,
references/camera-and-styles.md for the upstream playbook.
Auth
openrouter provider API-key resolution order:
--api-key CLI argument
- The parent-injected atomic tuple
OPENSQUILLA_META_CAPABILITY_PROVIDER,
OPENSQUILLA_META_CAPABILITY_API_KEY, and
OPENSQUILLA_META_CAPABILITY_BASE_URL; optional
OPENSQUILLA_META_CAPABILITY_PROXY is used only for the matching
provider's authenticated API requests
OPENSQUILLA_META_OPENROUTER_API_KEY, retained for older parent runtimes
and bound to OpenRouter's official origin
OPENROUTER_API_KEY for direct CLI use, also bound to the official origin
- The generic parent key is accepted only with its matching provider and base
URL. Parent and canonical environment credentials allow same-origin path
changes through
--base-url, but never a scheme, hostname, or effective-port
change. Direct CLI users who intentionally select a different origin must
pass both --api-key and --base-url.
- The child never discovers or parses
opensquilla.toml from its workspace
and never honors a workspace-selected arbitrary llm.api_key_env. Configure
the active Gateway normally; its parent runtime performs that resolution.
- When a parent-resolved profile-pool credential receives an authentication,
credit, or rate-limit failure, OpenSquilla parks that key for the next
explicitly authorized run. It never repeats the current paid generation
automatically.
volcengine / byteplus provider reads ARK_API_KEY (with provider-
specific fallbacks VOLC_ARK_API_KEY / BYTEPLUS_API_KEY). No
config-file fallback for these — the OpenSquilla [llm] config
describes the agent's selected LLM provider, not ARK / BytePlus video
credentials.
- All three send the key as
Authorization: Bearer <key> only to an API URL
whose scheme, hostname, and effective port exactly match the configured
provider base. Authenticated redirects are not followed. A provider-supplied
cross-origin polling URL is ignored in favour of the canonical job URL under
the trusted base. A parent-injected proxy is used for these matching provider
API requests only and never for anonymous media downloads.
- Media downloads are always anonymous, including URLs hosted by OpenRouter.
Download URLs and every redirect must use HTTPS, contain no userinfo, and
resolve exclusively to public addresses; localhost, private, loopback,
link-local, reserved, unspecified, and multicast targets are rejected. Each
connection is pinned to the address that passed validation while retaining
the original TLS SNI/hostname, eliminating DNS-rebinding between validation
and connection.
Output
Prints the absolute path of the saved .mp4, then a
VIDEO_GENERATION_RECEIPT: {...} line on stdout. A matching sanitized
receipt is saved as <filename>.receipt.json; it records provider,
model, safe job id, and ffprobe verification metadata for both the
provider clip and final clip. Downloads first land in a private
same-directory candidate file. The script requires a real video stream,
positive duration, reasonable dimensions, and duration within tolerance;
3-second requests are probed both before and after the local trim. Only a
verified candidate is atomically published with os.replace, so an HTML
error page, truncated download, or failed trim cannot overwrite an existing
output. The receipt never contains the API key, prompt, raw provider response,
request/generation metadata, usage payload, or signed download URL. Logs omit
URL queries/fragments and raw provider messages. Non-zero exit on any error;
stderr carries a sanitized status/code summary when available.
On a recognized provider-policy rejection, the script stops immediately and
persists a failure sidecar instead of fabricating API success. That sidecar is
strictly limited to status=policy_rejected, provider/model,
reason=provider_policy_rejected, and the allowlisted policy_code; it never
contains raw provider text, signed URLs, request/job IDs, prompts, or secrets.
Meta workflows can then run their local fallback while preserving an honest,
user-visible degraded reason for the delivery audit.
Cost / latency
- OpenRouter
bytedance/seedance-2.0 5s @ 9:16 720p: ≈30-90s wall, ≈$0.76.
- Volcengine official 5s 1080p: ≈30-120s wall, ≈$0.93.
- Volcengine
doubao-seedance-2-0-fast-260128: roughly half cost and faster.
- The returned
unsigned_urls / content.video_url expire 24 hours
after success on the Volcengine path — this script downloads them
before that window so the local mp4 is durable.
Multi-segment workflows (>15s)
Generate segments individually with duration ≤ 15, ending each on a
stable hand-off frame. Stitch with the video-merger skill. See
references/modes-and-recipes.md § "Multi-Segment Stitching".
1---
2name: seedance-2-prompt
3visibility: internal
4invocation: meta_only
5owner_meta_skills:
6 - meta-short-drama
7description: "Render a single 3-15s video clip via Seedance 2.0. Supports two backends: OpenRouter (default, model bytedance/seedance-2.0) and the official Volcengine ARK / BytePlus ModelArk endpoint (model doubao-seedance-2-0-260128 / dreamina-seedance-2-0-260128). Accepts a structured English video prompt, optional first-frame image, and optional identity/style reference image. Trigger when the user asks for AI video clip generation, 分镜视频, seedance, or wants a short cinematic shot from a prompt + frame."
8description_zh: "通过Seedance 2.0渲染单个3-15秒视频片段。支持两种后端:OpenRouter(默认,模型 bytedance/seedance-2.0)和官方火山引擎ARK / BytePlus ModelArk端点(模型 doubao-seedance-2-0-260128 / dreamina-seedance-2-0-260128)。接受结构化英文视频提示词、可选首帧图像和可选身份/风格参考图。当用户需要AI视频片段生成、分镜视频、seedance,或想根据提示词+画面生成短电影镜头时触发。"
9provenance:
10 origin: clawhub-mit0
11 license: MIT-0
12 upstream_url: https://clawhub.ai/dandysuper/seedance-2-prompt-engineering-skill
13 upstream_version: "2.0.0"
14 maintained_by: OpenSquilla
15 modifications: "Added scripts/generate_video.py with dual-provider support: OpenRouter async /videos API and Volcengine ARK / BytePlus ModelArk /contents/generations/tasks. References kept from upstream."
16metadata:
17 opensquilla:
18 risk: medium
19 capabilities: [network-read, filesystem-write]
20 requires:
21 bins: ["ffmpeg", "ffprobe"]
22 anyBins: ["python", "python3"]
23 envAny: ["OPENROUTER_API_KEY", "ARK_API_KEY"]
24entrypoint:
25 command: python {baseDir}/scripts/generate_video.py
26 args:
27 - --prompt
28 - "{{ with.prompt }}"
29 - --filename
30 - "{{ with.filename }}"
31 - --provider
32 - "{{ with.provider | default('openrouter') }}"
33 - --aspect-ratio
34 - "{{ with.aspect_ratio | default('9:16') }}"
35 - --duration
36 - "{{ with.duration | default(5) }}"
37 - --resolution
38 - "{{ with.resolution | default('720p') }}"
39 - --model
40 - "{{ with.model | default('') }}"
41 - --input-image
42 - "{{ with.input_image | default('') }}"
43 - --input-reference
44 - "{{ with.input_reference | default('') }}"
45 - --input-reference
46 - "{{ with.input_reference_2 | default('') }}"
47 - --max-retries
48 - "{{ with.max_retries | default(0) }}"
49 parse: text
50 timeout: 1500
51---
52
53# seedance-2-prompt — Seedance 2.0 video clip generator (dual backend)
54
55Submits a Seedance 2.0 generation job and downloads the resulting MP4.
56Two backends share one CLI, picked via `with.provider`:
57
58| `with.provider` | Endpoint | Auth env | Default model |
59|---|---|---|---|
60| `openrouter` (default) | `https://openrouter.ai/api/v1/videos` | `OPENROUTER_API_KEY` | `bytedance/seedance-2.0` |
61| `volcengine` (CN) | `https://ark.cn-beijing.volces.com/api/v3/contents/generations/tasks` | `ARK_API_KEY` (or `VOLC_ARK_API_KEY`) | `doubao-seedance-2-0-260128` |
62| `byteplus` (intl) | `https://ark.ap-southeast.bytepluses.com/api/v3/contents/generations/tasks` | `ARK_API_KEY` (or `BYTEPLUS_API_KEY`) | `dreamina-seedance-2-0-260128` |
63
64Both flavours follow submit-then-poll, but differ in request shape
65(OpenRouter uses a flat `prompt` field; ARK packs everything into a
66`content[]` array), polling URL (OpenRouter returns `polling_url`; ARK
67gets `id` and you construct `/contents/generations/tasks/{id}`), the
68terminal-success status (`completed` vs `succeeded`), and where the
69final MP4 URL sits (top-level `unsigned_urls[0]` vs `content.video_url`).
70This script normalises both into a single Python contract.
71
72## Inputs (`with:`)
73
74| key | required | default | notes |
75|---|---|---|---|
76| `prompt` | yes | — | Structured English video prompt (use this skill's recipes). |
77| `filename` | yes | — | Output `.mp4` path. |
78| `provider` | no | `openrouter` | `openrouter`, `volcengine`, or `byteplus`. |
79| `aspect_ratio` | no | `9:16` | `9:16`, `16:9`, `1:1`, `4:3`, `3:4`, `21:9`. |
80| `duration` | no | `5` | Seconds, 3-15. OpenRouter Seedance accepts 4-15; a 3-second request generates a real 4-second provider clip and is trimmed locally to exactly 3 seconds. |
81| `resolution` | no | `720p` | `480p`, `720p`, `1080p`. Ignored by OpenRouter. |
82| `model` | no | provider default | Override model id. Empty means use provider default. |
83| `input_image` | no | `""` | Strict first-frame path. If set, video starts from this image. |
84| `input_reference` | no | `""` | Primary soft identity/style anchor path. Used only when `input_image` is empty. Same anchor passed across shots locks the character. |
85| `input_reference_2` | no | `""` | Optional second reference (e.g. per-shot scene composition). Forwarded as a second `--input-reference` so the underlying provider sees both. Empty strings are filtered out before the API call. |
86| `max_retries` | no | `0` | Extra retries for transient polling HTTP 429/5xx or transport failures after a job id is issued, capped at 5; every retry stays on that same job. A paid POST submit is never retried automatically, including an ambiguous 429/5xx or transport failure, because the provider may already have accepted and billed it. HTTP 401/403/other 4xx, terminal policy failures, and invalid downloaded media also stop immediately. `0` = no extra polling retry. |
87
88**`input_image` vs `input_reference`** — `input_image` becomes the literal
89first frame. `input_reference` is a softer style + identity hint the
90model uses without locking the frame. For multi-shot drama, pass the
91same `input_reference` to every shot; pass `input_image` only when you
92want a specific opening frame.
93
94## Prompt rules (from upstream + OpenSquilla tightening)
95
961. **One major action per 3-5s segment.** Don't pack multiple motions.
972. **Identity continuity** — repeat the main character's full
98 description in every shot's prompt.
993. **Specific over poetic** — `"a young woman in a red trench coat
100 walks through rain-soaked neon streets"` >> `"a woman walking"`.
1014. **Negative constraints inline** — append `no watermark, no logo,
102 no subtitles, no on-screen text.`
1035. **IP-safe** — invent original character/brand names.
1046. **Aspect ratio explicit** — append `aspect_ratio: 9:16`.
105
106See `references/recipes.md`, `references/modes-and-recipes.md`,
107`references/camera-and-styles.md` for the upstream playbook.
108
109## Auth
110
111- `openrouter` provider API-key resolution order:
112 1. `--api-key` CLI argument
113 2. The parent-injected atomic tuple
114 `OPENSQUILLA_META_CAPABILITY_PROVIDER`,
115 `OPENSQUILLA_META_CAPABILITY_API_KEY`, and
116 `OPENSQUILLA_META_CAPABILITY_BASE_URL`; optional
117 `OPENSQUILLA_META_CAPABILITY_PROXY` is used only for the matching
118 provider's authenticated API requests
119 3. `OPENSQUILLA_META_OPENROUTER_API_KEY`, retained for older parent runtimes
120 and bound to OpenRouter's official origin
121 4. `OPENROUTER_API_KEY` for direct CLI use, also bound to the official origin
122- The generic parent key is accepted only with its matching provider and base
123 URL. Parent and canonical environment credentials allow same-origin path
124 changes through `--base-url`, but never a scheme, hostname, or effective-port
125 change. Direct CLI users who intentionally select a different origin must
126 pass both `--api-key` and `--base-url`.
127- The child never discovers or parses `opensquilla.toml` from its workspace
128 and never honors a workspace-selected arbitrary `llm.api_key_env`. Configure
129 the active Gateway normally; its parent runtime performs that resolution.
130- When a parent-resolved profile-pool credential receives an authentication,
131 credit, or rate-limit failure, OpenSquilla parks that key for the next
132 explicitly authorized run. It never repeats the current paid generation
133 automatically.
134- `volcengine` / `byteplus` provider reads `ARK_API_KEY` (with provider-
135 specific fallbacks `VOLC_ARK_API_KEY` / `BYTEPLUS_API_KEY`). No
136 config-file fallback for these — the OpenSquilla `[llm]` config
137 describes the agent's selected LLM provider, not ARK / BytePlus video
138 credentials.
139- All three send the key as `Authorization: Bearer <key>` only to an API URL
140 whose scheme, hostname, and effective port exactly match the configured
141 provider base. Authenticated redirects are not followed. A provider-supplied
142 cross-origin polling URL is ignored in favour of the canonical job URL under
143 the trusted base. A parent-injected proxy is used for these matching provider
144 API requests only and never for anonymous media downloads.
145- Media downloads are always anonymous, including URLs hosted by OpenRouter.
146 Download URLs and every redirect must use HTTPS, contain no userinfo, and
147 resolve exclusively to public addresses; localhost, private, loopback,
148 link-local, reserved, unspecified, and multicast targets are rejected. Each
149 connection is pinned to the address that passed validation while retaining
150 the original TLS SNI/hostname, eliminating DNS-rebinding between validation
151 and connection.
152
153## Output
154
155Prints the absolute path of the saved `.mp4`, then a
156`VIDEO_GENERATION_RECEIPT: {...}` line on stdout. A matching sanitized
157receipt is saved as `<filename>.receipt.json`; it records provider,
158model, safe job id, and ffprobe verification metadata for both the
159provider clip and final clip. Downloads first land in a private
160same-directory candidate file. The script requires a real video stream,
161positive duration, reasonable dimensions, and duration within tolerance;
1623-second requests are probed both before and after the local trim. Only a
163verified candidate is atomically published with `os.replace`, so an HTML
164error page, truncated download, or failed trim cannot overwrite an existing
165output. The receipt never contains the API key, prompt, raw provider response,
166request/generation metadata, usage payload, or signed download URL. Logs omit
167URL queries/fragments and raw provider messages. Non-zero exit on any error;
168stderr carries a sanitized status/code summary when available.
169
170On a recognized provider-policy rejection, the script stops immediately and
171persists a failure sidecar instead of fabricating API success. That sidecar is
172strictly limited to `status=policy_rejected`, provider/model,
173`reason=provider_policy_rejected`, and the allowlisted `policy_code`; it never
174contains raw provider text, signed URLs, request/job IDs, prompts, or secrets.
175Meta workflows can then run their local fallback while preserving an honest,
176user-visible degraded reason for the delivery audit.
177
178## Cost / latency
179
180- OpenRouter `bytedance/seedance-2.0` 5s @ 9:16 720p: ≈30-90s wall, ≈$0.76.
181- Volcengine official 5s 1080p: ≈30-120s wall, ≈$0.93.
182- Volcengine `doubao-seedance-2-0-fast-260128`: roughly half cost and faster.
183- The returned `unsigned_urls` / `content.video_url` expire 24 hours
184 after success on the Volcengine path — this script downloads them
185 before that window so the local mp4 is durable.
186
187## Multi-segment workflows (>15s)
188
189Generate segments individually with `duration ≤ 15`, ending each on a
190stable hand-off frame. Stitch with the `video-merger` skill. See
191`references/modes-and-recipes.md` § "Multi-Segment Stitching".