Document how Plotloom should call 火山方舟 Seedance through the official async task API. This is an adapter contract, not core product logic.
python3 - <<'PY'
import os
print('ARK_API_KEY exists:', bool(os.environ.get('ARK_API_KEY')))
PY
python3 - <<'PY'
from volcenginesdkarkruntime import Ark
print('ark sdk ok')
PYRequirements:
ARK_API_KEY- model access enabled in the account console
- account balance/resource package sufficient
volcengine-python-sdk[ark]installed
Never write ARK_API_KEY into repo, receipts, logs, or chat.
from volcenginesdkarkruntime import Ark
client = Ark(
base_url="https://ark.cn-beijing.volces.com/api/v3",
api_key=os.environ["ARK_API_KEY"],
)- Use Seedance-style continuous narrative prompts with timeline beats, camera path, dialogue window, and sound intent.
- Do not use HappyHorse-specific
character1labels by default. - Bind references through
content[]roles such asfirst_frameorreference_image, and reinforce the role in natural language. generate_audio=true/falseis a native parameter; prompt can describe sound/dialogue but adapter must pass the parameter explicitly.
Example provider prompt:
Use the first-frame image as the opening frame. Use the character reference image only for identity, outfit, and facial consistency.
A vertical 9:16 cinematic short-drama scene. 0-3s: the delivery man steps into a rainy luxury lobby...
Dialogue window: the heiress whispers, "You are the only heir."
Sound: rain outside, marble footsteps, tense low strings. No subtitles, no logo, no watermark.
res = client.content_generation.tasks.create(
model="doubao-seedance-2-0-260128",
content=[{"type": "text", "text": prompt}],
ratio="9:16",
resolution="720p",
duration=15,
generate_audio=True,
watermark=False,
return_last_frame=True,
)
task_id = res.idFor image/reference modes, add image_url items:
content = [
{"type": "text", "text": prompt},
{
"type": "image_url",
"image_url": {"url": "https://.../first-frame.png"},
"role": "first_frame", # or reference_image
},
]task = client.content_generation.tasks.get(task_id=task_id)Status values:
queued / running / succeeded / failed / expired / cancelled
On succeeded, download task.content.video_url immediately to candidates/vNNN.volcengine-seedance.mp4; VolcEngine video URLs are temporary.
- default Plotloom test:
9:16,720p,duration=15,watermark=False - Seedance 2.0 / fast duration: 4-15s or
-1 - ratio:
16:9,4:3,1:1,3:4,9:16,21:9,adaptive seedance2.0fastmay not support 1080p; start with 720p- image size: 300-6000px, <30MB, aspect ratio about
(0.4, 2.5) - request body limit: 64MB; prefer URL over base64 for large files
- Seedance 2.0 series does not support direct uploads of real-human face reference images/videos; use AI-generated/authorized/virtual character references
videoclaw has a blocking implementation at:
/Users/wangguiping/workspace/github/videoclaw/videoclaw/models/volcengine/seedance.py
Plotloom should reuse lessons but split it into async submit and poll/download.