CLI tool for image editing and generation via Cloudflare Workers AI
Project description
imageflare
A command-line tool for generating and editing images using Cloudflare Workers AI — directly from your terminal, no server required. Works on Windows, macOS, and Linux.
Features
- Generate images from text prompts using state-of-the-art AI models
- Edit existing images with a text prompt (img2img)
- Multi-reference support — supply up to 3 additional reference images for style/content
- Dynamic model list — fetches available models live from your Cloudflare account
- Interactive config wizard — guided first-run setup for credentials and model selection
- Spinner feedback, seed control, auto-open output, and configurable output path
Installation
Requirements: Python 3.8+ and a Cloudflare account with Workers AI access (free tier available).
macOS / Linux
pip install imageflare
Windows
pip install imageflare
Tip (Windows): If
imageflareis not found after installing, your Python Scripts folder may not be on your PATH. Either usepython -m imageflareas a drop-in replacement, or add the Scripts folder to your PATH:
- Open Start → Edit the system environment variables → Environment Variables
- Under User variables, edit
Pathand add%APPDATA%\Python\PythonXXX\Scripts
Using a virtual environment (recommended)
macOS / Linux
python3 -m venv .venv
source .venv/bin/activate
pip install imageflare
Windows (Command Prompt)
python -m venv .venv
.venv\Scripts\activate.bat
pip install imageflare
Windows (PowerShell)
python -m venv .venv
.venv\Scripts\Activate.ps1
pip install imageflare
Quick Start
The imageflare command works identically on all platforms:
# Step 1 — configure your credentials (one time)
imageflare config
# Generate an image from a prompt
imageflare generate --prompt "a red fox sitting on a snow-covered log"
# Edit an existing image
imageflare edit photo.jpg --prompt "make it look like a watercolor painting"
# Edit with a style reference image
imageflare edit photo.jpg --prompt "apply this style" --ref style.png
# Save to a specific path and open immediately after
imageflare generate --prompt "sunset over mountains" --output sunset.png --open
Configuration
Credentials are stored in a config file. The location varies by OS:
| OS | Config file location |
|---|---|
| Linux | ~/.config/imageflare/config |
| macOS | ~/.config/imageflare/config |
| Windows | %APPDATA%\imageflare\config |
imageflare config # interactive setup wizard
imageflare config show # view current settings
imageflare config models # list available AI models
imageflare config set --account-id YOUR_ID --api-token YOUR_TOKEN
imageflare config set --model "@cf/black-forest-labs/flux-1-schnell"
Getting credentials:
| Credential | Where to find it |
|---|---|
| Account ID | Cloudflare dashboard → right sidebar of any page |
| API Token | My Profile → API Tokens → Create Token — select the Workers AI template or grant Workers AI: Read permission |
Commands
imageflare generate
Generate an image from a text prompt.
Usage: imageflare generate [OPTIONS]
Options:
-p, --prompt TEXT Description of the image to generate [required]
-m, --model TEXT Cloudflare Workers AI model ID
--width INTEGER Output width in pixels [default: 1024]
--height INTEGER Output height in pixels [default: 1024]
--seed INTEGER Random seed for reproducible results
-o, --output PATH Output file path [default: imageflare_<timestamp>.png]
--open Open the saved image automatically
-h, --help Show this message and exit
imageflare edit
Edit an existing image using a text prompt.
Usage: imageflare edit IMAGE_PATH [OPTIONS]
Arguments:
IMAGE_PATH Path to the input image [required]
Options:
-p, --prompt TEXT Editing instruction [required]
-r, --ref PATH Additional reference image (repeatable, up to 3)
-m, --model TEXT Cloudflare Workers AI model ID
--width INTEGER Output width in pixels [default: 1024]
--height INTEGER Output height in pixels [default: 1024]
--seed INTEGER Random seed for reproducible results
-o, --output PATH Output file path [default: imageflare_<timestamp>.png]
--open Open the saved image automatically
-h, --help Show this message and exit
Windows path tip: Use forward slashes or wrap paths in quotes if they contain spaces:
imageflare edit "C:\Users\You\Pictures\photo.jpg" --prompt "turn it into a sketch"
imageflare config
Usage: imageflare config [COMMAND]
Commands:
(no command) Launch the interactive setup wizard
show Print current credentials and settings
models List all available Workers AI image models
set Update one or more settings non-interactively
Options for `config set`:
--account-id TEXT Cloudflare account ID
--api-token TEXT Cloudflare API token
--model TEXT Default model ID
Models
imageflare works with any Cloudflare Workers AI text-to-image model. Once credentials are configured, the live model list is fetched automatically from the API.
Run imageflare config models to see everything available on your account.
Default model: @cf/black-forest-labs/flux-2-klein-4b
How It Works
- You provide a prompt (and optionally an input image for editing)
imageflaresends the request to the Cloudflare Workers AI REST API using your credentials- The generated image is returned and saved locally — no intermediate servers, no data retained
Contributing
Issues and pull requests are welcome at github.com/Sallytion/Imageflare.
License
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file imageflare-1.0.1.tar.gz.
File metadata
- Download URL: imageflare-1.0.1.tar.gz
- Upload date:
- Size: 12.1 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
fcb38e32403baecf883a0e87bf2556a87e52bb62325d38147ffe50f4e64d27b2
|
|
| MD5 |
16ce8ace68d6235ee7b8615812bc7771
|
|
| BLAKE2b-256 |
e75fc84959a39719f0931cfe96777b719426a0726d4f803377f1f80b28f98c35
|
Provenance
The following attestation bundles were made for imageflare-1.0.1.tar.gz:
Publisher:
publish.yml on Sallytion/ImageFlare
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
imageflare-1.0.1.tar.gz -
Subject digest:
fcb38e32403baecf883a0e87bf2556a87e52bb62325d38147ffe50f4e64d27b2 - Sigstore transparency entry: 1083117627
- Sigstore integration time:
-
Permalink:
Sallytion/ImageFlare@acaab86a450c145ce7ca556ce1b65569cf820f3a -
Branch / Tag:
refs/tags/v1.0.1 - Owner: https://github.com/Sallytion
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@acaab86a450c145ce7ca556ce1b65569cf820f3a -
Trigger Event:
release
-
Statement type:
File details
Details for the file imageflare-1.0.1-py3-none-any.whl.
File metadata
- Download URL: imageflare-1.0.1-py3-none-any.whl
- Upload date:
- Size: 10.5 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
4ecd2805a7b912284b523d5cba0ae89893d840a96e1f2b41c3ab0eaa0db3ccd5
|
|
| MD5 |
305ddc9df6163e7ca71330f6a755491f
|
|
| BLAKE2b-256 |
3f2858d91ec30745bc5ec1a42c6b6558c5fc177006f45abfd64065a06ca3095d
|
Provenance
The following attestation bundles were made for imageflare-1.0.1-py3-none-any.whl:
Publisher:
publish.yml on Sallytion/ImageFlare
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
imageflare-1.0.1-py3-none-any.whl -
Subject digest:
4ecd2805a7b912284b523d5cba0ae89893d840a96e1f2b41c3ab0eaa0db3ccd5 - Sigstore transparency entry: 1083117700
- Sigstore integration time:
-
Permalink:
Sallytion/ImageFlare@acaab86a450c145ce7ca556ce1b65569cf820f3a -
Branch / Tag:
refs/tags/v1.0.1 - Owner: https://github.com/Sallytion
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@acaab86a450c145ce7ca556ce1b65569cf820f3a -
Trigger Event:
release
-
Statement type: