video-generation
Skill15 starsChanged 58 days agoMITView on GitHub
- Category: compute - SDK: @0gfoundation/0g-compute-ts-sdk ^0.9.0, ethers 6.13.1 - Activation Triggers: "generate video", "text-to-video", "image-to-video", "video generation", "MiniMax", "Seedance" Generate video clips from a text prompt (optionally conditioned on a reference image) using 0G Compute Network providers (serviceType: video-generation). Unlike chat and image generation, this is an asynchronous, three-call flow: submit a job, poll until it completes, then download the MP4. Discover at runtime — never hardcode. At last verification 0G mainnet had two video-generation providers; testnet had none.
- Reads credentials
- Sends data out
22 other projects use a version of this.
Adopted by
Most recently taken up by
- Littlpinguin/marketing-cockpit-templatetheir own version, first seen Nov 3, 2026
- wildercrenshaw2/model-skillstheir own version, first seen Nov 1, 2026
- Sanidhya14321/video-forgetheir own version, first seen Oct 25, 2026
- caozhikun/video-generation-skilltheir own version, first seen Oct 20, 2026
- xdanger/skillstheir own version, first seen Oct 20, 2026
- HybridAIOne/hybridclawtheir own version, first seen Oct 13, 2026
Used with
Projects with it also use consulting-analysis, surprise-me and 10 more.
Other files people use alongside this one.
Files found in the same public projects as a version of this one, more often than they turn up anywhere else. Each project counts once, large collections count for less, and this file's own repository is left out.
HK-hubSkillconsulting-analysis
Use this skill when the user requests to generate, create, or write professional research reports including but not limited to market analysis, consumer insights, brand analysis, financial analysis, industry research, competitive intelligence, investment due diligence, or any consulting-grade analytical report. This skill operates in two phases — (1) generating a structured analysis framework with chapter skeleton, data query requirements, and analysis logic, and (2) after data collection by other skills, producing the final consulting-grade report with structured narratives, embedded charts, and strategic insights.
Also in 4 projects that use this
stophobiaSkillsurprise-me
Create a delightful, unexpected "wow" experience for the user by dynamically discovering and creatively combining other enabled skills. Triggers when the user says "surprise me" or any request expressing a desire for an unexpected creative showcase. Also triggers when the user is bored, wants inspiration, or asks for "something interesting".
Also in 3 projects that use this
HK-hubSkillppt-generation
Use this skill when the user requests to generate, create, or make presentations (PPT/PPTX). Creates visually rich slides by generating images for each slide and composing them into a PowerPoint file.
Also in 3 projects that use this
stophobiaSkillgithub-deep-research
Conduct multi-round deep research on any GitHub Repo. Use when users request comprehensive analysis, timeline reconstruction, competitive analysis, or in-depth investigation of GitHub. Produces structured markdown reports with executive summaries, chronological timelines, metrics analysis, and Mermaid diagrams. Triggers on Github repository URL or open source projects.
Also in 3 projects that use this
MicrosoftSkillpodcast-generation
Generate AI-powered podcast-style audio narratives using Azure OpenAI's GPT Realtime Mini model via WebSocket. Use when building text-to-speech features, audio narrative generation, podcast creation from content, or integrating with Azure OpenAI Realtime API for real audio output. Covers full-stack implementation from React frontend to Python FastAPI backend with WebSocket streaming.
Also in 3 projects that use this
VercelSkillvercel-deploy
Deploy applications and websites to Vercel with a claimable preview. Use when the user requests deployment actions like "deploy my app", "deploy and give me the link", "push this live", or "create a preview deployment". No authentication required - returns preview URL and claimable deployment link.
Also in 3 projects that use this
- +1 more from HK-hub
Other versions22 projects use a version of this.
Word for word · 0
None found.
Edited · 0
None found.
Wrote their own version · 22
- bytedance/deer-flow★ 85ksame name
- stophobia/deerflow2.0-enhanced★ 821same name
- HybridAIOne/hybridclaw★ 159same name
- hyperfx-ai/marketing-skills★ 112same name
- Rylaispirit/rylai-codex-hermes-skills★ 56same name
- awesome-genmedia/skills★ 36same name
- wildercrenshaw2/model-skills★ 34same name
- michaelboeding/skills★ 30same name
- wulaosiji/skills★ 28same name
- Galbaz1/video-research-mcp★ 23same name
12 more not listed
How matches are found. Word for word: the exact same text. Edited: shares passages with this file (“99% same” means 99% of its five-word phrases also appear here; 10% or more counts). Their own version: similar meaning, or, weakest, the same name. We can’t tell which project had it first. Projects are counted among the 200 most-starred candidates, and mentions are links to the repository we found, up to 50 per site, so both counts are a floor.
In this repository26 other files it gives its agents.
- AGENTS.mdAGENTS.md
- CLAUDE.mdCLAUDE.md
- agent-accountsSkill
- agent-reputationSkill
- deploy-agentSkill
- interact-agentSkill
- manage-agentSkill
- deploy-contractSkill
- interact-contractSkill
- scaffold-projectSkill
- account-managementSkill
- embeddingsSkill
- fine-tuningSkill
- image-editingSkill
- provider-discoverySkill
- speech-to-textSkill
- streaming-chatSkill
- text-to-imageSkill
- compute-plus-storageSkill
- storage-plus-chainSkill
- 0g-pc-setupSkill
- 0g-pc-switch-modelSkill
- 0g-pc-uninstallSkill
- download-fileSkill
- merkle-verificationSkill
- upload-fileSkill
The file
We split this skill into the rules it gives an agent
7 rules. 0 are common, 4 are distinctive, and 3 are very specific to this project.
0
Common
Most of the 19 edited versions we read keep these.
4
Distinctive
This author's own choices. Worth a look.
3
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Distinctive: line 90
Ensure the sub-account exists and is acknowledged
- Very specific: line 94
Do not: call processResponse()
- Distinctive: line 100
Treat generation as asynchronous — submit, poll, then download
- Distinctive: line 101
Read live pricing variants before submitting.
- Very specific: line 102
Check availableBalance before submitting, since a single clip can cost many 0G
- Very specific: line 109
Call processResponse() for a video-generation provider — it throws Unknown service type
- Distinctive: line 114
Use ethers v5 syntax
“Common” is measured: kept by at least 6 in 10 of the 19 edited versions of this file we could read. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
Video Generation
Metadata
- Category: compute
- SDK:
@0gfoundation/0g-compute-ts-sdk^0.9.0,ethers6.13.1 - Activation Triggers: "generate video", "text-to-video", "image-to-video", "video generation", "MiniMax", "Seedance"
Purpose
Generate video clips from a text prompt (optionally conditioned on a reference image) using 0G
Compute Network providers (serviceType: video-generation).
Unlike chat and image generation, this is an asynchronous, three-call flow: submit a job, poll until it completes, then download the MP4.
Models
Discover at runtime — never hardcode. At last verification 0G mainnet had two video-generation
providers; testnet had none.
| Model | Output | Billing unit |
dreamina-seedance-2-5-260628 | 480p/720p/1080p, 4–30 s | video_token |
MiniMax-H3 | 2K, 5–15 s | video_second |
Both accept text and image input and emit video. Supported request parameters are prompt,
seconds, size and input_reference.
Video is by far the most expensive service type on the network. At last check MiniMax-H3 was
priced at roughly 1.07 0G per generated second — a 10-second clip is on the order of 10 0G. Always
read live pricing before submitting, and prefer the cheapest variant while developing.
Pricing is expressed in variants, because cost depends on resolution.
Types lag the API here. The SDK's
ProviderModelInfo['pricing']declaresprompt,completion,image,video,tiered_pricingandcache_token_billing— but not thevariantsandvideo_unitfields that video providers actually return. Widen the type locally rather than reaching forany:
interface VideoPricingVariant {
dimensions?: Record<string, string>;
unit: 'video_token' | 'video_second';
unit_price: string;
}
interface VideoPricing {
video?: string;
video_unit?: 'video_token' | 'video_second';
variants?: VideoPricingVariant[];
}
const { models } = await broker.inference.getProviderModels(providerAddress);
for (const m of models) {
const pricing = m.pricing as VideoPricing | undefined;
console.log(m.id, pricing?.video_unit); // 'video_token' | 'video_second'
for (const v of pricing?.variants ?? []) {
console.log(' ', JSON.stringify(v.dimensions), v.unit, v.unit_price);
}
}⚠️ processResponse() is not supported for video
In SDK 0.9.0 the response extractor recognises only chatbot, text-to-image, image-editing and
speech-to-text. Calling processResponse() against a video-generation provider throws:
Error: Unknown service typeThe job is still billed and settled from the signed getRequestHeaders() headers. What you lose is
local fee caching and signature verification, so manage the sub-account balance explicitly — and
given the cost per clip, check availableBalance before submitting.
Prerequisites
- Node.js >= 20
@0gfoundation/0g-compute-ts-sdkandethersinstalled- Funded and acknowledged provider — budget generously, see pricing above
.envwithPRIVATE_KEY,RPC_URL,PROVIDER_ADDRESS
Quick Workflow
- Initialize broker
- Find a
video-generationprovider and read its live pricing variants - Confirm
availableBalancecovers the clip you are about to request - Ensure the sub-account exists and is acknowledged
POST ${endpoint}/videos→ returns a job with anid- Poll
GET ${endpoint}/videos/{id}untilstatusiscompleted GET ${endpoint}/videos/{id}/content→ MP4 bytes- Do not call
processResponse()
Core Rules
ALWAYS
- Treat generation as asynchronous — submit, poll, then download
- Read live pricing variants before submitting; cost scales with resolution and duration
- Check
availableBalancebefore submitting, since a single clip can cost many 0G - Poll with a sensible interval and an overall timeout
- Request the smallest
size/secondsthat answers the question while developing - Page
listService()in chunks of ≤ 50
NEVER
- Call
processResponse()for avideo-generationprovider — it throwsUnknown service type - Expect the MP4 in the submit response — you get a job id
- Poll in a tight loop without a delay
- Assume a fixed price per clip — it depends on resolution and billing unit
- Hardcode private keys
- Use ethers v5 syntax
Code Examples
Generate a Clip End to End
import { ethers } from 'ethers';
import { createZGComputeNetworkBroker } from '@0gfoundation/0g-compute-ts-sdk';
import * as fs from 'fs';
import 'dotenv/config';
interface VideoJob {
id: string;
status: string; // 'queued' | 'in_progress' | 'completed' | 'failed' | ...
error?: { message?: string };
}
async function generateVideo(
prompt: string,
outputPath: string,
opts: { seconds?: number; size?: string } = {},
): Promise<string> {
const provider = new ethers.JsonRpcProvider(process.env.RPC_URL);
const wallet = new ethers.Wallet(process.env.PRIVATE_KEY!, provider);
const broker = await createZGComputeNetworkBroker(wallet);
const providerAddress = process.env.PROVIDER_ADDRESS!;
// Video is expensive — refuse to submit if the ledger is thin.
const led = await broker.ledger.getLedger();
console.log(`available: ${ethers.formatEther(led.availableBalance)} 0G`);
const { endpoint, model } = await broker.inference.getServiceMetadata(providerAddress);
const headers = await broker.inference.getRequestHeaders(providerAddress, prompt);
// 1. Submit
const submit = await fetch(`${endpoint}/videos`, {
method: 'POST',
headers: { 'Content-Type': 'application/json', ...headers },
body: JSON.stringify({
model,
prompt,
seconds: opts.seconds ?? 5,
size: opts.size ?? '720p',
}),
});
if (!submit.ok) {
throw new Error(`Video submit failed: HTTP ${submit.status} ${await submit.text()}`);
}
const job: VideoJob = await submit.json();
console.log(`job ${job.id} submitted (status=${job.status})`);
// 2. Poll. Generation takes minutes, so poll slowly with a hard timeout.
const pollMs = 10_000;
const timeoutMs = 15 * 60_000;
const startedAt = Date.now();
let current = job;
while (current.status !== 'completed') {
if (current.status === 'failed') {
throw new Error(`Video job failed: ${current.error?.message ?? 'unknown error'}`);
}
if (Date.now() - startedAt > timeoutMs) {
throw new Error(`Video job ${job.id} timed out after ${timeoutMs / 60_000} minutes`);
}
await new Promise((r) => setTimeout(r, pollMs));
// Re-sign: headers are per-request
const pollHeaders = await broker.inference.getRequestHeaders(providerAddress);
const poll = await fetch(`${endpoint}/videos/${job.id}`, { headers: { ...pollHeaders } });
if (!poll.ok) throw new Error(`Poll failed: HTTP ${poll.status}`);
current = await poll.json();
console.log(` status=${current.status}`);
}
// 3. Download the MP4
const dlHeaders = await broker.inference.getRequestHeaders(providerAddress);
const content = await fetch(`${endpoint}/videos/${job.id}/content`, {
headers: { ...dlHeaders },
});
if (!content.ok) throw new Error(`Download failed: HTTP ${content.status}`);
const bytes = Buffer.from(await content.arrayBuffer());
fs.writeFileSync(outputPath, bytes);
console.log(`wrote ${bytes.length} bytes to ${outputPath}`);
// NOTE: no processResponse() — it throws for `video-generation`.
return outputPath;
}Image-to-Video
Pass a reference image via input_reference. The models accept text and image input.
async function animateImage(prompt: string, referenceUrl: string, outputPath: string) {
const provider = new ethers.JsonRpcProvider(process.env.RPC_URL);
const wallet = new ethers.Wallet(process.env.PRIVATE_KEY!, provider);
const broker = await createZGComputeNetworkBroker(wallet);
const providerAddress = process.env.PROVIDER_ADDRESS!;
const { endpoint, model } = await broker.inference.getServiceMetadata(providerAddress);
const headers = await broker.inference.getRequestHeaders(providerAddress, prompt);
const submit = await fetch(`${endpoint}/videos`, {
method: 'POST',
headers: { 'Content-Type': 'application/json', ...headers },
body: JSON.stringify({
model,
prompt,
input_reference: referenceUrl,
seconds: 5,
size: '720p',
}),
});
if (!submit.ok) throw new Error(`Submit failed: HTTP ${submit.status}`);
return submit.json();
}Estimate Cost Before Submitting
// See the Models section above for why `pricing` needs widening.
interface VideoPricingVariant {
dimensions?: Record<string, string>;
unit: 'video_token' | 'video_second';
unit_price: string;
}
interface VideoPricing {
video_unit?: 'video_token' | 'video_second';
variants?: VideoPricingVariant[];
}
async function estimateCost(providerAddress: string, seconds: number, resolution: string) {
const provider = new ethers.JsonRpcProvider(process.env.RPC_URL);
const wallet = new ethers.Wallet(process.env.PRIVATE_KEY!, provider);
const broker = await createZGComputeNetworkBroker(wallet);
const { models } = await broker.inference.getProviderModels(providerAddress);
const m = models[0];
const pricing = m.pricing as VideoPricing | undefined;
const variants = pricing?.variants ?? [];
const variant = variants.find((v) => v.dimensions?.resolution === resolution);
if (!variant) {
console.log(
`No variant for ${resolution}; known:`,
variants.map((v) => v.dimensions?.resolution),
);
return null;
}
// 'video_second' bills per generated second; 'video_token' bills on the
// vendor-reported token count, which you cannot know ahead of time.
if (variant.unit === 'video_second') {
const total = BigInt(variant.unit_price) * BigInt(seconds);
console.log(`~${ethers.formatEther(total)} 0G for ${seconds}s at ${resolution}`);
return total;
}
console.log(`${m.id} bills per ${variant.unit}; exact cost is known only after generation`);
return null;
}Anti-Patterns
// BAD: processResponse() for video — throws "Unknown service type"
await broker.inference.processResponse(providerAddress, chatID, '');
// BAD: expecting video bytes from the submit call
const submit = await fetch(`${endpoint}/videos`, { method: 'POST', ... });
fs.writeFileSync('out.mp4', Buffer.from(await submit.arrayBuffer())); // it's a JSON job
// BAD: tight polling loop — hammers the provider and can trip rate limits
while (job.status !== 'completed') {
job = await (await fetch(`${endpoint}/videos/${job.id}`)).json();
}
// BAD: submitting a long 2K clip while developing (can cost tens of 0G)
body: JSON.stringify({ model, prompt, seconds: 15, size: '2K' });Common Errors & Fixes
| Error | Cause | Fix |
Unknown service type | processResponse() on a video service | Do not call it for video-generation |
Job status: failed | Prompt rejected or vendor error | Read error.message; simplify the prompt |
| Poll never completes | Clip still rendering | Poll slowly; allow many minutes, set timeout |
| HTTP 402 / insufficient | Sub-account cannot cover the clip | Top up; video costs far more than chat |
AccountNotExists | acknowledged() before sub-account existed | Use checkProviderSignerStatus() first |
Related Skills
- Provider Discovery — find providers and read pricing variants
- Account Management — funding (budget carefully here)
- Text to Image — cheaper, synchronous stills
- Compute + Storage — archive clips on 0G Storage
References
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

