Skip to content

lrzjason/T2ITrainer

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

πŸš€ T2ITrainer

⚠️ Development Notice: Currently in active development - stability not guaranteed. Frequent updates - check changelogs regularly.


πŸ“… Recent Updates

  • 2025-02-15: 🎨 Launched Flux Fill Training script for LoRA-based inpainting

πŸ›‘οΈ Prerequisites

  • PyTorch: torch>=2.3.0+cu121 (CUDA 12.1 supported) PyPI

πŸ’» Supported Training Configurations

Model Type VRAM Requirements Status
Kolors 11GB GPU βœ… Supported
SD3.5 (FP16 BS1) 24GB GPU βœ… Supported
Flux, Flux Fill 24GB GPU βœ… Supported

βš™οΈ Installation Guide

0. System Requirements

❗ Mandatory: Install Microsoft Visual C++ Redistributable if encountering DLL errors

1. Automated Setup

Recommended Method

  git clone https://github.com/lrzjason/T2ITrainer.git
  cd T2ITrainer
  setup.bat
  • Handles: Virtual Environment β€’ Dependency Installation β€’ Model Downloads

2. Manual Installation

Clone Repository 🌐

    git clone https://github.com/lrzjason/T2ITrainer.git
    cd T2ITrainer

Virtual Environment πŸ› οΈ

    python -m venv venv
    call venv\Scripts\activate
    pip3 install torch torchvision torchaudio --index-url https://download.pytorch.org/whl/cu121

Model Downloads πŸ“₯

    # Kolors
    huggingface-cli download Kwai-Kolors/Kolors --local-dir kolors_models/

    # Flux Fill
    huggingface-cli download "black-forest-labs/FLUX.1-fill-dev" --local-dir flux_models/fill/
    
    # SD3.5 Models
    huggingface-cli download "stabilityai/stable-diffusion-3.5-large" --local-dir "sd3.5L/"

πŸš€ Launch Options

Script Command Special Notes
Flux Fill python ui_flux_fill.py Requires diffusers>=0.32.0, 24GB VRAM Recommended
Kolors python ui.py Needs Fixed VAE
SD3.5 Large python ui_sd35.py 24GB VRAM Recommended

πŸ”§ Testing & Integration

  • Kolors Workflow:

        # ComfyUI Plugins
        git clone https://github.com/kijai/ComfyUI-KwaiKolorsWrapper
        git clone https://github.com/MinusZoneAI/ComfyUI-Kolors-MZ
  • Configuration Guide: πŸ“– CivitAI Article

πŸ†˜ Troubleshooting

  • Kolors Black Image Issue: Ensure you're using FP16 Fixed VAE
  • VRAM Limitations: Adjust blocks_to_swap parameter (higher values reduce memory usage)
  • Windows DLL Errors: Verify VC++ Redistributable installation

πŸ”§ Parameter Configuration Guide

CivitAI Article


🌌 Flux Model Management

Core Model Download

Base Model Installation

  huggingface-cli download "black-forest-labs/FLUX.1-dev" --local-dir flux_models/dev/

🎨 Flux Fill Special Requirements

Dependency Alert

  • Mandatory: diffusers>=0.32.0

Fill Model Installation

Inpainting Model Setup

  huggingface-cli download "black-forest-labs/FLUX.1-fill-dev" --local-dir flux_models/fill/

βš™οΈ Flux Fill Training Recommended Parameters

Category Settings
Base Configuration Rank 32, AdamW, Learn Rate 1e-4
24GB GPU 512 resolution, Batch Size 1
VRAM Optimization blocks_to_swap: 10 (15-20 for lower VRAM GPUs)
Precision bf16 (3090) / fp8 (40xx)

For more details (example dataset structure):

πŸ’» VRAM Usage (bf16, blocks_to_swap=10)

VRAM Peak
VRAM Low

Star History

Star History Chart

Old Change logs:

Recent Change Logs:

  • 2025-02-15: Released Flux Fill Training script which could train lora for flux fill.

Sponsor:

  • Thanks to @sourceful support me making flux fill lora training script.

πŸ“¬ Contact

Sponsors me for more open source projects:

Buy me a coffee:

Buy Me a Coffee QR

WeChat:

WeChat QR

Acknowledgements:

  • Thanks to minienglish1 and Freon in EveryDream Discord for the assistance.
  • Special thanks to kohya ss for references from the training codebase.
  • Thanks to Kblueleaf for coding reference on hunyuandit gradient checkpoint implementation.
  • Thanks to Kolors for the open-source checkpoint.
  • Thanks to comfyui for the wonderful codebase.
  • Thanks to emojiiii for the setup.bat script and other updates.
  • Thanks to Rohit Gandikota and related authors of Concept Sliders https://github.com/rohitgandikota/sliders

About

Practice Code for text to image trainer

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages