← 返回
未分类 Key 中文

vargai

Generate AI videos, images, speech, and music using varg. Use when creating videos, animations, talking characters, slideshows, product showcases, social con...
使用varg生成AI视频、图片、语音和音乐。适用于创作视频、动画、虚拟人物、幻灯片、产品展示、社交内容等场景。
securityqq securityqq 来源
未分类 clawhub v2.0.3 1 版本 100000 Key: 需要
★ 0
Stars
📥 520
下载
💾 0
安装
1
版本
#latest

概述

Environment Detection

Before generating anything, determine the rendering mode.

Run bash scripts/setup.sh from the skill directory to auto-detect, or check manually:

bunffmpegMode
-------------------
NoNoCloud Render -- read cloud-render.md
YesNoCloud Render -- read cloud-render.md
YesYesLocal Render (recommended) -- read local-render.md

VARG_API_KEY is required for all modes. Get one at https://varg.ai

Critical Rules

Everything you know about varg is likely outdated. Always verify against this skill and its references before writing code.

  1. Never guess model IDs -- consult models.md for current models, pricing, and constraints.
  2. Function calls for media, JSX for composition -- Image({...}) creates media, composes timeline. Never write .
  3. Cache is sacred -- identical prompt + params = instant $0 cache hit. When iterating, keep unchanged prompts EXACTLY the same. Never clear cache.
  4. One image per Video -- Video({ prompt: { images: [img] } }) takes exactly one image. Multiple images cause errors.
  5. Duration constraints differ by model -- kling-v3: 3-15s (integer only). kling-v2.5: ONLY 5 or 10. Check models.md.
  6. Gateway namespace -- use providerOptions: { varg: {...} }, never fal, when going through the gateway (both modes).
  7. Renders cost money -- 1 credit = 1 cent. A typical 3-clip video costs $2-5. Use preview mode (local) or cheap models to iterate.

Quick Start

Cloud Render (no bun/ffmpeg needed)

# Submit TSX code to the render service
curl -s -X POST https://render.varg.ai/api/render \
  -H "Authorization: Bearer $VARG_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"code": "const img = Image({ model: fal.imageModel(\"nano-banana-pro\"), prompt: \"a cabin in mountains at sunset\", aspectRatio: \"16:9\" });\nexport default (<Render width={1920} height={1080}><Clip duration={3}>{img}</Clip></Render>);"}'

# Poll for result (repeat until "completed" or "failed")
curl -s https://render.varg.ai/api/render/jobs/JOB_ID \
  -H "Authorization: Bearer $VARG_API_KEY"

Full details: cloud-render.md

Local Render (bun + ffmpeg)

/** @jsxImportSource vargai */
import { Render, Clip, Image } from "vargai/react"
import { createVarg } from "@vargai/gateway"

const varg = createVarg({ apiKey: process.env.VARG_API_KEY! })

const img = Image({
  model: varg.imageModel("nano-banana-pro"),
  prompt: "a cabin in mountains at sunset",
  aspectRatio: "16:9"
})

export default (
  <Render width={1920} height={1080}>
    <Clip duration={3}>{img}</Clip>
  </Render>
)
bunx vargai render video.tsx --preview   # free preview
bunx vargai render video.tsx --verbose   # full render (costs credits)

Full details: local-render.md

Single Asset (no video composition)

For one-off images, videos, speech, or music without building a multi-clip template:

curl -X POST https://api.varg.ai/v1/image \
  -H "Authorization: Bearer $VARG_API_KEY" \
  -d '{"model": "nano-banana-pro", "prompt": "a sunset over mountains"}'

Full API reference: gateway-api.md

How to Write Video Code

Video code has two layers: media generation (function calls) and composition (JSX).

// 1. GENERATE media via function calls
const img = Image({ model: ..., prompt: "..." })
const vid = Video({ model: ..., prompt: { text: "...", images: [img] }, duration: 5 })
const voice = Speech({ model: ..., voice: "rachel", children: "Hello!" })

// 2. COMPOSE via JSX tree
export default (
  <Render width={1080} height={1920}>
    <Music model={...} prompt="upbeat electronic" duration={10} volume={0.3} />
    <Clip duration={5}>
      {vid}
      <Title position="bottom">Welcome</Title>
    </Clip>
    <Captions src={voice} style="tiktok" withAudio />
  </Render>
)

Component Summary

ComponentTypePurpose
--------------------------
Image()Function callGenerate still image
Video()Function callGenerate video (text-to-video or image-to-video)
Speech()Function callText-to-speech audio
JSXRoot container -- sets width, height, fps
JSXTimeline segment -- duration, transitions
JSXBackground audio (always set duration!)
JSXSubtitle track from Speech
</code></td><td>JSX</td><td>Text overlay</td></tr><tr><td><code><Overlay></code></td><td>JSX</td><td>Positioned layer</td></tr><tr><td><code><Split></code> / <code><Grid></code></td><td>JSX</td><td>Layout helpers</td></tr></tbody></table><p>Full props: <a href="references/components.md" target="_blank" rel="noopener">components.md</a></p><h3>Provider Differences (Cloud vs Local)</h3><table><thead><tr><th>Cloud Render</th><th>Local Render</th></tr></thead><tbody><tr><td>---</td><td>---</td></tr><tr><td>No imports needed</td><td><code>import { ... } from "vargai/react"</code></td></tr><tr><td><code>fal.imageModel("nano-banana-pro")</code></td><td><code>varg.imageModel("nano-banana-pro")</code></td></tr><tr><td><code>fal.videoModel("kling-v3")</code></td><td><code>varg.videoModel("kling-v3")</code></td></tr><tr><td><code>elevenlabs.speechModel("eleven_v3")</code></td><td><code>varg.speechModel("eleven_v3")</code></td></tr><tr><td>Globals are auto-injected</td><td>Must call <code>createVarg()</code></td></tr></tbody></table><h3>When to Use Which Provider</h3><table><thead><tr><th>Scenario</th><th>Use</th><th>Auth</th></tr></thead><tbody><tr><td>----------</td><td>-----</td><td>------</td></tr><tr><td>New project, simplest setup</td><td><code>varg.*Model()</code> (gateway)</td><td><code>VARG_API_KEY</code> only</td></tr><tr><td>Existing project with fal/elevenlabs keys</td><td><code>fal.<em>Model()</code> / <code>elevenlabs.</em>Model()</code></td><td>Individual keys</td></tr><tr><td>Cloud render via curl/API</td><td>Gateway (only option)</td><td><code>VARG_API_KEY</code></td></tr><tr><td>Need $0 billing with own keys</td><td>Gateway + BYOK headers</td><td><code>VARG_API_KEY</code> + provider keys</td></tr><tr><td>Specific provider feature not in gateway</td><td>Direct provider</td><td>Individual key</td></tr></tbody></table><p><strong>Default recommendation</strong>: Use the gateway (<code>varg.*Model()</code> + <code>VARG_API_KEY</code>). It handles routing, caching, billing, and works with a single key.</p><h2>Cost & Iteration</h2><ul><li><strong>1 credit = 1 cent.</strong> nano-banana-pro = 5 credits, kling-v3 = 150 credits, speech = 20-25 credits.</li><li><strong>Cache saves money.</strong> Keep unchanged prompts character-for-character identical across iterations.</li><li><strong>Preview first</strong> (local mode only): <code>--preview</code> generates free placeholders to validate structure.</li><li>Full pricing: <a href="references/models.md" target="_blank" rel="noopener">models.md</a></li></ul><h2>References</h2><p>Load these on demand based on what you need:</p><table><thead><tr><th>Need</th><th>Reference</th><th>When to load</th></tr></thead><tbody><tr><td>------</td><td>-----------</td><td>-------------</td></tr><tr><td>Render via API</td><td><a href="references/cloud-render.md" target="_blank" rel="noopener">cloud-render.md</a></td><td>No bun/ffmpeg, or user wants cloud rendering</td></tr><tr><td>Render locally</td><td><a href="references/local-render.md" target="_blank" rel="noopener">local-render.md</a></td><td>bun + ffmpeg available</td></tr><tr><td>Patterns & workflows</td><td><a href="references/recipes.md" target="_blank" rel="noopener">recipes.md</a></td><td>Talking head, character consistency, slideshow, lipsync</td></tr><tr><td>Model selection</td><td><a href="references/models.md" target="_blank" rel="noopener">models.md</a></td><td>Choosing models, checking prices, duration constraints</td></tr><tr><td>Component props</td><td><a href="references/components.md" target="_blank" rel="noopener">components.md</a></td><td>Need detailed props for any component</td></tr><tr><td>Better prompts</td><td><a href="references/prompting.md" target="_blank" rel="noopener">prompting.md</a></td><td>User wants cinematic / high-quality results</td></tr><tr><td>REST API</td><td><a href="references/gateway-api.md" target="_blank" rel="noopener">gateway-api.md</a></td><td>Single-asset generation or Render API details</td></tr><tr><td>Debugging</td><td><a href="references/common-errors.md" target="_blank" rel="noopener">common-errors.md</a></td><td>Something failed or produced unexpected results</td></tr><tr><td>Full examples</td><td><a href="references/templates.md" target="_blank" rel="noopener">templates.md</a></td><td>Need complete copy-paste-ready templates</td></tr><tr><td>BYOK keys</td><td><a href="references/byok.md" target="_blank" rel="noopener">byok.md</a></td><td>Using your own provider API keys for $0 billing</td></tr></tbody></table></div> </div> </div> <div id="tab-versions" class="detail-content"> <div class="detail-section"> <h2>版本历史</h2> <p style="margin-bottom:12px;font-size:14px;color:#94a3b8;">共 1 个版本</p> <ul class="version-list"> <li> <div> <span class="version-tag">v2.0.3</span> <span style="font-size:11px;color:#5b6abf;margin-left:8px;background:#eef0ff;padding:1px 8px;border-radius:10px;">当前</span> </div> <div style="font-size:12px;color:#94a3b8;"> 2026-03-30 10:35 安全 安全 </div> </li> </ul> </div> </div> <div id="tab-security" class="detail-content"> <div class="detail-section"> <h2>安全检测</h2> <div class="sec-grid"> <div class="sec-card"> <h4>腾讯云安全 (Keen)</h4> <div class="sec-status sec-safe"> 安全,无风险 </div> <a href="https://tix.qq.com/search/skill?keyword=b65c47fdda59a1828b8ae846839ccca0" target="_blank">查看报告</a> </div> <div class="sec-card"> <h4>腾讯云安全 (Sanbu)</h4> <div class="sec-status sec-safe"> 安全,无风险 </div> <a href="https://static.cloudsec.tencent.com/html-report-v2/2026/05/25/415465_2f6236f7c9b4da79521ca176b132b0c4.html?q-sign-algorithm=sha1&q-ak=AKID8JMG1bzBC1dz96qNhssfFftujT1NCoFi&q-sign-time=1783059849%3B1814595849&q-key-time=1783059849%3B1814595849&q-header-list=host&q-url-param-list=&q-signature=286543b136475d973b819c5ace64c18d69779d95" target="_blank">查看报告</a> </div> </div> </div> </div> <!-- Recommended Skills --> <div style="margin-top:24px;"> <h2 style="font-size:18px;font-weight:600;margin-bottom:16px;">🔗 相关推荐</h2> <div class="rec-grid"> <div class="rec-card"> <span class="badge-cat" style="margin-bottom:8px;display:inline-block;">design-media</span> <h3><a href="/s/openai-whisper">Openai Whisper</a></h3> <div class="rec-owner">steipete</div> <div class="rec-desc">使用 Whisper CLI 进行本地语音转文字(无需 API 密钥)</div> <div class="rec-stats"> <span style="color:#f39c12;">★ 335</span> <span style="color:#5b6abf;">📥 94,638</span> </div> </div> <div class="rec-card"> <span class="badge-cat" style="margin-bottom:8px;display:inline-block;">design-media</span> <h3><a href="/s/ui-ux-pro-max">UI/UX Pro Max</a></h3> <div class="rec-owner">xobi667</div> <div class="rec-desc">提供 UI/UX 设计智能与实现指导,帮助打造精美界面。适用于 UI 设计、UX 流程、信息架构、视觉风格、设计系统/标记、组件规格、文案/微文案、无障碍及前端 UI(HTML/CSS/JS、React、Next.js、Vue、Svelte</div> <div class="rec-stats"> <span style="color:#f39c12;">★ 227</span> <span style="color:#5b6abf;">📥 48,784</span> </div> </div> <div class="rec-card"> <span class="badge-cat" style="margin-bottom:8px;display:inline-block;">design-media</span> <h3><a href="/s/video-frames">Video Frames</a></h3> <div class="rec-owner">steipete</div> <div class="rec-desc">使用 ffmpeg 从视频中提取帧或短片。</div> <div class="rec-stats"> <span style="color:#f39c12;">★ 136</span> <span style="color:#5b6abf;">📥 53,188</span> </div> </div> </div> </div> </div> <script> document.addEventListener('DOMContentLoaded',function(){ document.querySelectorAll('.detail-tab').forEach(function(btn){ btn.addEventListener('click',function(e){ var tab = this.getAttribute('data-tab'); document.querySelectorAll('.detail-tab').forEach(function(b){b.classList.remove('active')}); document.querySelectorAll('.detail-content').forEach(function(c){c.classList.remove('active')}); this.classList.add('active'); var el = document.getElementById('tab-'+tab); if(el) el.classList.add('active'); }); }); }); </script> <div class="footer"> <p>Skill工具集 © 2026</p> </div></body> </html>