Simple Go CLI for generating branded images.
google/gemini-2.5-flash-imageopenai/gpt-5-image-mini
- Set your OpenRouter API key:
export OPEN_ROUTER_API_KEY=your_key_here- Install dependencies:
make install- Build binaries and web assets:
make buildOptional frontend lint + type-check:
make web-lint
make web-typecheckGenerate with both models:
./imagegen -prompt "A clean launch announcement banner for a fintech app"Generate with a single model and brand directory:
./imagegen \
-prompt "Hero image for homepage, modern and friendly" \
-brand-dir ./brand \
-model openai \
-image-size 2K \
-aspect-ratio 3:2 \
-out ./generated-prompt(required): short image prompt-brand-dir(optional): directory with text files describing brand guidelines-model:google,openai, orboth(default:both)-out: output directory (default:output)-image-size: image size1K,2K, or4K(default:1K, used by Gemini image model)-aspect-ratio: optional ratio:1:1,2:3,3:2,3:4,4:3,4:5,5:4,9:16,16:9,21:9-n: number of images per selected model (default:1)-output-format: output formatjpg,png,webp, orico(default:jpg)-ico-sizes: comma-separated ICO sizes from16x16,32x32,48x48(default:16x16,32x32,48x48)
- The CLI reads non-binary UTF-8 files from
-brand-dir(top-level only). - Files larger than 512KB are skipped.
- Generated files are saved with model + UTC timestamp in the filename.
- When
-output-format icois used, generation is forced to1:1and encoded with the sizes selected in-ico-sizes.
Run the local web app server in dev mode (builds first):
make devOptional overrides:
make dev ADDR=:9090 DATA_DIR=/tmp/imagegen-devDirect run after make build:
./imagegen-web -addr :8080 -data-dir ~/.imagegenWeb app persistence:
- SQLite metadata database:
~/.imagegen/imagegen.db - Generated image files:
~/.imagegen/images/...
Long-running generate actions are processed asynchronously:
- Submit from a work item page
- Track status in
/jobs - Inspect failures in
/jobs/{id}