> ## Documentation Index
> Fetch the complete documentation index at: https://hyper.julian.sc/llms.txt
> Use this file to discover all available pages before exploring further.

# HyperGen Documentation

> Train & run diffusion models 3x faster with 80% less VRAM

<img src="https://mintcdn.com/decemberlabs/nzhOya6maRN-bdtL/images/header.webp?fit=max&auto=format&n=nzhOya6maRN-bdtL&q=85&s=0629becc61c978256ed7f6b59b868287" alt="HyperGen" width="1920" height="700" data-path="images/header.webp" />

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

<CardGroup cols={2}>
  <Card title="Quick Start" icon="rocket" href="/quickstart">
    Get started with HyperGen in under 5 minutes
  </Card>

  <Card title="Train LoRAs" icon="brain" href="/training/overview">
    Learn how to train LoRA adapters for diffusion models
  </Card>

  <Card title="Serve Models" icon="server" href="/serving/overview">
    Deploy models with OpenAI-compatible API
  </Card>

  <Card title="API Reference" icon="code" href="/api-reference/model">
    Explore the Python and HTTP APIs
  </Card>
</CardGroup>

## Features

<AccordionGroup>
  <Accordion title="Dead Simple API" icon="wand-magic-sparkles">
    Train LoRAs in just 5 lines of code. No complex configurations or lengthy notebooks required.

    ```python theme={null}
    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)
    ```
  </Accordion>

  <Accordion title="OpenAI-Compatible API" icon="plug">
    Serve models with a production-ready API that's compatible with OpenAI's image generation API.

    ```bash theme={null}
    hypergen serve stabilityai/stable-diffusion-xl-base-1.0 --api-key your-key
    ```
  </Accordion>

  <Accordion title="Universal Model Support" icon="stars">
    Works with any diffusion model from HuggingFace:

    * FLUX.1
    * Stable Diffusion XL
    * Stable Diffusion 3
    * CogVideoX (video)
    * And more...
  </Accordion>

  <Accordion title="Built for Performance" icon="bolt">
    Optimized for speed and memory efficiency:

    * Automatic mixed precision
    * Gradient checkpointing
    * Flash Attention support
    * Request queuing and batching
  </Accordion>
</AccordionGroup>

## Installation

<CodeGroup>
  ```bash pip theme={null}
  pip install hypergen
  ```

  ```bash uv theme={null}
  uv pip install hypergen
  ```

  ```bash from source theme={null}
  git clone https://github.com/ntegrals/hypergen.git
  cd hypergen
  pip install -e .
  ```
</CodeGroup>

## Quick Example

Here's how simple it is to train a LoRA:

```python theme={null}
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:

```bash theme={null}
hypergen serve stabilityai/stable-diffusion-xl-base-1.0 \
  --api-key token-abc123 \
  --port 8000
```

## Next Steps

<CardGroup cols={2}>
  <Card title="Installation Guide" icon="download" href="/installation">
    Detailed installation instructions and requirements
  </Card>

  <Card title="Training Tutorial" icon="graduation-cap" href="/training/overview">
    Learn how to train your first LoRA
  </Card>

  <Card title="Serving Guide" icon="server" href="/serving/overview">
    Deploy models in production
  </Card>

  <Card title="Supported Models" icon="list" href="/models/supported">
    Browse all supported model architectures
  </Card>
</CardGroup>

## Community

<CardGroup cols={3}>
  <Card title="GitHub" icon="github" href="https://github.com/ntegrals/hypergen">
    Star us on GitHub
  </Card>

  <Card title="PyPI" icon="box" href="https://pypi.org/project/hypergen/">
    View on PyPI
  </Card>

  <Card title="Examples" icon="code" href="https://github.com/ntegrals/hypergen/tree/main/examples">
    Browse code examples
  </Card>
</CardGroup>
