Skip to content

shootify-io/ai-toolkit

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

983 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Sartiq AI Toolkit

Fork of ostris/ai-toolkit with custom modifications for Shootify's training pipeline.

Deployed at: https://ai-toolkit-01.shootify.io/dashboard


Custom Modifications

1. Resolution Bucketing (4:5 Portrait)

Replaced the original resolution system with explicit [width, height] bucket pairs and added 4:5 portrait aspect ratio buckets optimized for garment/fashion training:

  • 8 new 4:5 buckets: 960x1200 through 1792x2240
  • New ResolutionSelector UI component with per-bucket width/height editing
  • TypeScript bucket utility mirroring Python bucket generation logic
  • Migration support for old config formats (single int, flat array)

Files changed:

  • toolkit/buckets.py — new 4:5 portrait buckets
  • toolkit/config_modules.py — resolution format as [w, h][]
  • toolkit/dataloader_mixins.py — support exact [w, h] bucket dimensions
  • ui/src/components/ResolutionSelector.tsx — new component
  • ui/src/utils/buckets.ts — TypeScript bucket utility
  • ui/src/app/jobs/new/SimpleJob.tsx — use ResolutionSelector
  • ui/src/app/jobs/new/jobConfig.ts — resolution migration
  • ui/src/app/jobs/new/page.tsx — simplified view
  • ui/src/types.ts — updated resolution type

2. HuggingFace Download Fix

hf_transfer (Rust-based download accelerator) has a bug that stalls downloads at the 2^34 byte boundary (~16GB). Disabled it and Xet storage protocol to use plain HTTP instead.

Environment variables added to job spawn:

  • HF_HUB_ENABLE_HF_TRANSFER=0
  • HF_HUB_DISABLE_XET=1
  • HF_HUB_DOWNLOAD_TIMEOUT=300
  • HF_HOME=/data/.cache/huggingface

File changed:

  • ui/cron/actions/startJob.ts

3. Dockerfile

Clones from shootify-io/ai-toolkit fork instead of upstream ostris repo.

File changed:

  • docker/Dockerfile

4. Dev Server Config

  • Added allowedDevOrigins for ai-toolkit-01.shootify.io
  • Set dev port to 8675
  • Removed turbopack

Files changed:

  • ui/next.config.ts
  • ui/package.json

Deployment

Infrastructure

Running (Dev Server, no Docker)

The app runs directly on the host via npm run dev (Next.js + cron worker via concurrently) on port 8675.

Start:

cd /home/info/shootify-deployment/ai-toolkit/ui
nohup npm run dev > /tmp/dev-server.log 2>&1 &

Stop:

pkill -f "next dev --port 8675"
pkill -f "ts-node-dev.*worker"
pkill -f "concurrently.*WORKER"

Logs: /tmp/dev-server.log

There is also a systemd service at /etc/systemd/system/ai-toolkit.service.

Python Environment

.venv is a conda environment with Python 3.12 created at the repo root:

conda create -p /home/info/shootify-deployment/ai-toolkit/.venv python=3.12 -y
.venv/bin/pip install torch torchvision torchaudio --index-url https://download.pytorch.org/whl/cu124
.venv/bin/pip install -r requirements.txt

The startJob.ts worker detects .venv/bin/python automatically.

Data Paths

Path Contents
/home/info/shootify-deployment/ai-toolkit/output/ Training outputs (logs, checkpoints, samples)
/home/info/shootify-deployment/aitk_db.db SQLite database (jobs, settings)
/data/.cache/huggingface/ HuggingFace model cache
/home/info/shootify-deployment/ai-toolkit/datasets/ Training datasets

Upstream

For general AI Toolkit documentation, features, and supported models, see the original repo: ostris/ai-toolkit

About

The ultimate training toolkit for finetuning diffusion models

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages

  • Python 88.5%
  • TypeScript 10.3%
  • Jupyter Notebook 1.0%
  • Shell 0.1%
  • Dockerfile 0.1%
  • CSS 0.0%