Sign In

FLUX LoRA trainer on ComfyUI

138
2.4k
81
Type
Workflows
Stats
1,411
Reviews
Published
Sep 20, 2024
Base Model
Flux.1 D
Hash
AutoV2
49996CE0E1
Comfy Workflow Badge
Tenofas's Avatar
Tenofas
The FLUX.1 [dev] Model is licensed by Black Forest Labs. Inc. under the FLUX.1 [dev] Non-Commercial License. Copyright Black Forest Labs. Inc.
IN NO EVENT SHALL BLACK FOREST LABS, INC. BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH USE OF THIS MODEL.

This workflow is based on the incredible work by Kijai (https://github.com/kijai/ComfyUI-FluxTrainer) who created the training nodes for ComfyUI based on Kohya_ss (https://github.com/kohya-ss/sd-scripts) work. All credits go to them. Thanks also to u/tom83_be on Reddit who posted his installation and basic settings tips.

I just reworked the workflow and wrote a user-guide. I will keep updating the workflow too here.

With this workflow you can train LoRA's for FLUX on ComfyUI.

Around 12Gb Vram is all you need on your graphic card, so you don't need a RTX 3090 or 4090 Gpu, but it may need 32Gb Ram (set "split_mode" on "true").

If you are used to ComfyUI, the training process will be very easy, as the workflow is divided in nodes' group that allow you to set all the data needed for the LoRA training in a clear and easy way.

This workflow is also being tested on Runpod, using a A40 with 48Gb Vram.

You will need the following Flux Dev model files:

The images I published were all created with a LoRA I trained with this workflow for a fiction instagram influencer called Kiara Aigen.

My suggestions: start with 10-20 image, 512x512 resolution, 2000 steps (so you will have 500 steps in each of the 4 Training group) and use Adafactor optimizer.

Remeber to set the right folder for input_dir (images set) and output_dir (where the workflow saves the LoRA's) and to change (add) a prompt in the "Init Flux Lora Training" node for Validation.

Check yellow notes in the workflow for more instructions.

Guide to this workflow is here: https://civitai.com/articles/7131/flux-lora-trainer-on-comfyui-v10

Enjoy!