Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .gitattributes
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
* text=auto eol=lf
*.bat text eol=crlf
pixi.lock merge=binary linguist-language=YAML linguist-generated=true -diff
9 changes: 4 additions & 5 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -27,13 +27,12 @@ secrets.json
.python-version
*.egg-info

# pixi environments
.pixi
pixi.lock
pixi.toml

# misc files
/src
train.bat
debug_report.log
config_diff.txt

# pixi environments
.pixi/*
!.pixi/config.toml
7,214 changes: 7,214 additions & 0 deletions pixi.lock

Large diffs are not rendered by default.

120 changes: 119 additions & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,5 +1,79 @@
[build-system]
requires = ["setuptools"]
build-backend = "setuptools.build_meta"

[project]
requires-python = ">=3.10"
name = "OneTrainer"
requires-python = ">=3.10,<3.14"
version = "0.1.0"

dependencies = [
"numpy==2.2.6",
"opencv-python==4.11.0.86",
"pillow==11.3.0",
"imagesize==1.4.1",
"tqdm==4.67.1",
"pyyaml==6.0.2",
"huggingface-hub==0.34.4",
"scipy==1.15.3",
"matplotlib==3.10.3",
"av==16.1.0",
"yt-dlp",
"scenedetect==0.6.6",
"accelerate==1.7.0",
"safetensors==0.5.3",
"tensorboard==2.20.0",
"pytorch-lightning==2.5.1.post0",
"diffusers @ git+https://github.com/huggingface/diffusers.git@256e0106749363fce06c28000698edeaf56a874d",
"gguf==0.17.1",
"transformers==4.56.2",
"sentencepiece==0.2.1",
"omegaconf==2.3.0",
"invisible-watermark==0.2.0",
"pooch==1.8.2",
"open-clip-torch==2.32.0",
"mgds @ git+https://github.com/Nerogar/mgds.git@385578f8c9e7861bd98c85d8855a23cb6b48661d",
"dadaptation==3.2",
"lion-pytorch==0.2.3",
"prodigyopt==1.1.2",
"schedulefree==1.4.1",
"pytorch-optimizer==3.6.0",
"prodigy-plus-schedule-free==2.0.1",
"adv-optm==2.1.0",
"muon-optimizer @ git+https://github.com/KellerJordan/Muon.git@f90a42b28e00b8d9d2d05865fe90d9f39abcbcbd",
"scalene==2.0.1",
"customtkinter==5.2.2",
"runpod==1.7.10",
"fabric==3.2.2",
"psutil==7.0.0",
"requests==2.32.5",
"deepdiff==8.6.1",
]

[project.optional-dependencies]
cpu = [
"torch==2.8.0",
"torchvision==0.23.0",
"onnxruntime==1.22.1",
]

cuda = [
"torch==2.8.0+cu128",
"torchvision==0.23.0+cu128",
"onnxruntime-gpu==1.22.0",
"bitsandbytes==0.46.0",
"nvidia-nccl-cu12==2.27.3; sys_platform == 'linux'",
"triton-windows==3.4.0.post20; sys_platform == 'win32'",
]

rocm = [
"torch==2.7.1+rocm6.3",
"torchvision==0.22.1+rocm6.3",
"onnxruntime==1.22.1",
]

[tool.setuptools]
packages = []

[tool.ruff]
extend-exclude = [
Expand Down Expand Up @@ -39,3 +113,47 @@ section-order = [
"third-party",
"local-folder",
]

[tool.pixi.workspace]
channels = ["conda-forge"]
platforms = ["osx-arm64", "linux-64", "win-64"]
requires-pixi = ">=0.63.0"

[tool.pixi.tasks]
train = { cmd = "python scripts/train.py", cwd = "." }
ui = { cmd = "python scripts/train_ui.py", cwd = "." }

[tool.pixi.feature.cuda]
platforms = ["linux-64", "win-64"]

[tool.pixi.feature.cuda.pypi-options]
extra-index-urls = ["https://download.pytorch.org/whl/cu128"]

[tool.pixi.feature.cuda.system-requirements]
cuda = "12.8"

[tool.pixi.feature.rocm]
platforms = ["linux-64"]

[tool.pixi.feature.rocm.pypi-options]
extra-index-urls = ["https://download.pytorch.org/whl/rocm6.3"]

[tool.pixi.dependencies]
python = "3.13.*"

[tool.pixi.target.linux-64.dependencies]
tk = { version = "*", build = "xft_*" }
libgl = "*"

[tool.pixi.system-requirements]
linux = "5.17"
libc = { family="glibc", version="2.28" }
macos = "15.0"

[tool.pixi.pypi-options]
index-strategy = "unsafe-best-match"

[tool.pixi.environments]
cpu = ["cpu"]
cuda = ["cuda"]
rocm = ["rocm"]
10 changes: 1 addition & 9 deletions requirements-cuda.txt
Original file line number Diff line number Diff line change
@@ -1,10 +1,2 @@
# pytorch
--extra-index-url https://download.pytorch.org/whl/cu128
torch==2.8.0+cu128
torchvision==0.23.0+cu128
onnxruntime-gpu==1.22.0
nvidia-nccl-cu12==2.27.3; sys_platform == "linux"
triton-windows==3.4.0.post20; sys_platform == "win32"

# optimizers
bitsandbytes==0.46.0 # bitsandbytes for 8-bit optimizers and weight quantization
-e .[cuda]
8 changes: 1 addition & 7 deletions requirements-default.txt
Original file line number Diff line number Diff line change
@@ -1,7 +1 @@
# pytorch
torch==2.8.0
torchvision==0.23.0
onnxruntime==1.22.1

# optimizers
# TODO
-e .[cpu]
61 changes: 1 addition & 60 deletions requirements-global.txt
Original file line number Diff line number Diff line change
@@ -1,60 +1 @@
# base requirements
numpy==2.2.6
opencv-python==4.11.0.86
pillow==11.3.0
imagesize==1.4.1 #for concept statistics
tqdm==4.67.1
PyYAML==6.0.2
huggingface-hub==0.34.4
scipy==1.15.3
matplotlib==3.10.3
av==16.1.0
yt-dlp #no pinned version, frequently updated for compatibility with sites
scenedetect==0.6.6

# pytorch
accelerate==1.7.0
safetensors==0.5.3
tensorboard==2.19.0
pytorch-lightning==2.5.1.post0

# diffusion models
#Note: check whether Qwen bugs in diffusers have been fixed before upgrading diffusers (see BaseQwenSetup):
-e git+https://github.com/huggingface/diffusers.git@256e010#egg=diffusers
gguf==0.17.1
transformers==4.56.2
sentencepiece==0.2.1 # transitive dependency of transformers for tokenizer loading
omegaconf==2.3.0 # needed to load stable diffusion from single ckpt files
invisible-watermark==0.2.0 # needed for the SDXL pipeline

# other models
pooch==1.8.2
open-clip-torch==2.32.0

# data loader
-e git+https://github.com/Nerogar/mgds.git@385578f#egg=mgds

# optimizers
dadaptation==3.2 # dadaptation optimizers
lion-pytorch==0.2.3 # lion optimizer
prodigyopt==1.1.2 # prodigy optimizer
schedulefree==1.4.1 # schedule-free optimizers
pytorch_optimizer==3.6.0 # pytorch optimizers
prodigy-plus-schedule-free==2.0.1 # Prodigy plus optimizer
adv_optm==2.1.0 # advanced optimizers
-e git+https://github.com/KellerJordan/Muon.git@f90a42b#egg=muon-optimizer

# Profiling
scalene==1.5.51

# ui
customtkinter==5.2.2

# cloud
runpod==1.7.10
fabric==3.2.2

# debug
psutil==7.0.0
requests==2.32.5
deepdiff==8.6.1 # output easy to read diff for troublshooting
-e .
11 changes: 1 addition & 10 deletions requirements-rocm.txt
Original file line number Diff line number Diff line change
@@ -1,11 +1,2 @@
# Note: AMD requirements might be outdated. If you can provide information about running OneTrainer on AMD,
# please open an issue or pull request on github

# pytorch
--extra-index-url https://download.pytorch.org/whl/rocm6.3
torch==2.7.1+rocm6.3 #intentionally not upgraded because of reported problems
torchvision==0.22.1+rocm6.3
onnxruntime==1.22.1

# optimizers
# TODO
-e .[rocm]
2 changes: 1 addition & 1 deletion requirements.txt
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
-r requirements-cuda.txt
-r requirements-global.txt
-r requirements-cuda.txt