Rules
- Use
scripts/generate-image.ts; check--helpwhen needed. - Defaults:
generate→xai/grok-imagine-image/v2.0/text-to-image;edit→xai/grok-imagine-image/v2.0/edit. editrequirespromptand 1–3image_urls; upload local references first.- Override
--endpointonly when the user requests another model; runschemabefore unfamiliar fields or endpoints. - Never read or expose
.envorFAL_KEYvalues. - Generation is billable: clarify ambiguous requests and never blindly resubmit an uncertain request.
- Inspect outputs; composite official marks from real assets.
Commands
bun run scripts/generate-image.ts --help
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 upload --file ./reference.png
bun run scripts/generate-image.ts edit --input '{"prompt":"make the sky stormy","image_urls":["<uploaded-url>"]}'
generate and edit queue, poll, and download to a temporary directory by default. Retain the reported endpoint and request ID to resume a job.