CLI tool
Generate images
Hand the tool a prompt, get a bitmap. Size, format and reference images are all optional.
# simplest
$ chatgpt-imagegen "an orange cat on a windowsill, watercolor"
# size, format and output path
$ chatgpt-imagegen "minimal tech poster" --size 1536x1024 --format png -o poster.png1024x1024 (square), 1536x1024 (landscape), 1024x1536 (portrait). Up to 4 reference images per run.Image-to-image (editing)
Pass a reference with -i / --ref to edit it instead of generating from text — like dragging an image into the ChatGPT composer and asking for a restyle. Both backends support it; references are local paths or http(s) URLs, repeat -i for several.
$ chatgpt-imagegen "warm golden-hour photo, cinematic 35mm" -i photo.jpg -o out.pngLooping GIF / WebP
The animate subcommand generates one strict 4×2 sprite sheet, crops eight frames, rejects obvious subject drift, and encodes a smooth loop. Animated WebP is the default; add --also-gif for both. ImageMagick is required, and WebP additionally needs img2webp.
$ chatgpt-imagegen animate "a dog happily wagging its tail" --style-online snoopy --also-gifCommon flags
--backend auto|web|codex · -o PATH · --size · --format png|jpeg|webp · -i/--ref · --style NAME · --quiet. Full list: chatgpt-imagegen --help.
Pin a look once, reuse it.
Use styles others tuned.
web/codex and issues.
by 郭立 · Guo Li · leeguoo · Blog · GitHub