Generate Image
Rules
- Use
scripts/generate-image.ts. - Default endpoint:
openai/gpt-image-2. Change--endpointonly if the user asks. - Run
schemabefore non-trivial payloads. - Never read or print
.env/FAL_KEYvalues. - Image-only.
Setup
cp .env.example .env # from this skill directory
# set FAL_KEY=...
The script loads this skill's .env automatically. Exported env wins.
Workflow
auth-checkif credentials are uncertain.schemafor non-trivial inputs.generatewith JSON input.- Inspect downloaded files before using them.
- For official logos/marks: generate scene only, composite real assets locally.
Commands
bun run scripts/generate-image.ts auth-check
bun run scripts/generate-image.ts schema
bun run scripts/generate-image.ts generate \
--input '{"prompt":"editorial photo of a red fox in Tokyo at night"}'
bun run scripts/generate-image.ts generate \
--input-file ./input.json \
--output-dir ./out
bun run scripts/generate-image.ts upload --file ./ref.png
Defaults: queue + poll, download images to a temp dir. Useful flags: --output-dir, --no-download, --logs, --json, --save.
Failures
- 401 / missing key → set
FAL_KEY, runauth-check - 422 → run
schema, fix payload - non-image endpoint → rejected
- COMPLETED + error → fix input or retry