Skip to content
Aayush9029Public

About

OpenAI image generation for the terminal — streaming, parallel, stdin-friendly

Resources

Stars

0 stars

Watchers

0 watching

Forks

Latest commit

 

History

10 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

pix

pix

OpenAI image generation & editing for the terminal — live streaming, parallel, image-to-image.

Release License

Install

brew install aayush9029/tap/pix

Requires OPENAI_API_KEY in your environment. Defaults to gpt-image-2.5-sunburst.

Usage

pix "a corgi astronaut on mars, cinematic"
pix -n 4 --progress "isometric tiny village"
echo "neon koi fish" | pix -s landscape -q high
pix -s 4k -q max "misty fjord at dawn"
pix -b "studio ghibli style" -p "rainy train station"
pix -i photo.png "make it cyberpunk, neon rain"
pix -i a.png -i b.png --transparent "merge them into a single sticker"

Images save as <sanitized-prompt>-<timestamp>[-vN].<ext> and update in place as partial frames stream in — open the file once and watch it sharpen.

Options

Option Description
-m, --model <id> gpt-image-2.5-sunburst (default), gpt-image-2.5-flare (faster), gpt-image-1-mini (cheapest)
-p, --prompt <text> Prompt text (overrides positional / stdin)
-b, --base <text> Base prompt prepended to the main prompt
-i, --image <path> Input image for editing (repeatable, up to 16)
-n <1-10> Variants generated in parallel
-s, --size <size> square / landscape / portrait / 4k / auto / WIDTHxHEIGHT (multiples of 16, ratio up to 3:1, max 3840x2160)
-q, --quality <level> auto / low / medium / high / xhigh / max (xhigh and max need a 2.5 model)
-f, --format <ext> png / jpeg / webp
--compression <0-100> Compression for jpeg / webp
--transparent Transparent background (png / webp only)
-o, --output <dir> Output directory (default .)
--json Emit a JSON summary

How it works

  1. Resolves the prompt from --prompt, positional args, or stdin; optionally prepends --base.
  2. Picks the endpoint: POST /v1/images/generations when there are no -i inputs, POST /v1/images/edits (multipart) otherwise.
  3. Fans out -n parallel goroutines — each variant is an independent streaming API call with partial_images=3 (the cap OpenAI exposes).
  4. Every partial frame and the final image land at the same canonical filename via tempfile + rename, so the file stays valid at all times and viewers that watch file mtime see it refine.

Requirements

macOS, OPENAI_API_KEY exported. All supported models allow streaming, transparency, and image-to-image editing.

License

MIT

About

OpenAI image generation for the terminal — streaming, parallel, stdin-friendly

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages