image-gen

Generate raster images from prompts using OpenAI, Gemini, Imagen, and fal.ai provider scripts.

1|Updated Nov 11, 2012
One-click install
npx skills add https://github.com/fairchild/dotfiles --skill image-gen-fairchild
Or copy as Structured Prompt for Agent▼
Please help me install this Agent Skill.
Skill: image-gen
Source: https://github.com/fairchild/dotfiles/tree/main/agents/shared/first-party-skills/image-gen
Command: npx skills add https://github.com/fairchild/dotfiles --skill image-gen-fairchild

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill requires fal-client, requests, google-genai, playwright, and includes scripts (resource) and references (resource) and assets (resource) components.

What problem does it solve? Turning a text prompt into an actual image file requires juggling multiple provider APIs, keys, and output formats. This Skill wraps OpenAI GPT Image, Google Gemini/Nano Banana, Google Imagen, and fal.ai FLUX behind one consistent command pattern so an agent can produce a real image file and return its path. ## Core Features & Use Cases - Multi-provider generation: Executable UV scripts for OpenAI, Gemini, Imagen, and fal.ai with a shared adapter protocol, common options like --prompt, --output, --model, and --check. - Comparison and review workflow: Run model comparisons with run_examples.py, rank candidates in a local review gallery, and validate the gallery UI with a Playwright-based evaluator. - Local history and privacy controls: Successful generations are logged to a gitignored generations.jsonl, with IMAGE_GEN_DISABLE_HISTORY and IMAGE_GEN_OUTPUT_DIR for sensitive prompts. - Use Case: Ask for a launch poster, and the agent runs generate_gemini.py with a 16:9 aspect ratio, saves the PNG, and renders the resulting image inline. ## Quick Start Generate an image of a cat wearing a top hat and show me the result.

Frequently Asked Questions about image-gen

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I generate an image from a text prompt with Python scripts?▼

Run one of the executable provider scripts with --prompt and --output, for example generate_openai.py --prompt "a cat wearing a top hat" --output /tmp/cat.png. The script calls the provider API, saves the image, and prints the resolved output path as its final stdout line.

Which image generation provider should I use: OpenAI, Gemini, Imagen, or fal.ai?▼

OpenAI gpt-image-2 is the general default, Gemini Nano Banana models handle complex or text-heavy visuals with 1K/2K/4K sizes, Imagen 4 is available but listed with a 2026-06-30 discontinuation date, and fal.ai provides FLUX.2 endpoints with seed and guidance controls.

What API keys are required for OpenAI, Gemini, and fal.ai image generation?▼

OpenAI needs OPENAI_API_KEY, Google Gemini and Imagen need GOOGLE_API_KEY or GEMINI_API_KEY, and fal.ai needs FAL_KEY. Scripts read exported variables first, then simple KEY=value lines from .env in the current directory and ~/.env.

Can I validate API keys without paying for image generation?▼

Yes, each provider script supports a --check flag that validates configuration without generating an image, and --protocol prints adapter metadata without any API keys. The check_protocol.py script verifies all provider adapters for free.

How do I keep sensitive image generation prompts out of local history?▼

Set IMAGE_GEN_DISABLE_HISTORY=1 before running a provider script to skip logging to generations.jsonl. You can also relocate outputs and history with IMAGE_GEN_OUTPUT_DIR and IMAGE_GEN_DATA_DIR.