Logo
Ostris AI Toolkit: Installation & LoRA Training Guide

Ostris AI Toolkit: Installation & LoRA Training Guide

October 23, 2025
7 min read

The Ostris AI Toolkit is a powerful framework that allows you to train LoRA models, fine-tune custom AI models, and even work with FLUX using your own dataset. Whether you’re training locally or using cloud GPUs like RunPod, this guide will walk you through everything step by step — I’ve tested this setup myself, so you won’t hit any surprises.

✅ Beginner friendly ✅ Works for Windows, Linux & RunPod ✅ Optional Web UI (no coding required) ✅ Supports FLUX, Stable Diffusion, and LoRA training


✅ Official Resources


✅ System Requirements

ComponentMinimumRecommended
GPU8GB VRAM (basic LoRA)24GB VRAM (FLUX training)
RAM16GB32GB
Storage100GB free250GB
Python3.10–3.113.10
OSWindows/LinuxLinux (Ubuntu 22.04)

💡 Tip: FLUX training requires a lot of VRAM — I’m talking 24GB+ here. Use RunPod or Lambda Labs if you don’t have a strong GPU, because you’ll hit memory limits otherwise.


✅ 1. Clone AI Toolkit Repository

Terminal window
git clone https://github.com/ostris/ai-toolkit.git
cd ai-toolkit
git submodule update --init --recursive

✅ 2. Create Virtual Environment & Install Dependencies

🔧 Linux/macOS

Terminal window
python3 -m venv venv
source venv/bin/activate
pip install --upgrade pip
pip install torch torchvision --index-url https://download.pytorch.org/whl/cu121
pip install -r requirements.txt

🔧 Windows (PowerShell)

Terminal window
python -m venv venv
.\venv\Scripts\activate
pip install --upgrade pip
pip install torch torchvision --index-url https://download.pytorch.org/whl/cu121
pip install -r requirements.txt

Terminal window
cd ui
npm install
npm run build_and_start

Web UI opens at: http://localhost:8675


✅ 4. Configure Training Dataset

Place your images inside:

dataset/my-training-data/

Add .txt caption files with the same image name:

image01.png
image01.txt

✅ 5. Example LoRA Training Config

Create a file: configs/my_lora.yaml

job:
name: "My LoRA Training"
training_folder: "output"
process:
- type: sd_trainer
folder_path: "dataset/my-training-data"
steps: 2000
model:
name_or_path: "black-forest-labs/FLUX.1-dev"
is_flux: true

Run training:

Terminal window
python run.py --config configs/my_lora.yaml

✅ 6. Run on RunPod (Cloud GPU)

Quick Setup

  1. Go to RunPod
  2. Deploy GPU → choose RTX 4090 / A100 / L40S
  3. Select PyTorch 2.4 CUDA 12 template
  4. Clone AI Toolkit & install like above
  5. Run Web UI
Terminal window
npm run build_and_start -- --host 0.0.0.0 --port 8675
  1. Open your RunPod Public URL

🔧 VRAM Optimization Tips

ProblemFix
Out of memoryReduce batch size, resolution, use 8-bit optimizer
Slow trainingUse cloud GPU like 4090/A100
CrashesLower number of steps or use fp16

🛠️ Troubleshooting

ErrorSolution
Torch not foundpip install torch
Node.js missingnpm install -g nvm then nvm install 18
Dataset emptyCheck folder path in config
Training freezesUse --no_cache option

🔥 Advanced FLUX Training with AI Toolkit

AI Toolkit also supports training LoRA models for FLUX.1 just like Stable Diffusion. Here’s how to enable FLUX training.

✅ Requirements for FLUX Training

RequirementRecommended
GPU VRAM24GB minimum (A100/4090/L40S)
Base ModelFLUX.1-dev
Precisionfp16
Batch Size1–2

✅ Example FLUX Training Config

Create file configs/flux_lora.yaml:

job:
name: "flux-lora-training"
training_folder: "output/flux_lora"
process:
- type: flux_trainer
folder_path: "dataset/flux_dataset"
steps: 3000
batch_size: 1
optimizer: "adamw8bit"
learning_rate: 1e-4
model:
name_or_path: "black-forest-labs/FLUX.1-dev"
is_flux: true

Run it using:

Terminal window
python run.py --config configs/flux_lora.yaml

SettingValue
Resolution1024x1024
Steps2000–5000
Learning Rate1e-4 to 3e-4
OptimizerAdamW8bit
Schedulercosine

✅ Use small datasets (30–100 images) for character LoRAs.


🗂️ Dataset Preparation Tips

To get high-quality results, prepare your dataset correctly:

✅ Resize images to 1024x1024
✅ Use clean, consistent lighting
✅ Avoid watermarks & logos
✅ Provide .txt captions per image
✅ Use BLIP Captioning or Kohya scripts for automatic captions

Folder example:

dataset/character/
├─ 01.png
├─ 01.txt
├─ 02.png
├─ 02.txt

🔧 Optimizer Choices

OptimizerSpeedQualityRecommended
AdamW8bit✅ Fast✅ Good✅ Best general
Lion⚡ Faster⭐ GoodExperimental
SGD❌ Slow❌ WeakNot recommended

🧩 ControlNet + AI Toolkit (Optional Advanced)

AI Toolkit can also be used alongside ControlNet to improve training consistency using pose, depth, or edge guidance.

✅ Use ControlNet for Generation (After Training)

You can apply ControlNet with your trained LoRA during image generation to control pose and composition.

Example folder for ControlNet models:

models/controlnet/

Popular ControlNet models to download:

TypeModel
Posecontrolnet-openpose
Depthcontrolnet-depth
Cannycontrolnet-canny

🔄 Resume Training from a Checkpoint

If training stops or GPU session ends, resume training:

Terminal window
python run.py --config configs/flux_lora.yaml --resume

Or specify checkpoint manually:

Terminal window
python run.py --config configs/flux_lora.yaml --resume checkpoints/step_2000.safetensors

📊 Training Logs & Monitoring

Enable TensorBoard to visualize training progress:

Terminal window
pip install tensorboard
tensorboard --logdir output/logs

Open in browser: http://localhost:6006


⚡ Speed Up Training

Use faster training with memory optimizations:

Terminal window
pip install bitsandbytes

Settings:

optimizer: "adamw8bit"
use_xformers: true
mixed_precision: "fp16"

🛡️ Common Errors & Fixes (Troubleshooting)

Here are the most frequent issues users face with AI Toolkit and how to fix them fast.

Error MessageCauseFix
RuntimeError: CUDA out of memoryVRAM too lowReduce resolution, use batch_size=1, enable 8-bit optimizer
ModuleNotFoundError: No module named torchTorch not installedpip install torch --index-url https://download.pytorch.org/whl/cu121
ValueError: Dataset folder emptyWrong file pathCheck folder_path in config
Web UI won’t startMissing Node.jsInstall Node via NVM and retry
Training freezesDataset too largeLimit to 50–200 training images
Resume failedIncorrect pathUse full checkpoint path

📂 File & Folder Structure

Here’s how your project folder should look for AI Toolkit:

ai-toolkit/
├─ configs/
│ └─ flux_lora.yaml
├─ dataset/
│ └─ my_dataset/
│ ├─ 01.png
│ ├─ 01.txt
├─ models/
├─ output/
│ └─ flux_lora/
│ └─ checkpoints/
├─ ui/
└─ run.py

ResourceLink
AI Toolkit GitHubhttps://github.com/ostris/ai-toolkit
FLUX.1-dev (Model)https://huggingface.co/black-forest-labs/FLUX.1-dev
CLIP Pretrainedhttps://huggingface.co/comfyanonymous/flux_text_encoders
BitsAndBytes 8-bithttps://github.com/TimDettmers/bitsandbytes
Dataset Toolshttps://github.com/akegarasu/lama-cleaner

🔥 Advanced Config Templates

Character LoRA (Portrait Style)

steps: 3500
learning_rate: 1e-4
rank: 16
network_alpha: 32
resolution: 1024

Style LoRA (Painterly/Anime Style)

steps: 5000
learning_rate: 2e-4
rank: 32
optimizer: "adamw8bit"

✅ Final SEO Conclusion

The AI Toolkit by Ostris is one of the most powerful open-source tools for custom AI model training, LoRA creation, and FLUX fine-tuning. Whether you’re a beginner or advanced AI creator, it offers full control, strong flexibility, and local + cloud support — it’s honestly pretty impressive what you can do with it.

In this guide, you learned: ✅ How to install AI Toolkit on Windows & Linux ✅ How to launch and use the Web UI ✅ How to train LoRA models ✅ How to run training on RunPod ✅ How to optimize GPU VRAM ✅ How to use FLUX.1 LoRA training ✅ How to resume training & boost performance ✅ How to troubleshoot common errors

If you’re serious about training your own models, this toolkit is worth the setup time.


✅ Summary

FeatureStatus
Local Install Guide✅ Included
RunPod Cloud Setup✅ Included
FLUX Training Support✅ Included
Troubleshooting✅ Included
Ready Config Examples✅ Included
Beginner Friendly✅ Yes

🔗 Useful Resources


✅ Thanks for using this AI Toolkit setup guide! Happy training 🚀