feat: add cloud render mode for zero-install video generation - #4
Conversation
Add a second rendering mode that requires only VARG_API_KEY and curl, targeting non-technical users who don't have bun/ffmpeg installed. Changes: - SKILL.md: restructure with three modes (cloud render, local render, single asset API), auto-detect environment, cloud-first documentation - scripts/setup.sh: new bash-only setup script that detects bun/ffmpeg and recommends the appropriate mode (keeps setup.ts for bun users) - references/gateway-api.md: add full Render API documentation (POST /api/render, job polling, SSE streaming, rate limits, TSX format) - references/templates.md: add cloud render curl examples at the top - Update frontmatter: add license, metadata, version 2.0.0
📝 Walkthroughwalkthroughdocumentation overhaul introducing dual-mode rendering (cloud render vs local render), new render api docs, environment auto-detection script, updated templates and recipes, and reorganized guidance/examples for both modes. meow. changes
sequence diagram(s)sequenceDiagram
participant dev as "developer (local)"
participant cli as "varg cli / curl"
participant gateway as "gateway (auth, cache)"
participant render as "cloud render service"
participant storage as "object storage"
dev->>cli: submit TSX (cloud mode) or run local command
alt cloud mode
cli->>gateway: POST /api/render (tsx + auth)
gateway->>render: enqueue job
render->>storage: upload outputs
render-->>gateway: job status / result (output_url)
gateway-->>cli: 202 + job_id
cli->>gateway: GET /api/render/jobs/{job_id} (poll)
gateway-->>cli: status / output_url
else local mode
cli->>cli: run local renderer (bun + ffmpeg)
cli->>gateway: optional provider calls (model/gateway cache)
cli->>storage: local file write
end
estimated code review effort🎯 3 (moderate) | ⏱️ ~20 minutes possibly related prs
poem
🚥 Pre-merge checks | ✅ 2 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (2 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches
🧪 Generate unit tests (beta)
📝 Coding Plan
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment Tip You can customize the high-level summary generated by CodeRabbit.Configure the |
There was a problem hiding this comment.
Actionable comments posted: 4
🧹 Nitpick comments (6)
varg-ai/references/gateway-api.md (3)
343-351: missing language specifier on sse example blocksame deal - the sse event format could use a language hint for better rendering.
quick fix
-``` +```text event: status data: {"job_id":"...","status":"rendering","started_at":"..."}🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed. In `@varg-ai/references/gateway-api.md` around lines 343 - 351, Update the SSE example fences in gateway-api.md to include a language specifier (e.g., change the triple-backtick blocks that show "event: status / data: {...}" to use ```text) so the SSE payloads render correctly; locate the example blocks that contain the "event: status" lines and replace their opening backticks with ```text for each block.
372-376: missing language specifier on headers blockquick fix
-``` +```text X-RateLimit-Limit: 10 X-RateLimit-Remaining: 9 X-RateLimit-Reset: 2026-03-13T12:01:00.000Z</details> <details> <summary>🤖 Prompt for AI Agents</summary>Verify each finding against the current code and only fix it if needed.
In
@varg-ai/references/gateway-api.mdaround lines 372 - 376, The fenced block
showing example headers is missing a language specifier; update the code fence
around the headers example in gateway-api.md to use a plain-text specifier
(e.g., changetotext) so the headers block is rendered correctly as
plain text—locate the headers block with the lines "X-RateLimit-Limit: 10",
"X-RateLimit-Remaining: 9", "X-RateLimit-Reset: 2026-03-13T12:01:00.000Z" and
add the text language tag to the opening fence.</details> --- `253-255`: **missing language specifier on code block** static analysis flagged this - adding a language identifier helps syntax highlighting and linters. <details> <summary>quick fix</summary> ```diff -``` +```text https://render.varg.ai ``` ``` </details> <details> <summary>🤖 Prompt for AI Agents</summary>Verify each finding against the current code and only fix it if needed.
In
@varg-ai/references/gateway-api.mdaround lines 253 - 255, The fenced code
block containing the URL "https://render.varg.ai" is missing a language
specifier; update that fenced block in gateway-api.md by adding a language
identifier (e.g., "text") after the opening backticks so the block becomes
text ...to satisfy linters and enable proper syntax highlighting.</details> </blockquote></details> <details> <summary>varg-ai/scripts/setup.sh (2)</summary><blockquote> `41-46`: **edge case: curl output parsing can break on malformed responses** if the api returns an empty response or connection times out, `$RESPONSE` could be just "error" and `tail -n1` / `sed '$d'` might behave unexpectedly. the script handles this reasonably with the else branch on line 60, but the body extraction on line 46 could produce weird output. meow, consider adding a timeout to curl and checking for the "error" case explicitly: <details> <summary>optional improvement</summary> ```diff - RESPONSE=$(curl -s -w "\n%{http_code}" \ + RESPONSE=$(curl -s --max-time 10 -w "\n%{http_code}" \ -H "Authorization: Bearer $VARG_API_KEY" \ "https://api.varg.ai/v1/balance" 2>/dev/null || echo "error") HTTP_CODE=$(echo "$RESPONSE" | tail -n1) + if [ "$HTTP_CODE" = "error" ]; then + echo " $(yellow '[WARN]') Could not reach gateway" + elif [ "$HTTP_CODE" = "200" ]; then - BODY=$(echo "$RESPONSE" | sed '$d') - - if [ "$HTTP_CODE" = "200" ]; then + BODY=$(echo "$RESPONSE" | sed '$d') ``` </details> <details> <summary>🤖 Prompt for AI Agents</summary> ``` Verify each finding against the current code and only fix it if needed. In `@varg-ai/scripts/setup.sh` around lines 41 - 46, The current parsing of RESPONSE into HTTP_CODE and BODY can break if curl returns "error" or an empty string; modify the setup to pass a timeout to curl (e.g., --max-time) and after capturing RESPONSE (the variable in this diff) first check if RESPONSE equals "error" or is empty before running HTTP_CODE=$(echo "$RESPONSE" | tail -n1) and BODY=$(echo "$RESPONSE" | sed '$d'); if it's an error/empty response, set HTTP_CODE and BODY to sensible defaults (or branch to the existing error handling) to avoid unreliable tail/sed behavior while keeping the rest of the script flow unchanged. ``` </details> --- `50-56`: **`bc` dependency not guaranteed** the script uses `bc` to convert cents to dollars, but `bc` isn't available on all systems (e.g., minimal docker images, some cloud shells). the fallback `|| echo "?"` handles it, but might confuse users seeing `$?` in output. consider simplifying to just show cents, or document `bc` as optional: <details> <summary>suggested tweak</summary> ```diff if [ -n "$BALANCE" ]; then - DOLLARS=$(echo "scale=2; $BALANCE / 100" | bc 2>/dev/null || echo "?") - echo " $(green '[OK]') Gateway connected. Balance: $BALANCE credits (\$$DOLLARS)" + echo " $(green '[OK]') Gateway connected. Balance: $BALANCE credits" else ``` </details> <details> <summary>🤖 Prompt for AI Agents</summary> ``` Verify each finding against the current code and only fix it if needed. In `@varg-ai/scripts/setup.sh` around lines 50 - 56, The script uses bc to compute DOLLARS from BALANCE which may not exist on minimal systems; update the BALANCE/DOLLARS handling so it first checks for bc (command -v bc) and only runs the bc conversion when present, otherwise set DOLLARS to a clear fallback like "N/A" or display only cents; adjust the echo lines that reference BALANCE and DOLLARS (the variables BALANCE and DOLLARS and the green invocation) so the message is unambiguous in both cases. ``` </details> </blockquote></details> <details> <summary>varg-ai/references/templates.md (1)</summary><blockquote> `51-65`: **polling loop could run forever on stuck jobs** if the api returns a status that's neither "completed" nor "failed" indefinitely (or job times out server-side but status stays "rendering"), this loop never exits. consider adding a max iteration count or timeout: <details> <summary>optional safeguard</summary> ```diff # Poll until status is "completed" or "failed" +MAX_POLLS=90 # ~15 minutes at 10s intervals +POLL_COUNT=0 while true; do + POLL_COUNT=$((POLL_COUNT + 1)) + if [ "$POLL_COUNT" -gt "$MAX_POLLS" ]; then + echo "Timeout waiting for job" + break + fi RESULT=$(curl -s "https://render.varg.ai/api/render/jobs/$JOB_ID" \ ``` </details> <details> <summary>🤖 Prompt for AI Agents</summary> ``` Verify each finding against the current code and only fix it if needed. In `@varg-ai/references/templates.md` around lines 51 - 65, The polling while true loop that uses RESULT and STATUS can hang indefinitely if the job never reaches "completed" or "failed"; modify the script to add a timeout safeguard by introducing a max attempts or deadline variable (e.g., MAX_ATTEMPTS or END_TIME) and a counter (ATTEMPT) or timestamp check inside the loop, incrementing/checking it each iteration and exiting the loop with an error message and non-zero status when the limit is reached; also ensure the exit prints a helpful diagnostic (job id, last STATUS/RESULT) so callers can detect timeout. ``` </details> </blockquote></details> </blockquote></details> <details> <summary>🤖 Prompt for all review comments with AI agents</summary>Verify each finding against the current code and only fix it if needed.
Inline comments:
In@varg-ai/references/gateway-api.md:
- Around line 319-331: The status list under the render API currently omits
"queued"; update the documented Status values to include "queued" alongside
"rendering", "completed", and "failed" in the section containing Status values
and the failure example, and ensure any related examples (the submit response
example and the main gateway API references) consistently reflect "queued" where
appropriate (search for the Status values block and the submit response example
to locate the exact spots to change).In
@varg-ai/references/templates.md:
- Around line 38-42: The example that extracts JOB_ID uses jq but doesn't
mention the dependency; update the templates.md example (the JOB_ID extraction
using the curl + jq pipeline) to either add a short note that jq is required or
provide an alternate fallback extraction (e.g., using basic shell tools) for
environments without jq; reference the JOB_ID variable and the curl ... | jq -r
'.job_id' pipeline so reviewers can locate and modify that snippet.In
@varg-ai/scripts/setup.sh:
- Around line 93-98: The ffprobe check only prints status and doesn't influence
the HAS_FFMPEG/mode logic, so update the setup logic to treat ffprobe presence
alongside ffmpeg: add a new boolean (or update existing HAS_FFMPEG) to reflect
that both ffmpeg and ffprobe are required for local render mode, use the ffprobe
check block to set that flag (e.g., set HAS_FFMPEG=false or a new
HAS_FFMPEG_AND_FFPROBE=false when ffprobe is missing), and then use that
combined flag in any mode determination or messaging; alternatively, if you
prefer to keep separate flags, introduce HAS_FFPROBE and ensure mode logic
checks both HAS_FFMPEG and HAS_FFPROBE and the echo message clearly states that
both are required when one is missing.In
@varg-ai/SKILL.md:
- Around line 89-98: The cloud-render example mixes JSX compositional syntax
with the documented pattern of using function calls for media (composition uses
JSX but media should be created via functions), so update the example to use the
Video(...) function-call form instead of JSX: replace the JSX element<Video ... />with the corresponding Video(...) invocation and ensure model creation
still uses fal.videoModel("kling-v3"); confirm the example keeps Render and Clip
as composition wrappers while Video is shown as the media function to match the
documented pattern.
Nitpick comments:
In@varg-ai/references/gateway-api.md:
- Around line 343-351: Update the SSE example fences in gateway-api.md to
include a language specifier (e.g., change the triple-backtick blocks that show
"event: status / data: {...}" to usetext) so the SSE payloads render correctly; locate the example blocks that contain the "event: status" lines and replace their opening backticks withtext for each block.- Around line 372-376: The fenced block showing example headers is missing a
language specifier; update the code fence around the headers example in
gateway-api.md to use a plain-text specifier (e.g., changetotext) so
the headers block is rendered correctly as plain text—locate the headers block
with the lines "X-RateLimit-Limit: 10", "X-RateLimit-Remaining: 9",
"X-RateLimit-Reset: 2026-03-13T12:01:00.000Z" and add the text language tag to
the opening fence.- Around line 253-255: The fenced code block containing the URL
"https://render.varg.ai" is missing a language specifier; update that fenced
block in gateway-api.md by adding a language identifier (e.g., "text") after the
opening backticks so the block becomestext ...to satisfy linters and
enable proper syntax highlighting.In
@varg-ai/references/templates.md:
- Around line 51-65: The polling while true loop that uses RESULT and STATUS can
hang indefinitely if the job never reaches "completed" or "failed"; modify the
script to add a timeout safeguard by introducing a max attempts or deadline
variable (e.g., MAX_ATTEMPTS or END_TIME) and a counter (ATTEMPT) or timestamp
check inside the loop, incrementing/checking it each iteration and exiting the
loop with an error message and non-zero status when the limit is reached; also
ensure the exit prints a helpful diagnostic (job id, last STATUS/RESULT) so
callers can detect timeout.In
@varg-ai/scripts/setup.sh:
- Around line 41-46: The current parsing of RESPONSE into HTTP_CODE and BODY can
break if curl returns "error" or an empty string; modify the setup to pass a
timeout to curl (e.g., --max-time) and after capturing RESPONSE (the variable in
this diff) first check if RESPONSE equals "error" or is empty before running
HTTP_CODE=$(echo "$RESPONSE" | tail -n1) and BODY=$(echo "$RESPONSE" | sed
'$d'); if it's an error/empty response, set HTTP_CODE and BODY to sensible
defaults (or branch to the existing error handling) to avoid unreliable tail/sed
behavior while keeping the rest of the script flow unchanged.- Around line 50-56: The script uses bc to compute DOLLARS from BALANCE which
may not exist on minimal systems; update the BALANCE/DOLLARS handling so it
first checks for bc (command -v bc) and only runs the bc conversion when
present, otherwise set DOLLARS to a clear fallback like "N/A" or display only
cents; adjust the echo lines that reference BALANCE and DOLLARS (the variables
BALANCE and DOLLARS and the green invocation) so the message is unambiguous in
both cases.</details> <details> <summary>🪄 Autofix (Beta)</summary> Fix all unresolved CodeRabbit comments on this PR: - [ ] <!-- {"checkboxId": "4b0d0e0a-96d7-4f10-b296-3a18ea78f0b9"} --> Push a commit to this branch (recommended) - [ ] <!-- {"checkboxId": "ff5b1114-7d8c-49e6-8ac1-43f82af23a33"} --> Create a new PR with the fixes </details> --- <details> <summary>ℹ️ Review info</summary> <details> <summary>⚙️ Run configuration</summary> **Configuration used**: Organization UI **Review profile**: CHILL **Plan**: Pro **Run ID**: `7c58a480-1503-4686-b30c-bd160921eba8` </details> <details> <summary>📥 Commits</summary> Reviewing files that changed from the base of the PR and between 55ba125c3a916dc175961eb773488966bd243422 and ec99f6caa9b36b690bedf83292e3c84373262ec6. </details> <details> <summary>📒 Files selected for processing (4)</summary> * `varg-ai/SKILL.md` * `varg-ai/references/gateway-api.md` * `varg-ai/references/templates.md` * `varg-ai/scripts/setup.sh` </details> </details> <!-- This is an auto-generated comment by CodeRabbit for review status -->
| Status values: `"rendering"`, `"completed"`, `"failed"`. | ||
|
|
||
| On failure, `error` and `error_category` fields are included: | ||
|
|
||
| ```json | ||
| { | ||
| "status": "failed", | ||
| "error": "Insufficient balance", | ||
| "error_category": "quota_exceeded" | ||
| } | ||
| ``` | ||
|
|
||
| Error categories: `quota_exceeded`, `rate_limited`, `timeout`, `invalid_source`, `internal`. |
There was a problem hiding this comment.
status value "queued" missing from documented values
line 319 lists statuses as "rendering", "completed", "failed", but the submit response example on line 286 shows "rendering" and the main gateway api (line 121) shows "queued". should "queued" be in the render api status list too?
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.
In `@varg-ai/references/gateway-api.md` around lines 319 - 331, The status list
under the render API currently omits "queued"; update the documented Status
values to include "queued" alongside "rendering", "completed", and "failed" in
the section containing Status values and the failure example, and ensure any
related examples (the submit response example and the main gateway API
references) consistently reflect "queued" where appropriate (search for the
Status values block and the submit response example to locate the exact spots to
change).
SKILL.md was 401 lines and loaded entirely on activation. Now it is 178 lines — a compact router that directs agents to the right reference file based on what they need. Extracted content into 3 new reference files: - cloud-render.md: cloud render TSX format, workflow, restrictions - local-render.md: local render setup, CLI commands, iteration workflow - recipes.md: character consistency, talking head, slideshow, audio patterns Also includes previous fixes: - setup.sh: ffprobe now influences mode detection (HAS_FFPROBE flag) - templates.md: jq dependency noted with grep-based fallback
There was a problem hiding this comment.
Actionable comments posted: 3
🧹 Nitpick comments (3)
varg-ai/references/templates.md (1)
5-5: transformation note could mention elevenlabs explicitlyline 5 says replace
varg.imageModel→fal.imageModelandvarg.videoModel→fal.videoModel"etc." but doesn't mention that speech/music also change providers in cloud mode (elevenlabs.speechModel vs varg.speechModel).the "etc." covers it technically, but being explicit helps avoid confusion meow
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed. In `@varg-ai/references/templates.md` at line 5, The docs note replacing varg.imageModel → fal.imageModel and varg.videoModel → fal.videoModel for cloud mode but omit explicit mention of speech/music provider changes; update the sentence to explicitly list speech/music replacements as well (e.g., varg.speechModel → elevenlabs.speechModel and any musicModel equivalents) so readers know to switch varg.speechModel to elevenlabs.speechModel in cloud mode alongside varg.imageModel→fal.imageModel and varg.videoModel→fal.videoModel.varg-ai/SKILL.md (1)
42-42: "exactly the same" is slightly redundant but works for docsstatic analysis flags "EXACTLY the same" as wordy. technically true since "exactly" implies sameness. could simplify to "exactly as-is" or "character-for-character identical" or "unchanged prompts must match exactly".
but for docs emphasizing a critical cache rule, the redundancy adds clarity. totally optional meow
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed. In `@varg-ai/SKILL.md` at line 42, Update the wording in the "3. **Cache is sacred**" rule: replace the phrase "EXACTLY the same" with a less redundant but clear alternative such as "character-for-character identical" or "exactly as-is" so the line reads e.g. "When iterating, keep unchanged prompts character-for-character identical." Keep the rest of the sentence and emphasis intact to preserve the rule's intent.varg-ai/references/cloud-render.md (1)
102-130: poll example assumes manual job_id extractionthe submit step (105-109) gets a response but doesn't show extracting
job_idinto a variable. then the poll step (128) just says "JOB_ID" expecting users to replace it manually.this workflow break means users can't just copy-paste the commands in sequence. maybe show capturing the job_id in step 2?
something like:
RESPONSE=$(curl -s -X POST https://render.varg.ai/api/render \ -H "Authorization: Bearer $VARG_API_KEY" \ -H "Content-Type: application/json" \ -d "{\"code\": $(cat video.tsx | jq -Rs .)}") JOB_ID=$(echo "$RESPONSE" | jq -r '.job_id') echo "submitted job: $JOB_ID"then step 3 can just use
$JOB_IDmeow🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed. In `@varg-ai/references/cloud-render.md` around lines 102 - 130, The submit/poll example is missing automatic extraction of the returned job_id; modify the Step 2 POST example to capture the full response into a shell variable (e.g., RESPONSE) and then extract JOB_ID using jq -r '.job_id' into a JOB_ID variable (and echo it), and update the Step 3 poll example to use "$JOB_ID" instead of a literal JOB_ID so users can copy/paste the sequence without manual replacement.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.
Inline comments:
In `@varg-ai/references/recipes.md`:
- Line 146: The Cost line in the slideshow recipe is wrong: update the math in
the string "**Cost**: ~55 credits ($0.55) -- 15 (3 images) + 30 (music)" to
reflect 15 + 30 = 45, and change the credits and dollar amount to "**Cost**: ~45
credits ($0.45) -- 15 (3 images) + 30 (music)". Ensure the displayed numeric
totals (credits and USD) match the summed parts.
- Line 57: Update the incorrect total in the cost line: change the "**Cost**:
~320 credits ($3.20) -- 15 (3 images) + 300 (2 videos)" entry to reflect the
correct sum (15 + 300 = 315), e.g. "**Cost**: ~315 credits ($3.15) -- 15 (3
images) + 300 (2 videos)", ensuring the displayed dollar amount matches the
corrected credit total if applicable.
- Around line 155-167: The recipe references {video} but never defines it, so
add a minimal Video resource and use that variable when rendering: create a
Video(...) assignment (e.g., const video = Video({ ... })) before the Render
block or replace the {video} reference with a synced/animated asset variable
already defined; update the snippet around the Speech, Render, Music, Clip, and
Captions usage so the Clip receives a defined video variable named video
referenced by Captions and Clip.
---
Nitpick comments:
In `@varg-ai/references/cloud-render.md`:
- Around line 102-130: The submit/poll example is missing automatic extraction
of the returned job_id; modify the Step 2 POST example to capture the full
response into a shell variable (e.g., RESPONSE) and then extract JOB_ID using jq
-r '.job_id' into a JOB_ID variable (and echo it), and update the Step 3 poll
example to use "$JOB_ID" instead of a literal JOB_ID so users can copy/paste the
sequence without manual replacement.
In `@varg-ai/references/templates.md`:
- Line 5: The docs note replacing varg.imageModel → fal.imageModel and
varg.videoModel → fal.videoModel for cloud mode but omit explicit mention of
speech/music provider changes; update the sentence to explicitly list
speech/music replacements as well (e.g., varg.speechModel →
elevenlabs.speechModel and any musicModel equivalents) so readers know to switch
varg.speechModel to elevenlabs.speechModel in cloud mode alongside
varg.imageModel→fal.imageModel and varg.videoModel→fal.videoModel.
In `@varg-ai/SKILL.md`:
- Line 42: Update the wording in the "3. **Cache is sacred**" rule: replace the
phrase "EXACTLY the same" with a less redundant but clear alternative such as
"character-for-character identical" or "exactly as-is" so the line reads e.g.
"When iterating, keep unchanged prompts character-for-character identical." Keep
the rest of the sentence and emphasis intact to preserve the rule's intent.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Organization UI
Review profile: CHILL
Plan: Pro
Run ID: 7b2e3632-6aa9-42cd-9ad1-0e7225ba7238
📒 Files selected for processing (6)
varg-ai/SKILL.mdvarg-ai/references/cloud-render.mdvarg-ai/references/local-render.mdvarg-ai/references/recipes.mdvarg-ai/references/templates.mdvarg-ai/scripts/setup.sh
🚧 Files skipped from review as they are similar to previous changes (1)
- varg-ai/scripts/setup.sh
| ) | ||
| ``` | ||
|
|
||
| **Cost**: ~320 credits ($3.20) -- 15 (3 images) + 300 (2 videos) |
There was a problem hiding this comment.
cost total is off by 5 credits
15 + 300 is 315, not 320. tiny doc fix, but worth correcting for trust. meow.
suggested doc fix
-**Cost**: ~320 credits ($3.20) -- 15 (3 images) + 300 (2 videos)
+**Cost**: ~315 credits ($3.15) -- 15 (3 images) + 300 (2 videos)📝 Committable suggestion
‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.
| **Cost**: ~320 credits ($3.20) -- 15 (3 images) + 300 (2 videos) | |
| **Cost**: ~315 credits ($3.15) -- 15 (3 images) + 300 (2 videos) |
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.
In `@varg-ai/references/recipes.md` at line 57, Update the incorrect total in the
cost line: change the "**Cost**: ~320 credits ($3.20) -- 15 (3 images) + 300 (2
videos)" entry to reflect the correct sum (15 + 300 = 315), e.g. "**Cost**: ~315
credits ($3.15) -- 15 (3 images) + 300 (2 videos)", ensuring the displayed
dollar amount matches the corrected credit total if applicable.
|
|
||
| **Tip**: Add `zoom: "in"` or `zoom: "out"` to `Image()` for a Ken Burns effect (slow pan/zoom over still images). Combine with `dissolve` transitions for a classic documentary feel. | ||
|
|
||
| **Cost**: ~55 credits ($0.55) -- 15 (3 images) + 30 (music) |
There was a problem hiding this comment.
slideshow cost math is incorrect
15 + 30 is 45, not 55.
suggested doc fix
-**Cost**: ~55 credits ($0.55) -- 15 (3 images) + 30 (music)
+**Cost**: ~45 credits ($0.45) -- 15 (3 images) + 30 (music)📝 Committable suggestion
‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.
| **Cost**: ~55 credits ($0.55) -- 15 (3 images) + 30 (music) | |
| **Cost**: ~45 credits ($0.45) -- 15 (3 images) + 30 (music) |
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.
In `@varg-ai/references/recipes.md` at line 146, The Cost line in the slideshow
recipe is wrong: update the math in the string "**Cost**: ~55 credits ($0.55) --
15 (3 images) + 30 (music)" to reflect 15 + 30 = 45, and change the credits and
dollar amount to "**Cost**: ~45 credits ($0.45) -- 15 (3 images) + 30 (music)".
Ensure the displayed numeric totals (credits and USD) match the summed parts.
| const speech = Speech({ | ||
| model: varg.speechModel("turbo"), | ||
| voice: "adam", | ||
| children: "Welcome to the showcase. Today we have something special for you." | ||
| }) | ||
|
|
||
| export default ( | ||
| <Render width={1080} height={1920}> | ||
| <Music model={varg.musicModel("music_v1")} prompt="gentle ambient" volume={0.2} duration={10} ducking /> | ||
| <Clip duration={10}> | ||
| {video} | ||
| <Captions src={speech} style="tiktok" position="bottom" /> | ||
| </Clip> |
There was a problem hiding this comment.
fix missing video definition in the recipe snippet
this snippet won’t run as written because {video} is referenced but never defined. add a minimal Video(...) example (or replace with synced/animated style var) before render.
suggested doc fix
const speech = Speech({
model: varg.speechModel("turbo"),
voice: "adam",
children: "Welcome to the showcase. Today we have something special for you."
})
+
+const video = Video({
+ model: varg.videoModel("kling-v3"),
+ prompt: "clean product showcase shot, slow cinematic movement",
+ duration: 10
+})
export default (
<Render width={1080} height={1920}>
<Music model={varg.musicModel("music_v1")} prompt="gentle ambient" volume={0.2} duration={10} ducking />
<Clip duration={10}>
{video}
<Captions src={speech} style="tiktok" position="bottom" />
</Clip>
</Render>
)📝 Committable suggestion
‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.
| const speech = Speech({ | |
| model: varg.speechModel("turbo"), | |
| voice: "adam", | |
| children: "Welcome to the showcase. Today we have something special for you." | |
| }) | |
| export default ( | |
| <Render width={1080} height={1920}> | |
| <Music model={varg.musicModel("music_v1")} prompt="gentle ambient" volume={0.2} duration={10} ducking /> | |
| <Clip duration={10}> | |
| {video} | |
| <Captions src={speech} style="tiktok" position="bottom" /> | |
| </Clip> | |
| const speech = Speech({ | |
| model: varg.speechModel("turbo"), | |
| voice: "adam", | |
| children: "Welcome to the showcase. Today we have something special for you." | |
| }) | |
| const video = Video({ | |
| model: varg.videoModel("kling-v3"), | |
| prompt: "clean product showcase shot, slow cinematic movement", | |
| duration: 10 | |
| }) | |
| export default ( | |
| <Render width={1080} height={1920}> | |
| <Music model={varg.musicModel("music_v1")} prompt="gentle ambient" volume={0.2} duration={10} ducking /> | |
| <Clip duration={10}> | |
| {video} | |
| <Captions src={speech} style="tiktok" position="bottom" /> | |
| </Clip> | |
| </Render> | |
| ) |
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.
In `@varg-ai/references/recipes.md` around lines 155 - 167, The recipe references
{video} but never defines it, so add a minimal Video resource and use that
variable when rendering: create a Video(...) assignment (e.g., const video =
Video({ ... })) before the Render block or replace the {video} reference with a
synced/animated asset variable already defined; update the snippet around the
Speech, Render, Music, Clip, and Captions usage so the Clip receives a defined
video variable named video referenced by Captions and Clip.
Summary
Adds a cloud render mode to the
varg-aiskill, enabling non-technical users to generate videos without installing bun or ffmpeg — just aVARG_API_KEYandcurl.Problem
The current skill only supports local rendering via
bunx vargai render, which requires:This is a barrier for the target audience: non-technical users on platforms like OpenClaw who want to generate videos through their AI agent without setting up a dev environment.
Solution
Two rendering modes, one skill
The skill now auto-detects the user's environment and picks the right mode:
Cloud Render (Mode A)
POST https://render.varg.ai/api/rendervia curlRender,Clip,Image,Video, etc.) are injected as globalsVARG_API_KEY(from Authorization header) handles all AI calls automaticallyLocal Render (Mode B)
bunx vargai render video.tsx --verboseChanges
SKILL.mdlicense,metadata,version: 2.0.0. Cloud-first documentation.scripts/setup.shscripts/setup.tsreferences/gateway-api.mdreferences/templates.mdCloud Render API Quick Reference
Not in scope (follow-up)
~/.claude/skills/media-generation,~/.claude/skills/varg-video-generation)evals/directory