Metadata-Version: 2.1
Name: airunner
Version: 3.0.15
Summary: A Stable Diffusion GUI
Home-page: https://github.com/Capsize-Games/airunner
Author: Capsize LLC
Author-email: contact@capsizegames.com
License: GPL-3.0
Keywords: ai,stable diffusion,art,ai art,stablediffusion
Requires-Python: >=3.10.0
Description-Content-Type: text/markdown
License-File: LICENSE
Requires-Dist: accelerate ==0.33.0
Requires-Dist: huggingface-hub ==0.23.5
Requires-Dist: PySide6 ==6.7.0
Requires-Dist: PySide6-Addons ==6.7.0
Requires-Dist: PySide6-Essentials ==6.7.0
Requires-Dist: tokenizers ==0.19.1
Requires-Dist: torch ==2.4.1
Requires-Dist: torchaudio ==2.4.1
Requires-Dist: torchvision ==0.19.1
Requires-Dist: optimum ==1.21.4
Requires-Dist: numpy ==1.26.4
Requires-Dist: pillow ==10.4.0
Requires-Dist: xformers ==0.0.28.post1
Requires-Dist: tensorflow ==2.17.0
Requires-Dist: DeepCache ==0.1.1
Requires-Dist: alembic ==1.13.3
Requires-Dist: transformers ==4.43.4
Requires-Dist: auto-gptq ==0.7.1
Requires-Dist: bitsandbytes ==0.43.3
Requires-Dist: datasets ==2.21.0
Requires-Dist: sentence-transformers ==3.0.1
Requires-Dist: sounddevice ==0.5.0
Requires-Dist: pyttsx3 ==2.91
Requires-Dist: cryptography ==43.0.1
Requires-Dist: setuptools ==75.1.0
Requires-Dist: diffusers ==0.30.1
Requires-Dist: controlnet-aux ==0.0.9
Requires-Dist: safetensors ==0.4.4
Requires-Dist: compel ==2.0.3
Requires-Dist: tomesd ==0.1.3
Requires-Dist: inflect ==7.3.1
Requires-Dist: pycountry ==24.6.1
Requires-Dist: facehuggershield ==0.1.11
Requires-Dist: llama-index ==0.11.7
Requires-Dist: llama-index-readers-file ==0.2.0
Requires-Dist: llama-index-readers-web ==0.2.1
Requires-Dist: llama-index-llms-huggingface ==0.3.1
Requires-Dist: llama-index-llms-groq ==0.2.0
Requires-Dist: llama-index-embeddings-mistralai ==0.2.0
Requires-Dist: EbookLib ==0.18
Requires-Dist: html2text ==2024.2.26

[![Banner](banner.png)](https://capsizegames.itch.io/ai-runner)
[![Discord](https://img.shields.io/discord/839511291466219541?color=5865F2&logo=discord&logoColor=white)](https://discord.gg/PUVDDCJ7gz)
[![PyPi](https://github.com/Capsize-Games/airunner/actions/workflows/pypi-dispatch.yml/badge.svg)](https://github.com/Capsize-Games/airunner/actions/workflows/pypi-dispatch.yml)
![GitHub](https://img.shields.io/github/license/Capsize-Games/airunner)
![GitHub last commit](https://img.shields.io/github/last-commit/Capsize-Games/airunner)
![GitHub issues](https://img.shields.io/github/issues/Capsize-Games/airunner)
![GitHub closed issues](https://img.shields.io/github/issues-closed/Capsize-Games/airunner)
![GitHub pull requests](https://img.shields.io/github/issues-pr/Capsize-Games/airunner)
![GitHub closed pull requests](https://img.shields.io/github/issues-pr-closed/Capsize-Games/airunner)

---

# AI Runner 


AI Runner is an interface which allows you to run open-source large language models (LLM) and AI image generators (Stable Diffusion) on your own hardware.

It is designed to be easy to use, with a simple and intuitive interface that allows you to run AI models without the need for a web server or cloud service.

It has been optimized for speed and efficiency, allowing you to generate images and have conversations with chatbots in real-time.

## Stable Diffusion

![img.png](img.png)

## Customizable Chatbots with Moods and Personalities

![img_1.png](img_1.png)

---

## ⭐ Features

AI Runner is an AI interface which allows you to run open-source 
large language models (LLM) and AI image generators (Stable Diffusion) on your own hardware.

| Feature                              | Description                                              |
|--------------------------------------|----------------------------------------------------------|
| 🗣️ **LLMs and communication**       |
| Voice-based chatbot conversations    | Have conversations with a chatbot using your voice       |
| Text-to-speech                       | Convert text to spoken audio                             |
| Speech-to-text                       | Convert spoken audio to text                             |
| Customizable chatbots with LLMs      | Generate text using large language models                |
| RAG on local documents and websites  | Interact with your local documents using an LLM          |
| 🎨 **Image Generation**              |
| Stable Diffusion (all versions)      | Generate images using Stable Diffusion                   |
| Drawing tools                        | Turn sketches into art                                   |
| Text-to-Image                        | Generate images from textual descriptions                |
| Image-to-Image                       | Generate images based on input images                    |
| 🖼️ **Image Manipulation**           |
| Inpaint and Outpaint                 | Modify parts of an image while maintaining context       |
| Controlnet                           | Control image generation with additional input           |
| LoRA                                 | Efficiently fine-tune models with LoRA                   |
| Textual Embeddings                   | Use textual embeddings for image generation control      |
| Image Filters                        | Blur, film grain, pixel art and more                     |
| 🔧 **Utility**                       |
| Run offline, locally                 | Run on your own hardware without internet                |
| Fast generation                      | Generate images in ~2 seconds (RTX 2080s)                |
| Run multiple models at once          | Utilize multiple models simultaneously                   |
| Dark mode                            | Comfortable viewing experience in low-light environments |
| Infinite scrolling canvas            | Seamlessly scroll through generated images               |
| NSFW filter toggle                   | Help control the visibility of NSFW content              |
| NSFW guardrails toggle               | Help prevent generation of LLM harmful content           |
| Fully customizable                   | Easily adjust all parameters                             |
| Fast load time, responsive interface | Enjoy a smooth and responsive user experience            |
| Pure python                          | No reliance on a webserver, pure python implementation   |

---

## 💻 System Requirements

#### Minimum system requirements

- OS: Linux
- Processor: Intel i5 or equivalent
- Memory: 16 GB RAM
- Graphics: 2080s RTX or higher
- Network: Broadband Internet connection required for setup
- Storage: 130 GB available space

#### Recommended system specs

- OS: Linux
- Processor: Intel i7 or equivalent
- Memory: 30 GB RAM
- Graphics: 4090 RTX or higher
- Network: Broadband Internet connection required for setup
- Storage: 130 GB available space

---

## 🔧 Running AI Runner from source

Running AI Runner from source is recommended for developers and users who want to test the latest features.

### Linux

Install prerequisites

```bash
sudo apt update
sudo apt install -y fonts-noto-color-emoji
sudo apt install -y libportaudio2
sudo apt install -y libxcb-cursor0
sudo apt install -y espeak
sudo apt install -y xclip
sudo apt install -y git
sudo apt install -y python3-pip
sudo apt install -y python3.10-venv
```

Clone the repository

```bash
git clone https://github.com/Capsize-Games/airunner.git
cd airunner
```

Create a virtual environment

```bash
python3 -m venv airunner
source airunner/bin/activate
```

Install the required packages

```bash
pip install -e .
```

Run AI Runner

```bash
airunner
```

---

## Using AI Runner as a Python library

AI Runner can be used as a Python library in order to extend its functionality.

```bash
pip install airunner
```

Now you can import AI Runner into your Python scripts.

```python
from airunner import airunner
```

---

## Packaging AI Runner

[Detailed packaging instructions can be found in the wiki](https://github.com/Capsize-Games/airunner/wiki/Installation-instructions).

---

## Models

AI Runner installs all of the models required to run a chatbot with text-to-speech and speech-to-text capabilities,
as well as the core models required for Stable Diffusion. However, you must supply your own art generator models.

You can download models from Huggingface.co or civitai.com.

The supported Stable Diffusion models are:

- SD 1.5
- SDXL 1.0
- SDXL Turbo

Models must be placed in their respective directories in the `airunner` directory.
    
```plaintext
~/.local/share/airunner
├── art
│   ├── models
│   │   ├── SD 1.5
│   │   │   ├── lora
│   │   │   └── embeddings
│   │   ├── SDXL 1.0
│   │   │   ├── lora
│   │   │   └── embeddings
│   │   └── SDXL Turbo
│   │       ├── lora
│   │       └── embeddings
```

---

## Privacy and Security

Although AI Runner v3.0 is built with Huggingface libraries, we have taken
care to strip the application of any telemetry or tracking features.

---

### Internet access

Only the setup wizard needs access to the internet in order to download the required models.

For more information see the [Darklock](https://github.com/capsize-games/darklock)  and
[Facehuggershield](https://github.com/capsize-games/facehuggershield) libraries.

---

### Disc access

Write access for the transformers library has been disabled, preventing it from creating a huggingface 
cache directory at runtime.

The application itself may still access the disc for reading and writing, however we have restricted
reads and writes to the user provided `airunner` directory (by default this is located at `~/.local/share/airunner`).

All other attempts to access the disc are blocked and logged for your review.

For more information see `src/security/restrict_os_access.py`.

---

### Huggingface Hub

**_Huggingface Hub  contains telemetry and tracking features that have been completely disabled in AI Runner._**

The security measures taken for this library are as follows

- Prevented from accessing the internet
- Prevented from accessing the disc
- All environment variables set for maximum security
- All telemetry disabled

See [Facehuggershield](https://github.com/capsize-games/facehuggershield) for more information.

---

sudo groupadd docker
