AI dataset preparation toolkit for diffusion model LoRA training.
aitools provides 3 command-line tools and Python APIs for preparing image and video datasets. Also included is a tool called chararep which uses the output of the other tools to swap faces in videos.
| Tool | Command | Description |
|---|---|---|
| Portrait Prep | portrait-prep | End-to-end portrait image preparation (convert → crop → caption → augment) |
| Video Crop | vicrop | Extract face-cropped PNG frames or per-person video segments (based on sampled-frame detection) from video files |
| Video Description | videsc | Generate text descriptions for video files — fast WD14 tag-based captions (default) or rich natural-language descriptions via Qwen3-VL / Qwen3-omni / Qwen3.5 (--vl) or Gemma4 (--gemma4) or a remote vLLM server (--vllm) |
| Character Replace | chararep | Replace character faces in a video using deep face-swapping models (inswapper, SimSwap, uniface, hyperswap, blendswap). Other tools like vicrop and portrait-prep can be used to create the portrait galleries required by chararep |
git clone https://github.com/otherroch/aitools.git
cd aitools
python -m venv .venv
source .venv/bin/activate # Linux/macOS
# .venv\Scripts\activate # Windows
# upgrade pip to get --group support
python -m pip install -U pip
# install base dependencies (CPU only support)
pip install --group base
# install aitools
pip install -e .
For individual feature installs, GPU support, chararep dependencies (including basicsr),
docker images, install extras, system prerequisites, or project structure
see installation.
For a complete reference of each tool's command line options, usage examples, and Python API:
This project is licensed under the Apache License 2.0.
Python
99.7%
AI dataset preparation toolkit for diffusion model LoRA training.
aitools provides 3 command-line tools and Python APIs for preparing image and video datasets. Also included is a tool called chararep which uses the output of the other tools to swap faces in videos.
| Tool | Command | Description |
|---|---|---|
| Portrait Prep | portrait-prep | End-to-end portrait image preparation (convert → crop → caption → augment) |
| Video Crop | vicrop | Extract face-cropped PNG frames or per-person video segments (based on sampled-frame detection) from video files |
| Video Description | videsc | Generate text descriptions for video files — fast WD14 tag-based captions (default) or rich natural-language descriptions via Qwen3-VL / Qwen3-omni / Qwen3.5 (--vl) or Gemma4 (--gemma4) or a remote vLLM server (--vllm) |
| Character Replace | chararep | Replace character faces in a video using deep face-swapping models (inswapper, SimSwap, uniface, hyperswap, blendswap). Other tools like vicrop and portrait-prep can be used to create the portrait galleries required by chararep |
git clone https://github.com/otherroch/aitools.git
cd aitools
python -m venv .venv
source .venv/bin/activate # Linux/macOS
# .venv\Scripts\activate # Windows
# upgrade pip to get --group support
python -m pip install -U pip
# install base dependencies (CPU only support)
pip install --group base
# install aitools
pip install -e .
For individual feature installs, GPU support, chararep dependencies (including basicsr),
docker images, install extras, system prerequisites, or project structure
see installation.
For a complete reference of each tool's command line options, usage examples, and Python API:
This project is licensed under the Apache License 2.0.
Python
99.7%