Agnes Video Skill
Generate videos with the Agnes Video 2.5 Flash model (agnes-video-2.5-flash).
Video generation is asynchronous: you create a task, then poll until it completes. The bundled helper script handles the full create → poll → return-URL loop so you don't have to hand-roll polling.
Three generation modes:
| mode | What it does | Required media |
| - | - | - |
| text | text-to-video | none |
| keyframe | control via first frame, last frame, or both | first_frame and/or last_frame |
| reference | generate from image and/or audio references | images and/or audios |
Flash limits (hard-enforced by the API)
These differ from the full agnes-video-2.5 model and return HTTP 400 if violated:
sizemust be the string"720P". Any other value →size must be 720P.referencemode:imagesmax 5,audiosmax 3.referencemode: novideosinput →videos is not supported.secondsis a string"4"–"12"(default"5").nis fixed at1.
The helper script enforces these before sending; a violation is reported locally with a clear message rather than as an API error.
Prerequisites
- API key. The script reads
AGNES_API_KEY. Check it first (do not print the full key):If missing, ask the user to set[ -n "$AGNES_API_KEY" ] && echo "key set (${AGNES_API_KEY:0:6}…)" || echo "key missing"AGNES_API_KEY(optionallyAGNES_BASE_URL, defaulthttps://api.agnes-ai.cn). Wait until they confirm. - Python 3 for the helper script.
- Public media URLs for keyframe/reference modes — the Agnes service must be able to fetch them.
Workflow
- Identify the mode.
text(no media),keyframe(one or both of first/last frame image URLs), orreference(image and/or audio URLs). - Write a strong prompt. Describe motion, camera, lighting, and subject clearly. For
referencemode, refer to media by position:<Picture 1>,<Picture 2>,<Audio 1>— these tokens tell the model which reference each part of the prompt points at. - Pick duration + aspect ratio.
secondsbetween"4"and"12".aspect_ratiofrom the table below; default16:9. - Run the helper. It creates the task, polls every ~2s, and prints the final video URL on completion.
- Present the result. Give the user the video URL. Warn that generation takes real wall-clock time (often tens of seconds to a few minutes for a 5–12s clip).
Using the helper script
scripts/generate_video.py runs the full async loop. Progress and diagnostics go to stderr; the final video URL goes to stdout.
Text-to-video:
python3 "$SKILL_DIR/scripts/generate_video.py" \
--prompt "雨后的未来城市街道,霓虹灯倒映在地面,一辆银色跑车缓慢驶过,电影级运镜,自然环境声" \
--mode text --seconds 5 --aspect-ratio 16:9
Keyframe (first + last frame):
python3 "$SKILL_DIR/scripts/generate_video.py" \
--prompt "人物从首帧姿态自然转身走向窗边,镜头缓慢推进并平滑过渡到尾帧" \
--mode keyframe --seconds 5 \
--first-frame "https://example.com/first.png" \
--last-frame "https://example.com/last.png"
Image reference:
python3 "$SKILL_DIR/scripts/generate_video.py" \
--prompt "以 <Picture 1> 中的角色和美术风格为参考,角色在花田中自然奔跑,保持外观一致" \
--mode reference --seconds 5 --aspect-ratio 16:9 \
--images "https://example.com/character.png"
Audio reference:
python3 "$SKILL_DIR/scripts/generate_video.py" \
--prompt "以 <Audio 1> 的节奏和环境氛围作为参考,生成电影感夜间驾驶画面" \
--mode reference --seconds 5 --aspect-ratio 16:9 \
--audios "https://example.com/reference-audio.mp3"
$SKILL_DIR is this skill's directory. Tuning flags: --poll-interval (default 2.0s), --max-wait (default 600s), --seed. For the raw API shape (manual create + poll), see references/api.md.
Writing good video prompts
Video prompts should specify motion and camera, not just a static scene. Cover:
- Subject + action — what moves, how, in which direction.
- Camera — push-in, pull-back, pan, tracking, handheld, static, orbit.
- Lighting + mood + environment — time of day, weather, atmosphere.
- Style — cinematic, documentary, anime, etc.
For reference mode, anchor references with <Picture N> / <Audio N> tokens that match the order you pass them in. Example:
以
<Picture 1>中的角色和美术风格为参考,角色在花田中自然奔跑,保持外观一致
If the user gives a terse request ("make a video of a cat"), enrich it into a motion-rich prompt before calling the API — add a camera move and an environment. Confirm direction only if the subject or style is genuinely ambiguous.
Aspect ratios (720P)
| aspect_ratio | Output pixels |
| - | - |
| 21:9 | 1680×720 |
| 16:9 | 1280×704 |
| 4:3 | 960×720 |
| 1:1 | 720×720 |
| 3:4 | 720×960 |
| 9:16 | 720×1280 |
size is always "720P"; the output dimension comes from aspect_ratio. (16:9 measured at 1280×704.)
Polling notes (if doing it by hand)
- Query with both
video_idandmodel_name=agnes-video-2.5-flash:GET https://api.agnes-ai.cn/agnesapi?video_id=<ID>&model_name=agnes-video-2.5-flash. This works for all modes and is the recommended form. - Querying with
video_idalone (nomodel_name) only works formode: "text"tasks. - Poll every 1–2s until
statusiscompletedorfailed. - Trust
statusandprogress, notinternal_status/internal_progress. Internal fields can still readpending/0when the task is actually done. Oncompleted, read the top-levelurlfield for the video.
Rules and gotchas
sizeis always"720P"(a string). Numeric sizes or"1080P"are rejected.secondsis a string, not a number:"5", not5.- Media URLs must be publicly fetchable and stay valid until the task completes.
- Don't pass
videosin reference mode — Flash rejects it. - Don't expose the API key in frontend code, logs, or public repos.
- For
keyframe, at least one offirst_frame/last_frameis required; you can supply both. - For
reference, at least one ofimages/audiosmust be non-empty; the two can be combined.
Full parameter tables, mode rules, error bodies, and raw curl for create + query live in references/api.md.

Scan to join WeChat group