Metadata-Version: 2.4
Name: imageflare
Version: 1.0.0
Summary: CLI tool for image editing and generation via Cloudflare Workers AI
License: MIT
Project-URL: Homepage, https://github.com/Sallytion/Imageflare
Project-URL: Bug Tracker, https://github.com/Sallytion/Imageflare/issues
Keywords: cloudflare,workers-ai,image-generation,image-editing,ai,cli,stable-diffusion,flux
Classifier: Development Status :: 4 - Beta
Classifier: Environment :: Console
Classifier: Intended Audience :: Developers
Classifier: Intended Audience :: End Users/Desktop
Classifier: License :: OSI Approved :: MIT License
Classifier: Operating System :: OS Independent
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.8
Classifier: Programming Language :: Python :: 3.9
Classifier: Programming Language :: Python :: 3.10
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Classifier: Topic :: Multimedia :: Graphics
Classifier: Topic :: Scientific/Engineering :: Artificial Intelligence
Classifier: Topic :: Utilities
Requires-Python: >=3.8
Description-Content-Type: text/markdown
Requires-Dist: click>=8.0
Requires-Dist: requests>=2.28
Requires-Dist: pillow>=9.0

# imageflare

A CLI tool for image editing and generation powered by [Cloudflare Workers AI](https://developers.cloudflare.com/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

```bash
pip install imageflare
```

Requires Python 3.8+ and a [Cloudflare account](https://dash.cloudflare.com) with Workers AI access.

## Quick Start

```bash
# 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`.

```bash
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](https://dash.cloudflare.com) (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
