Loading...
Loading...
Generate images with Gemini (default) or fal.ai FLUX.2 klein 4B (--cheap for fast/low-cost). Generate videos with Grok Imagine (default) or fal.ai LTX-2 (--cheap). Use for: create image, generate visual, AI image generation, poster, video generation.
npx skill4agent add aviz85/claude-skills-library image-generation-dposter_0.jpgcd ~/.claude/skills/image-generation/scripts
# ALWAYS specify destination with -d flag
npx tsx generate_poster.ts -d /tmp/my-image.jpg "A futuristic city at sunset"
# Cheap mode: fal.ai FLUX.2 klein 4B (fast, lower cost)
npx tsx generate_poster.ts --cheap -d /tmp/city.jpg "A futuristic city at sunset"
# With aspect ratio
npx tsx generate_poster.ts -d /tmp/landscape.jpg --aspect 3:2 "A wide landscape poster"
npx tsx generate_poster.ts --cheap -d /tmp/story.jpg -a 9:16 "A vertical story format"
# With reference assets (image editing)
npx tsx generate_poster.ts -d /tmp/banner.jpg --assets "/path/to/avatar.jpg" "Create banner with character"
npx tsx generate_poster.ts --cheap -d /tmp/photo.jpg --assets "/path/to/image.jpg" "Turn this into a realistic photo"-d/tmp/poster_0.jpg| Provider | Flag | Use Case | Cost |
|---|---|---|---|
| Gemini | (default) | High quality, best results | Higher |
| fal.ai klein 4B | | Fast, budget-friendly | ~$0.003/image |
--cheapfal-ai/flux-2/klein/4bfal-ai/flux-2/klein/4b/edit--quality-q| Quality | Resolution | Use Case |
|---|---|---|
| 1024px | Default - fast, good for web |
| 2048px | High quality - print, detailed posters |
npx tsx generate_poster.ts -q 2K "High quality poster"--aspect-a| Ratio | Use Case |
|---|---|
| Horizontal (DEFAULT - use this unless user specifies otherwise) |
| Square - Instagram, profile pics |
| Vertical - Pinterest, posters |
| Wide - YouTube thumbnails, headers |
| Tall - Stories, reels, TikTok |
npx tsx generate_poster.ts --aspect 3:2 "Your prompt"
npx tsx generate_poster.ts -a 16:9 "Your prompt"--assets# Single asset
npx tsx generate_poster.ts --assets "/full/path/to/image.jpg" "Your prompt"
# Multiple assets (comma-separated)
npx tsx generate_poster.ts --assets "/path/a.jpg,/path/b.png" "Use both images"
# With cheap mode - uses fal.ai edit endpoint
npx tsx generate_poster.ts --cheap --assets "/path/to/image.jpg" "Turn this into a painting".jpg.jpeg.png.webp.gif--assets--destination-d# REQUIRED: Always specify destination
npx tsx generate_poster.ts -d /tmp/poster.jpg "My poster"
# If file exists, auto-adds suffix: poster_1.jpg, poster_2.jpg, etc._1_2/tmp/scripts/.envGEMINI_API_KEY=your_gemini_api_key
FAL_KEY=your_fal_api_key
XAI_API_KEY=your_xai_api_key"CRITICAL: Layout is RTL (right-to-left). All text in Hebrew. Visual flow, reading order, and panel sequence go from RIGHT to LEFT.""EPIC CINEMATIC WOW: Amazed expression, mind-blown reaction, intense VFX - shattered glass particles, explosive energy bursts, volumetric light rays, dramatic lens flares, particle explosions, motion blur streaks, holographic glitches, electric sparks, cinematic color grading, dramatic rim lighting, depth of field bokeh, anamorphic lens effects. Maximum visual spectacle."-d--aspectcd ~/.claude/skills/image-generation/scripts
# Text-to-video (Grok Imagine - high quality, 720p)
npx tsx generate_video.ts -d /tmp/video.mp4 "A futuristic city at sunset, cinematic drone shot"
# Cheap mode: fal.ai LTX-2 (fast, low cost)
npx tsx generate_video.ts --cheap -d /tmp/video.mp4 "A futuristic city at sunset"
# Image-to-video (animate a still image)
npx tsx generate_video.ts -d /tmp/animated.mp4 --image /path/to/image.jpg "Slow zoom with particles floating"
npx tsx generate_video.ts --cheap -d /tmp/animated.mp4 --image /path/to/image.jpg "Gentle camera movement"
# Custom duration and aspect ratio
npx tsx generate_video.ts -d /tmp/long.mp4 -t 10 -a 9:16 "Vertical video for stories"| Provider | Flag | Quality | Duration | Resolution | Cost |
|---|---|---|---|---|---|
| Grok Imagine | (default) | High, cinematic | 1-15s | 480p/720p | Per-second billing |
| fal.ai LTX-2 | | Good, fast | 1-10s | ~480p | Budget-friendly |
| Option | Flag | Default | Description |
|---|---|---|---|
| Prompt | (positional) | required | Text description of the video |
| Destination | | required | Output file path (.mp4) |
| Duration | | 5 | Duration in seconds |
| Aspect ratio | | 16:9 | 16:9, 9:16, 1:1, 4:3, 3:4, 3:2, 2:3 |
| Resolution | | 720p | 480p or 720p (Grok only) |
| Image source | | none | Source image for image-to-video |
| Cheap mode | | false | Use LTX-2 instead of Grok |