Skip to main content

CLI tool for image editing and generation via Cloudflare Workers AI

Project description

imageflare

A CLI tool for image editing and generation powered by Cloudflare Workers AI.

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
  • Dynamic model list — fetches available models live from your Cloudflare account
  • Interactive config wizard — first-run setup guides you through credentials and model selection
  • Spinner feedback, seed control, auto-open output, configurable output path

Installation

pip install imageflare

Requires Python 3.8+ and a Cloudflare account with Workers AI access.

Quick Start

# First-time setup (interactive wizard)
imageflare config

# Generate an image
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 extra reference images
imageflare edit photo.jpg --prompt "apply this style" --ref style.png

# Specify output path and open after saving
imageflare generate --prompt "sunset over mountains" --output sunset.png --open

Configuration

Credentials are stored at ~/.config/imageflare/config.

imageflare config            # interactive 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"

You'll need:

  • Account ID — found on your Cloudflare dashboard (right sidebar)
  • API Token — create one at My Profile → API Tokens with Workers AI: Read permission

Commands

generate

Generate an image from a text prompt.

imageflare generate [OPTIONS]

  -p, --prompt TEXT       Description of the image to generate  [required]
  -m, --model TEXT        Model ID to use
      --width INTEGER     Output width in pixels (default: 1024)
      --height INTEGER    Output height in pixels (default: 1024)
      --seed INTEGER      Random seed for reproducibility
  -o, --output PATH       Output file path (default: imageflare_<timestamp>.png)
      --open              Open the image after saving

edit

Edit an existing image using a text prompt.

imageflare edit IMAGE_PATH [OPTIONS]

  -p, --prompt TEXT       Editing instruction  [required]
  -r, --ref PATH          Additional reference image (up to 3, repeatable)
  -m, --model TEXT        Model ID to use
      --width INTEGER     Output width in pixels (default: 1024)
      --height INTEGER    Output height in pixels (default: 1024)
      --seed INTEGER      Random seed for reproducibility
  -o, --output PATH       Output file path (default: imageflare_<timestamp>.png)
      --open              Open the image after saving

config

imageflare config                         # interactive setup wizard
imageflare config show                    # print current settings
imageflare config models                  # list available models
imageflare config set --model MODEL_ID    # update a single setting
imageflare config set --account-id ID --api-token TOKEN

Models

imageflare works with any Cloudflare Workers AI text-to-image model. Your live model list is fetched automatically from the API once credentials are configured.

Default model: @cf/black-forest-labs/flux-2-klein-4b

License

MIT

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

imageflare-1.0.0.tar.gz (9.9 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

imageflare-1.0.0-py3-none-any.whl (9.4 kB view details)

Uploaded Python 3

File details

Details for the file imageflare-1.0.0.tar.gz.

File metadata

  • Download URL: imageflare-1.0.0.tar.gz
  • Upload date:
  • Size: 9.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.12.3

File hashes

Hashes for imageflare-1.0.0.tar.gz
Algorithm Hash digest
SHA256 53931dbd46ab707f95942f865ee363e5c5e27b6e7590e9d4636bb76fbb6a2380
MD5 e1148a853c9dddd08f64804db8091b98
BLAKE2b-256 409aad1d623c01538ffba0243837b78a1df161a6c28bea20748acc0e0a2d13c0

See more details on using hashes here.

File details

Details for the file imageflare-1.0.0-py3-none-any.whl.

File metadata

  • Download URL: imageflare-1.0.0-py3-none-any.whl
  • Upload date:
  • Size: 9.4 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.12.3

File hashes

Hashes for imageflare-1.0.0-py3-none-any.whl
Algorithm Hash digest
SHA256 56445c7927b347ffb37da59af61c7e05637e139479d07c0767857461511335ca
MD5 ffdbf3fd0bea21ae49c615c7a697bc8b
BLAKE2b-256 4b56604b56e94e0fd7db51416ce2b82524443711e8d29aab3160ff8a10f6e054

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page