Skip to main content

A high-performance, memory-efficient inference server for diffusion models, compatible with the OpenAI client

Project description

Aquiles-Image

Aquiles-Image Logo

Self-hosted image generation with OpenAI-compatible APIs

🚀 FastAPI • Diffusers • Drop-in replacement for OpenAI

Python FastAPI OpenAI Compatible PyPI Version PyPI Downloads Docs Ask DeepWiki

🎯 What is Aquiles-Image?

Aquiles-Image is a production-ready API server that lets you run state-of-the-art image generation models on your own infrastructure. OpenAI-compatible by design, you can switch from external services to self-hosted in under 5 minutes.

Why Aquiles-Image?

Challenge Aquiles-Image Solution
💸 Expensive external APIs Run models locally with unlimited usage
🔒 Data privacy concerns Your images never leave your server
🐌 Slow inference Advanced optimizations for 3x faster generation
🔧 Complex setup One command to run any supported model
🚫 Vendor lock-in OpenAI-compatible, switch without rewriting code

Key Features

  • 🔌 OpenAI Compatible - Use the official OpenAI client with zero code changes
  • ⚡ 3x Faster - Advanced inference optimizations out of the box
  • 🎨 10+ Models - FLUX.1, FLUX.2, SD3.5, and more preconfigured
  • 🛠️ Superior DevX - Simple CLI, dev mode for testing, built-in monitoring
  • 🎬 Experimental Video - Text-to-video generation support (Wan2.2)

🚀 Quick Start

Installation

# From PyPI (recommended)
pip install aquiles-image

# From source
git clone https://github.com/Aquiles-ai/Aquiles-Image.git
cd Aquiles-Image
pip install .

Launch Server

aquiles-image serve --model "stabilityai/stable-diffusion-3.5-medium"

Generate Your First Image

from openai import OpenAI

client = OpenAI(base_url="http://127.0.0.1:5500", api_key="not-needed")

result = client.images.generate(
    model="stabilityai/stable-diffusion-3.5-medium",
    prompt="a white siamese cat",
    size="1024x1024"
)

print(f"Image URL: {result.data[0].url}")

That's it! You're now generating images with the same API you'd use for OpenAI.

🎨 Supported Models

Text-to-Image (/images/generations)

  • stabilityai/stable-diffusion-3-medium
  • stabilityai/stable-diffusion-3.5-medium
  • stabilityai/stable-diffusion-3.5-large
  • stabilityai/stable-diffusion-3.5-large-turbo
  • black-forest-labs/FLUX.1-dev
  • black-forest-labs/FLUX.1-schnell
  • black-forest-labs/FLUX.1-Krea-dev
  • black-forest-labs/FLUX.2-dev *
  • diffusers/FLUX.2-dev-bnb-4bit
  • Tongyi-MAI/Z-Image-Turbo
  • Qwen/Qwen-Image

Image-to-Image (/images/edits)

  • black-forest-labs/FLUX.1-Kontext-dev
  • diffusers/FLUX.2-dev-bnb-4bit - Supports multi-image editing. Maximum 10 input images.
  • black-forest-labs/FLUX.2-dev * - Supports multi-image editing. Maximum 10 input images.
  • Qwen/Qwen-Image-Edit
  • Qwen/Qwen-Image-Edit-2509 - Supports multi-image editing. Maximum 3 input images.
  • Qwen/Qwen-Image-Edit-2511 - Supports multi-image editing. Maximum 3 input images.

* Note on FLUX.2-dev: Requires NVIDIA H200 with 64GB RAM minimum. Inference times are variable (17s-2min) and may be unpredictable.

Text-to-Video (/videos) - Experimental

  • Wan-AI/Wan2.2-T2V-A14B (High quality, 40 steps - requires H100/A100-80G, start with --model "wan2.2")
  • Aquiles-ai/Wan2.2-Turbo9.5x faster - Same quality in 4 steps! (requires H100/A100-80G, start with --model "wan2.2-turbo")

VRAM Requirements: Most models need 24GB+ VRAM. Video generation requires 80GB+ (H100/A100-80G).

📖 Full models documentation and more models in 🎬 Aquiles-Studio

💡 Examples

Generating Images

https://github.com/user-attachments/assets/00e18988-0472-4171-8716-dc81b53dcafa

https://github.com/user-attachments/assets/00d4235c-e49c-435e-a71a-72c36040a8d7

Editing Images

Input + Prompt Result
Edit Script Edit Result

Generating Videos (Experimental)

https://github.com/user-attachments/assets/7b1270c3-b77b-48df-a0fe-ac39b2320143

Note: Video generation with wan2.2 takes ~30 minutes on H100. With wan2.2-turbo, it takes only ~3 minutes! Only one video can be generated at a time.

🧪 Advanced Features

AutoPipeline - Run Any Diffusers Model

Run any model compatible with AutoPipelineForText2Image from HuggingFace:

aquiles-image serve \
  --model "stabilityai/stable-diffusion-xl-base-1.0" \
  --auto-pipeline \
  --set-steps 30

Supported models include:

  • stable-diffusion-v1-5/stable-diffusion-v1-5
  • stabilityai/stable-diffusion-xl-base-1.0
  • Any HuggingFace model compatible with AutoPipelineForText2Image

Trade-offs:

  • ⚠️ Slower inference than native implementations
  • ⚠️ No LoRA or adapter support
  • ⚠️ Experimental - may have stability issues

Dev Mode - Test Without Loading Models

Perfect for development, testing, and CI/CD:

aquiles-image serve --no-load-model

What it does:

  • Starts server instantly without GPU
  • Returns test images that simulate real responses
  • All endpoints functional with realistic formats
  • Same API structure as production

🎯 Use Cases

Who What
🚀 AI Startups Build image generation features without API costs
👨‍💻 Developers Prototype with multiple models using one interface
🏢 Enterprises Scalable, private image AI infrastructure
🔬 Researchers Experiment with cutting-edge models easily

📋 Prerequisites

  • Python 3.8+
  • CUDA-compatible GPU with 24GB+ VRAM (most models)
  • 10GB+ free disk space

📚 Documentation

⭐ Star this project🐛 Report issues

Built with ❤️ for the AI community

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

aquiles_image-0.2.85.tar.gz (46.3 kB view details)

Uploaded Source

Built Distribution

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

aquiles_image-0.2.85-py3-none-any.whl (50.2 kB view details)

Uploaded Python 3

File details

Details for the file aquiles_image-0.2.85.tar.gz.

File metadata

  • Download URL: aquiles_image-0.2.85.tar.gz
  • Upload date:
  • Size: 46.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.12.3

File hashes

Hashes for aquiles_image-0.2.85.tar.gz
Algorithm Hash digest
SHA256 b62cf17f6451dadade9f4b2d41fab6ca6de8d106e6ef9e8f6ca5eda7145df440
MD5 098064674adf45ba4582e669011bf6f2
BLAKE2b-256 0fc550537c2c198a44d27fcfb9a1a74ae07eb0a15dbb89a262bde941f5842ff6

See more details on using hashes here.

File details

Details for the file aquiles_image-0.2.85-py3-none-any.whl.

File metadata

  • Download URL: aquiles_image-0.2.85-py3-none-any.whl
  • Upload date:
  • Size: 50.2 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.12.3

File hashes

Hashes for aquiles_image-0.2.85-py3-none-any.whl
Algorithm Hash digest
SHA256 72464a4eecdff379cb73077510348332025ba66b7bfc17c10f5e43b4d9cbc830
MD5 c98615c6ac820fd68bb588bcc56c7167
BLAKE2b-256 8b8eb98c04ea4a5e8ec7cf3ca6f11a80ce8b81393c698344281b6eaaafccc811

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