ai-video-gen
calesthio/OpenMontage · Agent Skill
從文字提示生成 AI 影片,支援多個提供者和 API 進行內容創作,包括從影象生成影片。
前往安裝 ↓總覽
| 發布者 | |
|---|---|
| 儲存庫 | calesthio/OpenMontage ↗ |
| 技能資料夾 | ai-video-gen |
| 星 | 58,214 |
| 分支 | 7,332 |
| 附帶檔案 | 1 |
| 授權 | AGPL-3.0 |
| 最近更新 | 2026年9月6日 |
| 連結 | 技能原始碼 ↗ · 儲存庫 ↗ |
Mozgi 檢查
我們在技能檔案中發現的內容。詳細資訊需訂閱。
安裝
技能就是一個含 SKILL.md 的資料夾。選擇你的代理,在專案根目錄的終端機(macOS、Linux 或 Windows 的 Git Bash)執行指令。
把提示貼到 Claude、Codex 或其他助理:它會自行檢查並安裝技能。
Install the “ai-video-gen” skill from mozgi.io (https://mozgi.io/skills/ai-video-gen/) for me. 1. Download the archive: https://mozgi.io/skills/ai-video-gen/download If it fails, take the skill folder from the source: https://github.com/calesthio/OpenMontage/tree/main/.agents/skills/ai-video-gen 2. Read SKILL.md and the other files. Check the skill is safe: no hidden commands, no sending data elsewhere, no scripts doing something other than described. If anything looks suspicious, stop and tell me. 3. Put the “ai-video-gen” folder into your agent's skills folder: .claude/skills/ for Claude Code, .agents/skills/ for Codex, .cursor/skills/ for Cursor, .gemini/skills/ for Gemini CLI. Inside the project if we are in one, otherwise in the home folder (~/.claude/skills/ etc.). 4. Make sure <skills folder>/ai-video-gen/SKILL.md exists. 5. Briefly tell me what this skill does and offer to try it on my task. If you cannot do a step yourself, tell me what to click or type.
git clone --depth 1 --branch main https://github.com/calesthio/OpenMontage.git /tmp/OpenMontage mkdir -p .claude/skills cp -r /tmp/OpenMontage/.agents/skills/ai-video-gen .claude/skills/ai-video-gen
重新啟動 Claude Code — 技能就會出現在清單中,手動呼叫:/ai-video-gen。要套用到所有專案,請放在 ~/.claude/skills。
git clone --depth 1 --branch main https://github.com/calesthio/OpenMontage.git /tmp/OpenMontage mkdir -p .agents/skills cp -r /tmp/OpenMontage/.agents/skills/ai-video-gen .agents/skills/ai-video-gen
Codex 會從目前資料夾往上到儲存庫根目錄,在 .agents/skills 中尋找技能;用 /skills 或 $ai-video-gen 呼叫。所有專案:~/.agents/skills。
git clone --depth 1 --branch main https://github.com/calesthio/OpenMontage.git /tmp/OpenMontage mkdir -p .cursor/skills cp -r /tmp/OpenMontage/.agents/skills/ai-video-gen .cursor/skills/ai-video-gen
Cursor 啟動時會載入技能;在 Agent 聊天輸入「/」呼叫。Cursor 也會讀取 .claude/skills 與 .agents/skills。所有專案:~/.cursor/skills。
git clone --depth 1 --branch main https://github.com/calesthio/OpenMontage.git /tmp/OpenMontage mkdir -p .gemini/skills cp -r /tmp/OpenMontage/.agents/skills/ai-video-gen .gemini/skills/ai-video-gen
任務符合時,Gemini CLI 會提議啟用技能,由你確認。所有專案:~/.gemini/skills。
安裝前請先檢視 SKILL.md 與相關檔案。點擊檔案即可預覽。
SKILL.md 內容
作者原文 · 唯讀Video Generation (Multi-Gateway)
Generate AI videos from text prompts. Supports multiple providers via four API paths:
| Gateway | Env Variable | Providers | Tool |
|---------|-------------|-----------|------|
| fal.ai | FAL_KEY | Seedance 2.0 (standard + fast), Kling v3/v2.1, MiniMax, VEO | seedance_video, kling_video, minimax_video, veo_video |
| HeyGen | HEYGEN_API_KEY | VEO 3.1, Kling Pro, Sora v2, Runway Gen-4, Seedance Pro / Lite (1.x) | heygen_video |
| Kling Official | KLING_API_KEY | Kling official Classic, Turbo, and basic Omni video | kling_official_video |
| Gemini API | GEMINI_API_KEY / GOOGLE_API_KEY | Gemini Omni Flash (generation + conversational editing) | gemini_omni_video |
Iterative editing — Gemini Omni. When the brief calls for *refining an existing clip* (add/remove objects, restyle, change lighting or on-screen text) rather than regenerating, Gemini Omni Flash is the only provider in the fleet with stateful multi-turn editing. See Layer 3 gemini-omni for the authoritative prompting guide (reference-image tags, timecode syntax, edit-prompt rules) before writing any prompt for it.
Preferred premium default — Seedance 2.0. When any premium gateway is configured (FAL_KEY → seedance_video, or HeyGen's Video Agent / Avatar Shots path), Seedance 2.0 is the preferred default for cinematic, trailer, and high-fidelity clip work. It is the only model in the fleet with single-pass native synchronized audio, multi-shot generation, director-level camera control, and lip-sync from quoted dialogue, and it ranks #1 on Artificial Analysis Elo as of early 2026. Switch off it only when the user has a specific reason (budget, provider preference, stylistic fit like VEO for photoreal landscape or Kling for specific anime look). See Layer 3 seedance-2-0 for the authoritative prompting and parameter guide.
IMPORTANT: Always use video_selector instead of calling provider tools directly. The selector handles availability checks, cost comparison, and automatic fallback, and its scoring engine already biases toward Seedance 2.0 for cinematic intent.
Authentication
Use whichever configured gateway best matches the user's available providers and cost/quality goals.
- HeyGen: Set
HEYGEN_API_KEYto access the multi-model gateway. - fal.ai: Set
FAL_KEYto access Kling, MiniMax, and Veo through fal.ai. - Kling Official: Set
KLING_API_KEYto access Kling's official direct API viaprovider="kling_official". - Gemini API: Set
GEMINI_API_KEYorGOOGLE_API_KEYto access Gemini Omni video generation and conversational editing.
Do not describe any gateway as the default or top choice without checking the registry and current task fit first.
fal.ai Kling (kling_video, provider="kling") and Kling Official (kling_official_video, provider="kling_official") are different paths. Do not reuse fal.ai queue URLs, FAL_KEY, or image upload behavior when the official provider is selected.
curl -X POST "https://api.heygen.com/v1/workflows/executions" \
-H "X-Api-Key: $HEYGEN_API_KEY" \
-H "Content-Type: application/json" \
-d '{"workflow_type": "GenerateVideoNode", "input": {"prompt": "A drone shot flying over a coastal city at sunset"}}'
Default Workflow
1. Call POST /v1/workflows/executions with workflow_type: "GenerateVideoNode" and your prompt
2. Receive a execution_id in the response
3. Poll GET /v1/workflows/executions/{id} every 10 seconds until status is completed
4. Use the returned video_url from the output
Execute Video Generation
Endpoint
POST https://api.heygen.com/v1/workflows/executions
Request Fields
| Field | Type | Req | Description |
|-------|------|:---:|-------------|
| workflow_type | string | Y | Must be "GenerateVideoNode" |
| input.prompt | string | Y | Text description of the video to generate |
| input.provider | string | | Video generation provider (default: "veo_3_1"). See Providers below. |
| input.aspect_ratio | string | | Aspect ratio (default: "16:9"). Common values: "16:9", "9:16", "1:1" |
| input.reference_image_url | string | | Reference image URL for image-to-video generation |
| input.tail_image_url | string | | Tail image URL for last-frame guidance |
| input.config | object | | Provider-specific configuration overrides |
Providers
| Provider | Value | Description |
|----------|-------|-------------|
| VEO 3.1 | "veo_3_1" | Google VEO 3.1 (default, highest quality) |
| VEO 3.1 Fast | "veo_3_1_fast" | Faster VEO 3.1 variant |
| VEO 3 | "veo3" | Google VEO 3 |
| VEO 3 Fast | "veo3_fast" | Faster VEO 3 variant |
| VEO 2 | "veo2" | Google VEO 2 |
| Kling Pro | "kling_pro" | Kling Pro model |
| Kling V2 | "kling_v2" | Kling V2 model |
| Sora V2 | "sora_v2" | OpenAI Sora V2 |
| Sora V2 Pro | "sora_v2_pro" | OpenAI Sora V2 Pro |
| Runway Gen-4 | "runway_gen4" | Runway Gen-4 |
| Seedance Lite | "seedance_lite" | Seedance Lite |
| Seedance Pro | "seedance_pro" | Seedance Pro |
| LTX Distilled | "ltx_distilled" | LTX Distilled (fastest) |
curl
curl -X POST "https://api.heygen.com/v1/workflows/executions" \
-H "X-Api-Key: $HEYGEN_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"workflow_type": "GenerateVideoNode",
"input": {
"prompt": "A drone shot flying over a coastal city at golden hour, cinematic lighting",
"provider": "veo_3_1",
"aspect_ratio": "16:9"
}
}'
TypeScript
interface GenerateVideoInput {
prompt: string;
provider?: string;
aspect_ratio?: string;
reference_image_url?: string;
tail_image_url?: string;
config?: Record<string, any>;
}
interface ExecuteResponse {
data: {
execution_id: string;
status: "submitted";
};
}
async function generateVideo(input: GenerateVideoInput): Promise<string> {
const response = await fetch("https://api.heygen.com/v1/workflows/executions", {
method: "POST",
headers: {
"X-Api-Key": process.env.HEYGEN_API_KEY!,
"Content-Type": "application/json",
},
body: JSON.stringify({
workflow_type: "GenerateVideoNode",
input,
}),
});
const json: ExecuteResponse = await response.json();
return json.data.execution_id;
}
Python
import requests
import os
def generate_video(
prompt: str,
provider: str = "veo_3_1",
aspect_ratio: str = "16:9",
reference_image_url: str | None = None,
tail_image_url: str | None = None,
) -> str:
payload = {
"workflow_type": "GenerateVideoNode",
"input": {
"prompt": prompt,
"provider": provider,
"aspect_ratio": aspect_ratio,
},
}
if reference_image_url:
payload["input"]["reference_image_url"] = reference_image_url
if tail_image_url:
payload["input"]["tail_image_url"] = tail_image_url
response = requests.post(
"https://api.heygen.com/v1/workflows/executions",
headers={
"X-Api-Key": os.environ["HEYGEN_API_KEY"],
"Content-Type": "application/json",
},
json=payload,
)
data = response.json()
return data["data"]["execution_id"]
Response Format
{
"data": {
"execution_id": "node-gw-v1d2e3o4",
"status": "submitted"
}
}
Check Status
Endpoint
GET https://api.heygen.com/v1/workflows/executions/{execution_id}
curl
curl -X GET "https://api.heygen.com/v1/workflows/executions/node-gw-v1d2e3o4" \
-H "X-Api-Key: $HEYGEN_API_KEY"
Response Format (Completed)
{
"data": {
"execution_id": "node-gw-v1d2e3o4",
"status": "completed",
"output": {
"video": {
"video_url": "https://resource.heygen.ai/generated/video.mp4",
"video_id": "abc123"
},
"asset_id": "asset-xyz789"
}
}
}
Polling for Completion
async function generateVideoAndWait(
input: GenerateVideoInput,
maxWaitMs = 600000,
pollIntervalMs = 10000
): Promise<{ video_url: string; video_id: string; asset_id: string }> {
const executionId = await generateVideo(input);
console.log(`Submitted video generation: ${executionId}`);
const startTime = Date.now();
while (Date.now() - startTime < maxWaitMs) {
const response = await fetch(
`https://api.heygen.com/v1/workflows/executions/${executionId}`,
{ headers: { "X-Api-Key": process.env.HEYGEN_API_KEY! } }
);
const { data } = await response.json();
switch (data.status) {
case "completed":
return {
video_url: data.output.video.video_url,
video_id: data.output.video.video_id,
asset_id: data.output.asset_id,
};
case "failed":
throw new Error(data.error?.message || "Video generation failed");
case "not_found":
throw new Error("Workflow not found");
default:
await new Promise((r) => setTimeout(r, pollIntervalMs));
}
}
throw new Error("Video generation timed out");
}
Usage Examples
Simple Text-to-Video
curl -X POST "https://api.heygen.com/v1/workflows/executions" \
-H "X-Api-Key: $HEYGEN_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"workflow_type": "GenerateVideoNode",
"input": {
"prompt": "A person walking through a sunlit park, shallow depth of field"
}
}'
Image-to-Video
{
"workflow_type": "GenerateVideoNode",
"input": {
"prompt": "Animate this product photo with a slow zoom and soft particle effects",
"reference_image_url": "https://example.com/product-photo.png",
"provider": "kling_pro"
}
}
Vertical Format for Social Media
{
"workflow_type": "GenerateVideoNode",
"input": {
"prompt": "A trendy coffee shop interior, camera slowly panning across the counter",
"aspect_ratio": "9:16",
"provider": "veo_3_1"
}
}
Fast Generation with LTX
{
"workflow_type": "GenerateVideoNode",
"input": {
"prompt": "Abstract colorful shapes morphing and flowing",
"provider": "ltx_distilled"
}
}
Best Practices
1. Be descriptive in prompts — include camera movement, lighting, style, and mood details
2. Default to Seedance 2.0 (via seedance_video) for cinematic and motion-led work when FAL_KEY is set — single-pass synced audio, multi-shot, lip-sync, director-level camera. Use VEO 3.1 / Sora V2 Pro when the user specifically wants Google or OpenAI motion character; use ltx_distilled or veo3_fast only when speed is the hard constraint
3. Use reference images for image-to-video generation — great for animating product photos or still images
4. Video generation is the slowest workflow — allow up to 5 minutes, poll every 10 seconds
5. Aspect ratio matters — use 9:16 for social media stories/reels, 16:9 for landscape, 1:1 for square
6. Output includes asset_id — use this to reference the generated video in other HeyGen workflows
7. Output URLs are temporary — download or save generated videos promptly
常見問題
ai-video-gen 技能有什麼用途?
從文字提示生成 AI 影片,支援多個提供者和 API 進行內容創作,包括從影象生成影片。
如何安裝 ai-video-gen?
打開本頁的「安裝」區塊並選擇你的代理 — Claude Code、Codex、Cursor 或 Gemini CLI:那裡有把技能資料夾複製到正確位置的現成指令。也可以複製「透過助理」分頁中的提示,讓助理自行檢查並安裝技能。
ai-video-gen 適用哪些 AI 模型?
技能是純 Markdown 指示(Agent Skills 格式),因此 ai-video-gen 適用任何讀取 SKILL.md 的代理:Claude Code、Codex、Cursor、Gemini CLI、GitHub Copilot、OpenCode 等。只有在任務符合技能描述時,模型才會載入指示。
ai-video-gen 是免費的嗎?
此技能由 calesthio 公開發布,採用 AGPL-3.0 授權。技能本身免費 — 你只需向 AI 供應商支付實際使用的 token 費用。
安裝技能安全嗎?
技能是代理會遵循的指示,安裝前請閱讀 SKILL.md 及相關檔案。技能資料夾中的腳本只有在代理執行時才會運行 — 留意它的動作,不要授予多餘權限。
技能和 MCP 伺服器或外掛有何不同?
MCP 伺服器或外掛為模型提供新工具 — 會執行並回傳結果的程式碼。技能提供的是知識與流程:如何處理任務、要遵循哪些步驟、好的成果長什麼樣子。它不需要伺服器或 API 金鑰。