FLUX LoRA trainer on ComfyUI v.1.1
5.0
0 reviewsDescription
Sept. 20, 2024 - New version 1.1 with faster training settings.
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:
- flux1-dev-fp8.safetensors from https://huggingface.co/Kijai/flux-fp8/tree/main save it in ".../ComfyUI_training/ComfyUI/models/unet/
- t5xxl_fp8_e4m3fn.safetensors from https://huggingface.co/comfyanonymous/flux_text_encoders/tree/main save it in ".../ComfyUI_training/ComfyUI/models/clip/"
- clip_l.safetensorsfrom https://huggingface.co/comfyanonymous/flux_text_encoders/tree/main save it in ".../ComfyUI_training/ComfyUI/models/clip/"
- ae.safetensorsfrom https://huggingface.co/black-forest-labs/FLUX.1-dev/tree/main save it in ".../ComfyUI_training/ComfyUI/models/vae/"
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!
Discussion
(No comments yet)
Loading...
Author
Reviews
No reviews yet
Versions (3)
- latest (a year ago)
- v20240920-114843
- v20240903-080417
Node Details
Primitive Nodes (51)
Display Any (rgthree) (3)
Fast Bypasser (rgthree) (3)
FluxTrainEnd (1)
FluxTrainLoop (4)
FluxTrainModelSelect (1)
FluxTrainSave (4)
FluxTrainValidate (4)
FluxTrainValidationSettings (1)
GetNode (8)
ImageConcatFromBatch (1)
InitFluxLoRATraining (1)
Note (5)
Note Plus (mtb) (1)
OptimizerConfig (1)
SetNode (5)
TrainDatasetAdd (3)
TrainDatasetGeneralConfig (1)
VisualizeLoss (4)
Custom Nodes (21)
ComfyUI
- PreviewImage (4)
- SaveImage (5)
- SomethingToString (4)
- ImageBatchMulti (1)
- GetImageSizeAndCount (1)
- AddLabel (5)
- StringConstantMultiline (1)
Model Details
Checkpoints (0)
LoRAs (0)