- pub
Using FluxGym for Low VRAM Flux LoRA Training
Introduction
FluxGym is a web UI for training Flux LoRAs with low VRAM (12G, 16G, etc). Developed by Black Forest Labs using Kohya-ss/sd-scripts, it aims to simplify the training process for users with less powerful GPUs. This note summarizes common issues users face and offers solutions.
Problem Description
Users experience various issues while trying to use FluxGym, including high VRAM usage, implementation problems, and discrepancies in training results.
Common issues include:
- High VRAM requirements even after optimizations
- Training discrepancies
- Errors caused by environment configurations
- Slow training times on low VRAM setups
Issue 1: High VRAM Usage
Even with the optimizations, some users find VRAM usage still too high. For instance:
UPDATE: Just learned that the Florence-2 Auto-caption was not clearing the cache... this alone seems to shave off 4GB VRAM! Now, the 20G option runs with just 16G.
Link: GitHub Change
Solution:
- Ensure to pull the latest version from GitHub.
- Use the
torch.cuda.empty_cache()
function to manually clear cache where applicable.
Issue 2: Training Configurations
Some users are unclear on how to adjust training parameters for better results. Example:
so this base config is optimal for a 4090? or is there more speed to be squeezed out of it with a diff config?
Comparison:
- A4500: 58 minutes (1300 steps)
- 4090: 20 minutes (1200 steps)
Solution:
- Use the advanced tab to customize settings such as epochs, learning rates, and resolutions.
- Example of settings adjustment:
https://x.com/cocktailpeanut/status/1832113636367876446
Issue 3: Environment Setup Problems
Errors often stem from environment and dependency issues. Example:
return Variable._execution_engine.run_backward( # Calls into the C++ engine to run the backward pass" for over an hour and half.
Solution:
- Ensure Python compatibility and verify that all dependencies are installed correctly.
- Review this discussion for help:
https://github.com/pinokiofactory/factory/discussions/6
Issue 4: Discrepancies in Training Outcomes
Users report inconsistent results when training. Example:
does anyone know how to adjust settings for better results when original training does not match expectations?
Solution:
- Review and adjust parameters like steps and epochs based on dataset quality and size.
- Use higher resolutions for detailed work:
https://x.com/cocktailpeanut/status/1832098084794356081
Additional Tips
Tip 1: Keep Up with Updates
Check for updates regularly to benefit from new optimizations.
Tip 2: Use Proper Datasets
High-quality and well-tagged datasets result in better training outcomes.
Tip 3: Engage with the Community
Participate in relevant forums and discussions for support and advice.
By following these strategies and tips, you can make the most out of FluxGym for training Flux LoRAs with low VRAM. Happy training!