image-gen
Image Generator
Generate or edit images via Maxgent FAL API proxy.
Prerequisites
MAX_API_KEYenvironment variable (auto-injected by Max)- Bun 1.0+ (built into Max)
Default Routing
- Text-to-image (default):
fal-ai/nano-banana-pro - Image editing (default):
fal-ai/nano-banana-pro/edit
Usage
bun skills/image-gen/image-gen.js \
--model MODEL --prompt "PROMPT" --aspect-ratio RATIO \
--num-images N --output-dir DIR \
[--input-image PATH] [--output-format FORMAT] \
[--seed N] [--guidance-scale X] [--steps N]
Parameters:
--model:auto(recommended),gpt-image-1.5,nano-banana-pro,flux-dev--prompt: image description or editing instruction--aspect-ratio:1:1,4:3,3:4,16:9,9:16--num-images: number of images to generate (default1)--output-dir: output directory — default to$MAX_PROJECT_PATH(the user's project root)--input-image: optional, for image editing mode--output-format:png,jpg,webp(defaultpng)--seed: random seed for reproducibility--guidance-scale: guidance scale for supported models--steps: number of inference steps for supported models
Examples
# Default routing, text-to-image
bun skills/image-gen/image-gen.js --model auto --prompt "a cat under the starry sky" --aspect-ratio "1:1" --output-dir "$MAX_PROJECT_PATH"
# Specify model
bun skills/image-gen/image-gen.js --model gpt-image-1.5 --prompt "modern building facade, cinematic" --aspect-ratio "16:9" --num-images 2 --output-dir "$MAX_PROJECT_PATH"
# Image editing
bun skills/image-gen/image-gen.js --model auto --prompt "change background to a beach at sunset" --aspect-ratio "1:1" --output-dir "$MAX_PROJECT_PATH" --input-image "/path/to/input.jpg"
Instructions
- Check that
MAX_API_KEYexists. - Use AskUserQuestion to collect: edit or generate, prompt, aspect ratio, count. Default output path to
$MAX_PROJECT_PATH. - Run the script and wait for result.
- On success, report the output path.
- On failure:
- HTTP 402 (insufficient credits): Stop immediately. Do NOT retry. Tell the user their API credits are exhausted.
- Other errors: retry once with a different model or simplified prompt. If it fails again, stop and report the error.
More from maxgent-ai/maxgent-plugin
audio-transcribe
Speech-to-text transcription using Whisper with word-level timestamps. Use when users ask to transcribe audio or video to text, generate subtitles, or recognize speech.
51memory
Read long-term memory files to get historical context, code references, and error fix records. Use when user wants to read memory, get context, check history, avoid repeating errors.
13video-gen
AI video generation with text-to-video, image-to-video, and first/last frame control. Use when users ask to generate or create videos from text prompts or images.
10youtube-download
Download videos, audio, or subtitles from YouTube, Bilibili, and other sites using yt-dlp. Use when users ask to download online videos or extract audio from video URLs.
9browser
Browser automation with persistent page state. Use when users ask to navigate websites, fill forms, take screenshots, extract web data, test web apps, or automate browser workflows. Trigger phrases include "go to [url]", "click on", "fill out the form", "take a screenshot", "scrape", "automate", "test the website", "log into", or any browser interaction request.
5media-understand
AI-powered media understanding and analysis for images, videos, and audio. Use when users ask to describe, analyze, summarize, or extract text (OCR) from media files.
5