Communitygithub.com

VisionCraft Skill

AI image and video generation integrated with Claude/SKILL via Agnes AI APIs.

What is VisionCraft Skill?

The VisionCraft skill enables AI agents like Claude Code or Cursor to generate images and videos directly through Agnes AI APIs by invoking PowerShell scripts. It supports text-to-image, image-to-image, text-to-video, image-to-video, multi-image video blending, and keyframe animation modes. The API key is read from the `AGNES_API_KEY` environment variable, which must be set once. The skill provides a structured workflow: identify the user's request (e.g., "draw a picture" or "animate this video"), refine the prompt if needed, run the appropriate script with optional parameters like aspect ratio (`-Ratio`) and duration (`-Seconds`), and surface the resulting media URL. Output is formatted with a `MEDIA:<url>` line for easy integration. Troubleshooting guidance is included for common errors like missing API keys or service unavailability. Reference files offer detailed API docs, prompt-writing tips, and parameter examples. The skill is designed for platforms that support executing PowerShell scripts and reading environment variables.

Works with✓Claude Code~Codex CLI~Cursor
npx skills add BAI-32/visioncraft-skill

Ask in your favorite AI

Open a new chat with this agent skill pre-loaded.

Documentation

VisionCraft

Generate images and videos via Agnes AI APIs. Calls PowerShell scripts in scripts/. API key is read from environment variable AGNES_API_KEY.

First time? See Prerequisites. For prompt-writing tips and parameter details, see references/.

Quick Reference

TaskCommand
Text-to-Imagescripts/gen_image.ps1 -Prompt "..."
Image-to-Imagescripts/gen_image.ps1 -Prompt "..." -ImageUrl "https://..."
Text-to-Videoscripts/gen_video.ps1 -Prompt "..."
Image-to-Videoscripts/gen_video.ps1 -Prompt "..." -Image "https://..."
Multi-image Videoscripts/gen_video.ps1 -Prompt "..." -Image "https://a.png","https://b.png"
Keyframes Animationscripts/gen_video.ps1 -Prompt "..." -Image "https://a.png","https://b.png" -Mode keyframes

Defaults: Images 2048x2048. Videos 1920x1080 @ 60fps, 241 frames (~4s).

Prerequisites

Set the API key once (persists across sessions):

[System.Environment]::SetEnvironmentVariable("AGNES_API_KEY", "sk-your-key-here", "User")

Or for the current session only:

$env:AGNES_API_KEY = "sk-your-key-here"

Verify with echo $env:AGNES_API_KEY.

How to Use This Skill

1. Identify the request

User saysMode
"make/draw/generate a picture of..."Text-to-Image
"edit/transform/restyle this image..." (URL provided)Image-to-Image
"make a video / animate / generate a clip of..."Text-to-Video
"animate this photo / make this image move" (1 image)Image-to-Video
"blend these images into a video" (multiple images)Multi-image Video
"smooth transition / morph from A to B" (2+ images)Keyframes Animation

2. Refine the prompt if needed

If the request is vague, briefly suggest a richer prompt before running. For prompt structure and best practices see references/prompt-guide.md.

3. Run the script

Pass aspect ratio with -Ratio and duration with -Seconds for the simplest control. See references/parameters.md for all parameters.

# Examples:
scripts/gen_image.ps1 -Prompt "..." -Ratio 16:9
scripts/gen_video.ps1 -Prompt "..." -Ratio 9:16 -Seconds 8

4. Surface the result

The scripts print a MEDIA:<url> line on success. Always echo the URL on its own line — never bury it in a paragraph. If the platform supports inline media rendering, embed it; otherwise the URL alone is enough.

Never download the result to local disk unless the user explicitly asks.

Output Format

Image:

✅ Image generated.

MEDIA:https://platform-outputs.agnes-ai.space/images/...

Video:

🎬 Video generated (4.0s, 1920x1080).

MEDIA:https://platform-outputs.agnes-ai.space/videos/...

Errors & Troubleshooting

ErrorFix
AGNES_API_KEY not setSet it (see Prerequisites). Restart terminal if needed.
401 UnauthorizedAPI key invalid or expired.
400 Bad RequestCheck prompt, size format, frame count rule (8n+1, ≤441).
503 Service UnavailableService busy. Wait 30s, retry.
Video timeout (15 min)Script prints the video_id — re-query later, the task is not abandoned.

For full API behavior see references/api_docs.md.

Reference Files

Related Skills