Metadata-Version: 2.4
Name: diffused
Version: 0.1.14
Summary: Generate images with diffusion models
Author-email: Mark <mark@remarkablemark.org>
License-Expression: MIT
Project-URL: Homepage, https://github.com/ai-action/diffused
Project-URL: Issues, https://github.com/ai-action/diffused/issues
Classifier: Programming Language :: Python :: 3
Classifier: Operating System :: OS Independent
Requires-Python: >=3.8
Description-Content-Type: text/markdown
License-File: LICENSE
Requires-Dist: accelerate>=1.5.0
Requires-Dist: diffusers>=0.32.0
Requires-Dist: torch>=2.6.0
Requires-Dist: transformers>=4.50.0
Provides-Extra: build
Requires-Dist: build==1.2.2.post1; extra == "build"
Requires-Dist: pyinstaller==6.12.0; extra == "build"
Requires-Dist: twine==6.1.0; extra == "build"
Provides-Extra: docs
Requires-Dist: pdoc==15.0.1; extra == "docs"
Provides-Extra: lint
Requires-Dist: black==25.1.0; extra == "lint"
Requires-Dist: isort==6.0.1; extra == "lint"
Requires-Dist: pre-commit==4.2.0; extra == "lint"
Requires-Dist: ruff==0.11.2; extra == "lint"
Provides-Extra: test
Requires-Dist: coverage==7.7.1; extra == "test"
Requires-Dist: pytest==8.3.5; extra == "test"
Dynamic: license-file

# diffused

[![PyPI version](https://badgen.net/pypi/v/diffused)](https://pypi.org/project/diffused/)
[![codecov](https://codecov.io/gh/ai-action/diffused/graph/badge.svg?token=fObC6rYkAJ)](https://codecov.io/gh/ai-action/diffused)
[![lint](https://github.com/ai-action/diffused/actions/workflows/lint.yml/badge.svg)](https://github.com/ai-action/diffused/actions/workflows/lint.yml)

🤗 Generate images with diffusion [models](https://huggingface.co/models?pipeline_tag=text-to-image):

```sh
diffused <model> <prompt>
```

## Quick Start

Generate image with [model](https://huggingface.co/segmind/tiny-sd) and prompt:

```sh
pipx run diffused segmind/tiny-sd "portrait of a cat"
```

Generate image with [model](https://huggingface.co/OFA-Sys/small-stable-diffusion-v0), prompt, and filename:

```sh
pipx run diffused OFA-Sys/small-stable-diffusion-v0 "cartoon of a cat" --output cat.png
```

## Prerequisites

- [Python](https://www.python.org/)
- [pipx](https://pipx.pypa.io/)

## Install

CLI:

```sh
pipx install diffused
```

Package:

```sh
pip install diffused
```

## CLI

### `model`

**Required**: Text-to-image diffusion [model](https://huggingface.co/models?pipeline_tag=text-to-image).

```sh
diffused segmind/SSD-1B "An astronaut riding a green horse"
```

### `prompt`

**Required**: Text prompt.

```sh
diffused dreamlike-art/dreamlike-photoreal-2.0 "cinematic photo of Godzilla eating sushi with a cat in a izakaya, 35mm photograph, film, professional, 4k, highly detailed"
```

### `--output`

**Optional**: Generated image filename.

```sh
diffused dreamlike-art/dreamlike-photoreal-2.0 "cat eating sushi" --output cat.jpg
```

```sh
diffused dreamlike-art/dreamlike-photoreal-2.0 "cat eating sushi" -o cat.jpg
```

### `--version`

Show program's version number and exit:

```sh
diffused --version # diffused -v
```

### `--help`

Show help message and exit:

```sh
diffused --help # diffused -h
```

## Package

Generate image with [model](https://huggingface.co/segmind/tiny-sd) and prompt:

```py
# script.py
from diffused import generate

image = generate(model="segmind/tiny-sd", prompt="apple")
image.save("apple.png")
```

## License

[MIT](https://github.com/ai-action/diffused/blob/master/LICENSE)
