otherroch/aitools

Portrait dataset preparation toolkit for diffusion model LoRA training.

0

stars

256

commits

Python

primary language

Aug 25, 2026

updated

README

aitools

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.

ToolCommandDescription
Portrait Prepportrait-prepEnd-to-end portrait image preparation (convert → crop → caption → augment)
Video CropvicropExtract face-cropped PNG frames or per-person video segments (based on sampled-frame detection) from video files
Video DescriptionvidescGenerate 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 ReplacechararepReplace 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

Quick start

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.

Documentation

For a complete reference of each tool's command line options, usage examples, and Python API:

  • portrait-prep — portrait dataset preparation pipeline: convert, crop, caption, augment, cpcap
  • vicrop — video face-crop extraction with identity clustering, reference photo selection, and per-person video segment extraction (via sampled-frame detection)
  • videsc — video description generator (WD14 tags, Qwen3-VL, Qwen3-omni, Qwen3.5, Gemma4, vLLM remote server) natural language)
  • chararep — video character face-replacement pipeline (architecture, CLI, config, input requirements, VRAM guidelines)
  • Python API and Testing — Python API examples for each tool, test commands, and coverage

License

This project is licensed under the Apache License 2.0.

Contributors

otherroch

156 commits

Copilot

100 commits

otherroch/aitools

Portrait dataset preparation toolkit for diffusion model LoRA training.

0

stars

256

commits

Python

primary language

Aug 25, 2026

updated

README

aitools

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.

ToolCommandDescription
Portrait Prepportrait-prepEnd-to-end portrait image preparation (convert → crop → caption → augment)
Video CropvicropExtract face-cropped PNG frames or per-person video segments (based on sampled-frame detection) from video files
Video DescriptionvidescGenerate 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 ReplacechararepReplace 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

Quick start

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.

Documentation

For a complete reference of each tool's command line options, usage examples, and Python API:

  • portrait-prep — portrait dataset preparation pipeline: convert, crop, caption, augment, cpcap
  • vicrop — video face-crop extraction with identity clustering, reference photo selection, and per-person video segment extraction (via sampled-frame detection)
  • videsc — video description generator (WD14 tags, Qwen3-VL, Qwen3-omni, Qwen3.5, Gemma4, vLLM remote server) natural language)
  • chararep — video character face-replacement pipeline (architecture, CLI, config, input requirements, VRAM guidelines)
  • Python API and Testing — Python API examples for each tool, test commands, and coverage

License

This project is licensed under the Apache License 2.0.

Contributors

otherroch

156 commits

Copilot

100 commits

Languages

Python

99.7%