Skip to main content
HyperGen

Welcome to HyperGen

HyperGen is an optimized inference and fine-tuning framework for image & video diffusion models. Train LoRAs in just 5 lines of code, or serve models with an OpenAI-compatible API.

Features

Train LoRAs in just 5 lines of code. No complex configurations or lengthy notebooks required.
from hypergen import model, dataset

m = model.load("stabilityai/stable-diffusion-xl-base-1.0")
ds = dataset.load("./my_images")
lora = m.train_lora(ds, steps=1000)
Serve models with a production-ready API that’s compatible with OpenAI’s image generation API.
hypergen serve stabilityai/stable-diffusion-xl-base-1.0 --api-key your-key
Works with any diffusion model from HuggingFace:
  • FLUX.1
  • Stable Diffusion XL
  • Stable Diffusion 3
  • CogVideoX (video)
  • And more…
Optimized for speed and memory efficiency:
  • Automatic mixed precision
  • Gradient checkpointing
  • Flash Attention support
  • Request queuing and batching

Installation

pip install hypergen

Quick Example

Here’s how simple it is to train a LoRA:
from hypergen import model, dataset

# Load model
m = model.load("stabilityai/stable-diffusion-xl-base-1.0")
m.to("cuda")

# Load dataset
ds = dataset.load("./my_images")

# Train LoRA
lora = m.train_lora(ds, steps=1000)
And to serve a model:
hypergen serve stabilityai/stable-diffusion-xl-base-1.0 \
  --api-key token-abc123 \
  --port 8000

Next Steps

Community