百科.dev
全部条目AI 编程趋势榜开源项目技术资讯提交条目
登录
< 返回工具列表
A

ai-toolkit

> 编程语言
开源

用于微调扩散模型的终极训练工具包

11.5K stars0 点赞0 次浏览
访问官网GitHub

工具介绍

用于微调扩散模型的终极训练工具包

Ostris AI Toolkit

AI Toolkit is an easy to use all in one training suite for diffusion models. I try to support all the latest models on consumer grade hardware. Image and video models. It can be run as a GUI or CLI. It is designed to be easy to use but still have every feature imaginable. Free and open source.

Supported Models

Image

  • black-forest-labs/FLUX.1-dev (FLUX.1)
  • black-forest-labs/FLUX.2-dev (FLUX.2)
  • black-forest-labs/FLUX.2-klein-base-4B (FLUX.2-klein-base-4B)
  • black-forest-labs/FLUX.2-klein-base-9B (FLUX.2-klein-base-9B)
  • ostris/Flex.1-alpha (Flex.1)
  • ostris/Flex.2-preview (Flex.2)
  • lodestones/Chroma1-Base (Chroma)
  • Alpha-VLLM/Lumina-Image-2.0 (Lumina2)
  • Qwen/Qwen-Image (Qwen-Image)
  • Qwen/Qwen-Image-2512 (Qwen-Image-2512)
  • HiDream-ai/HiDream-I1-Full (HiDream I1)
  • OmniGen2/OmniGen2 (OmniGen2)
  • Tongyi-MAI/Z-Image-Turbo (Z-Image Turbo)
  • Tongyi-MAI/Z-Image (Z-Image)
  • ostris/Z-Image-De-Turbo (Z-Image De-Turbo)
  • zhen-nan/L2P (Z-Image L2P)
  • stabilityai/stable-diffusion-xl-base-1.0 (SDXL)
  • stable-diffusion-v1-5/stable-diffusion-v1-5 (SD 1.5)
  • baidu/ERNIE-Image (ERNIE-Image)
  • NucleusAI/Nucleus-Image (Nucleus-Image)
  • Boogu/Boogu-Image-0.1-Base (Boogu Image 0.1)
  • HiDream-ai/HiDream-O1-Image (HiDream O1)
  • ideogram-ai/ideogram-4-fp8 (Ideogram 4 FP8)
  • Photoroom/prxpixel-t2i (PRXPixel)
  • circlestone-labs/Anima-Base-v1.0-Diffusers (Anima)
  • krea/Krea-2-Raw (Krea 2)
  • krea/Krea-2-Turbo (Krea 2 Turbo)
  • microsoft/Mage-Flow-Base (Mage-Flow)

Instruction / Edit

  • black-forest-labs/FLUX.1-Kontext-dev (FLUX.1-Kontext-dev)
  • Qwen/Qwen-Image-Edit (Qwen-Image-Edit)
  • Qwen/Qwen-Image-Edit-2509 (Qwen-Image-Edit-2509)
  • Qwen/Qwen-Image-Edit-2511 (Qwen-Image-Edit-2511)
  • HiDream-ai/HiDream-E1-1 (HiDream E1)
  • Boogu/Boogu-Image-0.1-Edit (Boogu Image Edit)
  • krea/Krea-2-Raw (Krea 2 Edit Training)
  • krea/Krea-2-Turbo (Krea 2 Turbo Edit Training)
  • microsoft/Mage-Flow-Edit-Base (Mage-Flow Edit)

Video

  • Wan-AI/Wan2.1-T2V-1.3B-Diffusers (Wan 2.1 1.3B)
  • Wan-AI/Wan2.1-I2V-14B-480P-Diffusers (Wan 2.1 I2V 14B-480P)
  • Wan-AI/Wan2.1-I2V-14B-720P-Diffusers (Wan 2.1 I2V 14B-720P)
  • Wan-AI/Wan2.1-T2V-14B-Diffusers (Wan 2.1 14B)
  • Wan-AI/Wan2.2-T2V-A14B-Diffusers (Wan 2.2 14B)
  • Wan-AI/Wan2.2-I2V-A14B-Diffusers (Wan 2.2 I2V 14B)
  • Wan-AI/Wan2.2-TI2V-5B-Diffusers (Wan 2.2 TI2V 5B)
  • Lightricks/LTX-2 (LTX-2)
  • Lightricks/LTX-2.3 (LTX-2.3)
  • MiniMaxAI/MiniMax-H3 (MiniMaxAI/MiniMax-H3)

Audio

  • ACE-Step/Ace-Step1.5 (Ace Step 1.5)
  • ACE-Step/acestep-v15-xl-base (Ace Step 1.5 XL)

Experimental

  • lodestones/Zeta-Chroma (Zeta Chroma)
  • m-a-p/YuE2-3B (YuE2) - audio. The official audio-to-token encoder is unreleased; training uses the community tokenizer by Kytra (@sin_ceriously), Mothersuperior/yue2-mothersuperior-realaudio-tokenizer-v4.

Installation

Install with the AI Toolkit Manager (experimental)

The recommended way to install and run AI Toolkit is with the AI Toolkit Manager, built into this repo. The manager detects your hardware and sets up the right PyTorch build, creates the python environment, and grabs local copies of Node.js and FFmpeg — everything stays inside the ai-toolkit folder, nothing is installed system-wide. On every launch the manager checks for updates and applies them (your local changes are never overwritten — if you have modified files, the update is skipped with a warning), then starts the UI at http://localhost:8675.

The manager is still experimental — please let me know if you have any issues with it. The manual instructions below still work if you prefer them or run into problems.

The only requirement is git (on Windows the manager can even fetch a portable git for updates, but you need one installed to clone the repo first).

git clone https://github.com/ostris/ai-toolkit.git
cd ai-toolkit

Then start the manager with the script for your platform:

Linux:

chmod +x run_linux.sh
./run_linux.sh

MacOS (Apple Silicon, experimental):

chmod +x run_mac.zsh
./run_mac.zsh

Windows: double-click run_windows.bat (or run it from a terminal).

You can also use the manager directly from a terminal (handy on headless servers):

python3 -m manager install   # first-time setup
python3 -m manager update    # pull updates + sync dependencies
python3 -m manager launch    # start the UI
python3 -m manager doctor    # diagnose problems

Manual installation

Requirements:

  • python >=3.10 (3.12 recommended)
  • Nvidia GPU with enough ram to do what you need
  • python venv
  • git

Linux:

git clone https://github.com/ostris/ai-toolkit.git
cd ai-toolkit
python3 -m venv venv
source venv/bin/activate
# install torch first
pip3 install --no-cache-dir torch==2.13.0 torchvision==0.28.0 torchaudio==2.11.0 --index-url https://download.pytorch.org/whl/cu130
pip3 install -r requirements.txt

For devices running DGX OS (including DGX Spark), follow these instructions.

Windows:

If you are having issues with Windows. I recommend using the easy install script at https://github.com/Tavris1/AI-Toolkit-Easy-Install

git clone https://github.com/ostris/ai-toolkit.git
cd ai-toolkit
python -m venv venv
.\venv\Scripts\activate
pip install --no-cache-dir torch==2.13.0 torchvision==0.28.0 torchaudio==2.11.0 --index-url https://download.pytorch.org/whl/cu130
pip install -r requirements.txt

AI Toolkit UI

The AI Toolkit UI is a web interface for the AI Toolkit. It allows you to easily start, stop, and monitor jobs. It also allows you to easily train models with a few clicks. It also allows you to set a token for the UI to prevent unauthorized access so it is mostly safe to run on an exposed server.

Running the UI

Requirements:

  • Node.js > 20

The UI does not need to be kept running for the jobs to run. It is only needed to start/stop/monitor jobs. The commands below will install / update the UI and it's dependencies and start the UI.

cd ui
npm run build_and_start

You can now access the UI at http://localhost:8675 or http://<your-ip>:8675 if you are running it on a server.

Securing the UI

If you are hosting the UI on a cloud provider or any network that is not secure, I highly recommend securing it with an auth token. You can do this by setting the environment variable AI_TOOLKIT_AUTH to super secure password. This token will be required to access the UI. You can set this when starting the UI like so:

# Linux
AI_TOOLKIT_AUTH=super_secure_password npm run build_and_start

# Windows
set AI_TOOLKIT_AUTH=super_secure_password && npm run build_and_start

# Windows Powershell
$env:AI_TOOLKIT_AUTH="super_secure_password"; npm run build_and_start

Training

  1. Copy the example config file located at config/examples/train_lora_flux_24gb.yaml (config/examples/train_lora_flux_schnell_24gb.yaml for schnell) to the config folder and rename it to whatever_you_want.yml
  2. Edit the file following the comments in the file
  3. Run the file like so python run.py config/whatever_you_want.yml

A folder with the name and the training folder from the config file will be created when you start. It will have all checkpoints and images in it. You can stop the training at any time using ctrl+c and when you resume, it will pick back up from the last checkpoint.

IMPORTANT. If you press crtl+c while it is saving, it will likely corrupt that checkpoint. So wait until it is done saving

Need help?

Please do not open a bug report unless it is a bug in the code. You are welcome to Join my Discord and ask for help there. However, please refrain from PMing me directly with general question or support. Ask in the discord and I will answer when I can.

Ostris Cloud

You can use many cloud providers to rent GPUs. If you want to help support this project in the largest way possible, please consider using Ostris Cloud. Ostris Cloud is owned and operated by me, Ostris, and every dollar earned goes directly back into funding the development of this project.

Training in RunPod

If you would like to use Runpod, but have not signed up yet, please consider using my Runpod affiliate link to help support this project.

I maintain an official Runpod Pod template here which can be accessed here.

I have also created a short video showing how to get started using AI Toolkit with Runpod here.

Training in Modal

1. Setup

ai-toolkit:

git clone https://github.com/ostris/ai-toolkit.git
cd ai-toolkit
git submodule update --init --recursive
python -m venv venv
source venv/bin/activate
pip install torch
pip install -r requirements.txt
pip install --upgrade accelerate transformers diffusers huggingface_hub #Optional, run it if you run into issues

Modal:

  • Run pip install modal to install the modal Python package.
  • Run modal setup to authenticate (if this doesn’t work, try `python -m modal

Issues· 0 开放

查看全部 Issues在 GitHub 打开

暂无开放 Issues,或尚未同步最近议题。

> 标签

Python

暂无评论,来聊聊你的看法吧

> 工具信息

发布日期2026年8月1日
最后更新2026年9月17日
分类编程语言
定价开源

> 相关工具

T
TypeScript
JavaScript 的超集,为前端与全栈提供静态类型
P
Python
通用编程语言,广泛用于 Web、数据与 AI
G
Go
Google 推出的简洁高效系统语言