CLI tool for generating and editing images using popular AI models.
Supported Providers
OpenAI: gpt-image-1, gpt-image-1.5
Gemini: gemini-2.5-flash-image, gemini-3-pro-image-preview, gemini-3.1-flash-image-preview
FLUX (Black Forest Labs): flux-kontext-pro, flux-kontext-max, flux-2-pro, flux-2-pro-preview, flux-2-flex
Setup
Picasso is bring-your-own-token — you provide API keys for the providers you want to use. You only need keys for the providers you plan to use.
npm install cp .env.example .env
Add your API keys to .env:
OPENAI_API_KEY=your_key_here
GEMINI_API_KEY=your_key_here
BFL_API_KEY=your_key_here
Usage
Text to Image
Generate an image from a text prompt:
node textToImage.js <output_file> "prompt" [options]
Edit Image
Edit one or more existing images using a text prompt:
node editImage.js <input_file> [input_file2 ...] <output_file> "prompt" [options]
You can provide multiple input images. The last two positional arguments are always the output file and prompt, and everything before them is treated as source images.
Options
| Flag | Description |
|---|---|
--model <model> |
Model to use (default: gpt-image-1.5) |
--size <size> |
Image dimensions (aspect ratio for FLUX, e.g. 16:9) |
--quality <quality> |
Image quality (OpenAI only) |
--background <background> |
Background style (OpenAI only) |
--open |
Open the image after generation |
--models |
List available models and exit |
--sizes |
List available sizes by provider and exit |
Examples
Generate an image from a prompt:
node textToImage.js output/sunset.png "a dramatic sunset over the ocean" --openEdit an image:
node editImage.js source.png output/edited.png "make the sky purple" --openUse a specific model:
node editImage.js source.png output/edited.png "make the sky purple" --model gemini-2.5-flash-imageSpecify size and quality:
node editImage.js source.png output/edited.png "add a sunset" --size 1536x1024 --quality highUse a FLUX model:
node textToImage.js output/city.png "cyberpunk cityscape at night" --model flux-2-pro --size 16:9Use multiple input images:
node editImage.js room.jpg reference.jpg output/restyled.png "restyle the first room to match the second"