NokiMo
Furkan Gözükara
Furkan Gözükara

patreon


Kohya FLUX LoRA and Fine Tuning Training Full Tutorial For Local Windows and Cloud RunPod and Massed Compute for Research & Development

I will update this page as I progress. I am just starting so I will add the info. Nothing ready yet

FOLLOW THIS THREAD NOW FOR TUTORIAL : https://www.patreon.com/posts/110879657

Who has fbgemm.dll error on Windows 11 the solutions posted below topic

Latest Zip file here : Kohya_GUI_Flux_Installer_27.zip

30 August 2024

28 August 2024

27 August 2024 Update V2

27 August 2024 Update

Newest Configs :

My suggestions for GPUs

Batch Size Experiments And Multi GPU Usage

Inference Config for Evaluating Results of Experiments

You Don't Necessarily Need Class Prompt With FLUX

Different LoRA Ranks Experiments

Higher Resolution Training Impact

QKV Split Attention and JoyCaption Detailed Captioning Trainings Results

Time Step Sampling Shift Experiments

Apply T5 Attention Mask and detailed Regularization / Classifications Images Impact Experiments

More Different Experiments Are Historically shared below read the entire thread

-

24 August 2024 Update V2

24 August 2024 Update

23 August 2024 Update

22 August 2024 Update

22 August 2024 Update

21 August 2024 Update

20 August 2024 Update

Windows Requirements

How To Install

FLUX Training Discussions With Lots of Info

Models Links Downloads

FLUX Fine Tuning Lower VRAM Optimizations

Previous Master Kohya Tutorials

Massed Compute

Auxiliary Scripts and Tutorials

FLUX Guidance Scale Grid Test on LoRA

FLUX Huge Sampler + Scheduler Test For a Very Hard Prompt

Experiments and VRAM Usages

Running Experiments

Early Testing Results

 

More results obtained

 

 Some more full comparisons attached to attachments

New Started Trainings

48 GB Configs - uses 42.6 GB VRAM

24 GB Configs - uses 23.30 GB VRAM

New Training Results for 48 GB Configs

24 GB Experiments

Started 7 New Trainings

Kohya FLUX LoRA and Fine Tuning Training Full Tutorial For Local Windows and Cloud RunPod and Massed Compute for Research & Development Kohya FLUX LoRA and Fine Tuning Training Full Tutorial For Local Windows and Cloud RunPod and Massed Compute for Research & Development Kohya FLUX LoRA and Fine Tuning Training Full Tutorial For Local Windows and Cloud RunPod and Massed Compute for Research & Development Kohya FLUX LoRA and Fine Tuning Training Full Tutorial For Local Windows and Cloud RunPod and Massed Compute for Research & Development Kohya FLUX LoRA and Fine Tuning Training Full Tutorial For Local Windows and Cloud RunPod and Massed Compute for Research & Development Kohya FLUX LoRA and Fine Tuning Training Full Tutorial For Local Windows and Cloud RunPod and Massed Compute for Research & Development Kohya FLUX LoRA and Fine Tuning Training Full Tutorial For Local Windows and Cloud RunPod and Massed Compute for Research & Development Kohya FLUX LoRA and Fine Tuning Training Full Tutorial For Local Windows and Cloud RunPod and Massed Compute for Research & Development Kohya FLUX LoRA and Fine Tuning Training Full Tutorial For Local Windows and Cloud RunPod and Massed Compute for Research & Development Kohya FLUX LoRA and Fine Tuning Training Full Tutorial For Local Windows and Cloud RunPod and Massed Compute for Research & Development Kohya FLUX LoRA and Fine Tuning Training Full Tutorial For Local Windows and Cloud RunPod and Massed Compute for Research & Development Kohya FLUX LoRA and Fine Tuning Training Full Tutorial For Local Windows and Cloud RunPod and Massed Compute for Research & Development Kohya FLUX LoRA and Fine Tuning Training Full Tutorial For Local Windows and Cloud RunPod and Massed Compute for Research & Development Kohya FLUX LoRA and Fine Tuning Training Full Tutorial For Local Windows and Cloud RunPod and Massed Compute for Research & Development Kohya FLUX LoRA and Fine Tuning Training Full Tutorial For Local Windows and Cloud RunPod and Massed Compute for Research & Development Kohya FLUX LoRA and Fine Tuning Training Full Tutorial For Local Windows and Cloud RunPod and Massed Compute for Research & Development Kohya FLUX LoRA and Fine Tuning Training Full Tutorial For Local Windows and Cloud RunPod and Massed Compute for Research & Development Kohya FLUX LoRA and Fine Tuning Training Full Tutorial For Local Windows and Cloud RunPod and Massed Compute for Research & Development Kohya FLUX LoRA and Fine Tuning Training Full Tutorial For Local Windows and Cloud RunPod and Massed Compute for Research & Development Kohya FLUX LoRA and Fine Tuning Training Full Tutorial For Local Windows and Cloud RunPod and Massed Compute for Research & Development Kohya FLUX LoRA and Fine Tuning Training Full Tutorial For Local Windows and Cloud RunPod and Massed Compute for Research & Development Kohya FLUX LoRA and Fine Tuning Training Full Tutorial For Local Windows and Cloud RunPod and Massed Compute for Research & Development

Comments

with FLUX yes. since we utilize RAM heavily with Block Swapping. Upgrade to 64 GB and i guarantee it will work flawlessly

Furkan Gözükara

My RAM is 32gb. Ah i see, it’s correlated with system ram too because of my limited vram🫡

Michael Liu

how much system RAM you have? probably 32 right? upgrade to 64 and it shouldnt happen anymore.

Furkan Gözükara

Why i always run out of memory, unless enabling fp8 base ? Rtx 4060Ti 16gb vram🙏🏻

Michael Liu

no FLUX works great. I had tested higher batch size with SDXL with limited test it was terrible :D you can see FLUX grids here read top to bottom please : https://www.patreon.com/posts/112099700

Furkan Gözükara

But did you see any changes on face consistency? On sdxl with higher batch it looked like the face shapes for different expressions became "merged together". So like the rounded cheeks of a huge smile shown up on non smiling faces and weird things like this... Anyways i will test it out anyways because im curious, i will use your settings to make sure i nail the LR.

David Bene

i tested batch size 1 vs 7 on flux. and batch size 7 requires new LR. you may apply square root 7 x batch size 1 LR. so if you want to apply that to SDXL you need to also amplify learning rate. moreover batch size 1 still yields the very best quality. I really cant return SDXL since its quality horrific compared to FLUX :D i plan to investigate fully SD 3.5 medium which will be lightweight and still good quality and also SD 3.5 large

Furkan Gözükara

I saw you increase batch to 7 or so. With sdxl and sd1.5 it decreased the subject fidelity by a huge degree during lora training. Does it have any effect on flux finetune? Could you share test images with batch count 1 vs 7? Thanks for the great content btw.

David Bene

please follow this video if you format pc : https://youtu.be/DrhUHnYfwC0

Furkan Gözükara

Just installed 3.10 and have the same issue. Did a complete uninstall and reinstall of all apps and still quits. I'm going to try a fresh install of Win10 later tonight

Jim M

ye please use python 3.10.11

Furkan Gözükara

When doing the initial install, and selecting "1" to start the cmd windows quits. I've installed all the requirements, but using Python 3.11.

Jim M

Have you ever tried some specific painting style? I am struggling with it.

Wayne Li

i plan to test new optimizers hopefully soon

Furkan Gözükara

Any thoughts on using AdEMAMix?

Steve

it is ok step 2 fixes xformers. also since we dont use xformers during training it is not important either

Furkan Gözükara

I got the following install errors: Collecting torchvision==0.19.0+cu124 Downloading https://download.pytorch.org/whl/cu124/torchvision-0.19.0%2Bcu124-cp310-cp310-win_amd64.whl (5.9 MB) ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 5.9/5.9 MB 25.0 MB/s eta 0:00:00 ERROR: Could not find a version that satisfies the requirement xformers==0.0.27.post2 (from versions: none) ERROR: No matching distribution found for xformers==0.0.27.post2 [notice] A new release of pip is available: 23.0.1 -> 24.2 [notice] To update, run: python.exe -m pip install --upgrade pip

Chris Johnson

i havent tried yet. i trained a style though it is being shared here - will update there in few hours : https://huggingface.co/MonsterMMORPG/3D-Cartoon-Style-FLUX

Furkan Gözükara

Have you tried training multiple subjects in the same Lora? I did 3 subjects placed in 3 different folders under the img folder. I only get black images. Nothing generated.

Robert Arsene

it can't be. use massed compute to train there

Furkan Gözükara

Hi. so can this be used for mac? I don't have windows.

Dylan Normandin

hello to fix this issue you need to copy paste that dll or install c++ and reinstall. your solution options shared in this post i just updated it

Furkan Gözükara

yes someone asked this to kohya. it is because of caching prompts. i think still not fixed but can you ask this here ? https://github.com/kohya-ss/sd-scripts/pull/1374

Furkan Gözükara

Hello, I'm currently using Kohya_GUI_Flux_Installer_v17.zip, which is working great BTW for training, but if I try to change the sample prompts midway though training, it hangs. Is this fixed in Kohya_GUI_Flux_Installer_v18.zip?

LoRAMaker4435

Looks like some module is having trouble loading - Traceback (most recent call last): File "C:\Users\moinh\AppData\Local\Programs\Python\Python310\lib\runpy.py", line 196, in _run_module_as_main return _run_code(code, main_globals, None, File "C:\Users\moinh\AppData\Local\Programs\Python\Python310\lib\runpy.py", line 86, in _run_code exec(code, run_globals) File "D:\ForgeFlux\Kohya_GUI_Flux_Installer_21\kohya_ss\venv\Scripts\accelerate.exe\__main__.py", line 4, in File "D:\ForgeFlux\Kohya_GUI_Flux_Installer_21\kohya_ss\venv\lib\site-packages\accelerate\__init__.py", line 16, in from .accelerator import Accelerator File "D:\ForgeFlux\Kohya_GUI_Flux_Installer_21\kohya_ss\venv\lib\site-packages\accelerate\accelerator.py", line 32, in import torch File "D:\ForgeFlux\Kohya_GUI_Flux_Installer_21\kohya_ss\venv\lib\site-packages\torch\__init__.py", line 148, in raise err OSError: [WinError 126] The specified module could not be found. Error loading "D:\ForgeFlux\Kohya_GUI_Flux_Installer_21\kohya_ss\venv\lib\site-packages\torch\lib\fbgemm.dll" or one of its dependencies.

Moin Syed

FLUX itself tends to generate blurry backgrounds at the moment. try to add some prompts that will remove blurry backgrounds. like sharp focused i dont know try to find :D

Furkan Gözükara

I tried it with the same amount of Images that you used in the youtube video. For some reason, I am getting a good likeness, but the backgrounds are blurry. Did I do something wrong?

Diggy Dre

yes you should be able to use any flux DEV version checkpoint and it should work perfectly. but make sure that they are either fp8 or fp16 not quantized versions

Furkan Gözükara

Thank you for the work on this one Furkan. Question: In theory, can we use any base Flux model while training the LORA so long as we use the same when it comes time later to generate images?. e.g. if we downloaded a fine-tuned FLUX checkpoint from huggingface/civitai? Or are there some limits/constraints?

meteor 1942

i think it can i am still researching it and will update configs once i have perfected it hopefully

Furkan Gözükara

Clip L text encoder. After training, do you think the quality has been significantly improved?

楠 陈

video published : https://youtu.be/nySGu12Y05k

Furkan Gözükara

hello. extract the config again from zip file and directly load into lora tab. it is probably corrupted. and it shall work

Furkan Gözükara

Hello! I i stuck here: INFO no latents to cache train_util.py:1034 2024-08-28 19:52:03 INFO move vae and unet to cpu to save memory flux_train_network.py:187 Traceback (most recent call last): File "/workspace/kohya_ss/sd-scripts/flux_train_network.py", line 445, in trainer.train(args) File "/workspace/kohya_ss/sd-scripts/train_network.py", line 392, in train self.cache_text_encoder_outputs_if_needed(args, accelerator, unet, vae, text_encoders, train_dataset_group, weight_dtype) File "/workspace/kohya_ss/sd-scripts/flux_train_network.py", line 191, in cache_text_encoder_outputs_if_needed unet.to("cpu") File "/workspace/kohya_ss/venv/lib/python3.10/site-packages/torch/nn/modules/module.py", line 1174, in to return self._apply(convert) File "/workspace/kohya_ss/venv/lib/python3.10/site-packages/torch/nn/modules/module.py", line 780, in _apply module._apply(fn) File "/workspace/kohya_ss/venv/lib/python3.10/site-packages/torch/nn/modules/module.py", line 805, in _apply param_applied = fn(param) File "/workspace/kohya_ss/venv/lib/python3.10/site-packages/torch/nn/modules/module.py", line 1167, in convert raise NotImplementedError( NotImplementedError: Cannot copy out of meta tensor; no data! Please use torch.nn.Module.to_empty() instead of torch.nn.Module.to() when moving module from meta to a different device. Traceback (most recent call last): File "/workspace/kohya_ss/venv/bin/accelerate", line 8, in sys.exit(main()) File "/workspace/kohya_ss/venv/lib/python3.10/site-packages/accelerate/commands/accelerate_cli.py", line 48, in main args.func(args) File "/workspace/kohya_ss/venv/lib/python3.10/site-packages/accelerate/commands/launch.py", line 1106, in launch_command simple_launcher(args) File "/workspace/kohya_ss/venv/lib/python3.10/site-packages/accelerate/commands/launch.py", line 704, in simple_launcher raise subprocess.CalledProcessError(returncode=process.returncode, cmd=cmd) subprocess.CalledProcessError: Command '['/workspace/kohya_ss/venv/bin/python', '/workspace/kohya_ss/sd-scripts/flux_train_network.py', '--config_file', '/workspace/kohya_ss/outputs/config_lora-20240828-195119.toml']' returned non-zero exit status 1. 19:52:04-971507 INFO Training has ended. Do you have any idea 48gb vram runpod flux1 is selected

Cody1611

Hi Furkan, I just write the same problem of runpod today (yesterday it worked). Yes I've select a6000 ADA and the template that you suggest in the instruction file.

Samael1976

you probably didnt load into LoRA tab. I am recording a video wait for it

Furkan Gözükara

Sorry to say but this is a mess ... no real conclusion, a lot of "best" everywhere but impossible to find the configs easily to use. I've tried few of them which are simply not working with my 3090.

Frederic Collin

it inpaint face after image generated to get better face. you can use notepad++ to replace all and remove all such part and test and see

Furkan Gözükara

Sorry, the most important part is probably missing. this is not transferred with the brackets. "segment:face,0.7"

Mike

what you mean?

Furkan Gözükara

Hello, why is this in the prompt?

Mike

awesome ty for comment. i am gonna do 8 more training today for some new feature came to kohya

Furkan Gözükara

the new scripts worked right out of the box for me on 3 12gb machines. Thank you Furkan!

Adam Chido

:D it takes time

Furkan Gözükara

t5 text encoder attention masking. it slightly improves quality

Furkan Gözükara

i dont have but i have swarmui tutorial here : https://youtu.be/bupRePUOA18

Furkan Gözükara

What is the difference in these two regarding quality? Rank_1_28700MB_Slow.json - 16bit - 8.53 second / it Rank_2_27360MB_Fast.json - 16bit - 4.49 second / it I see its double the time for full training....

Arcon Septim

Hello everyone, can I find a workflow for confyUI anywhere?

stephan stinker

very soon 1 week haha

Arcon Septim

yep caption reduces likeliness i just add grid test results for that

Furkan Gözükara

i just updated configs can you try lower VRAM configs and let me know? it doesnt tell the error reason

Furkan Gözükara

can't get it to work with my RTX 3090; it runs out of memory. I followed the instructions for the update in step 2 and configured the acceleration settings as you suggested, but I'm still facing this issue. I'm not sure where I'm going wrong "You are using the default legacy behaviour of the . This is expected, and simply means that the legacy (previous) behavior will be used so nothing changes for you. If you want to use the new behaviour, set legacy=False. This should only be set if you understand what it means, and thoroughly read the reason why this was added as explained in https://github.com/huggingface/transformers/pull/24565 INFO Using DreamBooth method. train_network.py:279 INFO prepare images. train_util.py:1803 INFO get image size from name of cache files train_util.py:1741 100%|████████████████████████████████████████████████████████████████████████████████| 19/19 [00:00<00:00, 3800.09it/s] INFO set image size from cache files: 0/19 train_util.py:1748 INFO found directory C:\koya\kohya_ss\outputs\prep\img\1_messi man contains train_util.py:1750 19 image files WARNING No caption file found for 19 images. Training will continue without train_util.py:1781 captions for these images. If class token exists, it will be used. / 19枚の画像にキャプションファイルが見つかりませんでした。これらの画像につ いてはキャプションなしで学習を続行します。class tokenが存在する場合はそれを使います。 WARNING C:\koya\kohya_ss\outputs\prep\img\1_messi man\2.PNG train_util.py:1788 WARNING C:\koya\kohya_ss\outputs\prep\img\1_messi man\Ca3ptura.PNG train_util.py:1788 WARNING C:\koya\kohya_ss\outputs\prep\img\1_messi man\Capt3ura.PNG train_util.py:1788 WARNING C:\koya\kohya_ss\outputs\prep\img\1_messi man\Capt5ura.PNG train_util.py:1788 WARNING C:\koya\kohya_ss\outputs\prep\img\1_messi man\Captura2.PNG train_util.py:1788 WARNING C:\koya\kohya_ss\outputs\prep\img\1_messi man\proxy-image (11).jpeg... train_util.py:1786 and 14 more INFO 19 train images with repeating. train_util.py:1844 INFO 0 reg images. train_util.py:1847 WARNING no regularization images / 正則化画像が見つかりませんでした train_util.py:1852 INFO [Dataset 0] config_util.py:570 batch_size: 1 resolution: (1024, 1024) enable_bucket: False network_multiplier: 1.0 [Subset 0 of Dataset 0] image_dir: "C:\koya\kohya_ss\outputs\prep\img\1_messi man" image_count: 19 num_repeats: 1 shuffle_caption: False keep_tokens: 0 keep_tokens_separator: caption_separator: , secondary_separator: None enable_wildcard: False caption_dropout_rate: 0.0 caption_dropout_every_n_epoches: 0 caption_tag_dropout_rate: 0.0 caption_prefix: None caption_suffix: None color_aug: False flip_aug: False face_crop_aug_range: None random_crop: False token_warmup_min: 1, token_warmup_step: 0, alpha_mask: False, is_reg: False class_tokens: messi man caption_extension: .txt INFO [Dataset 0] config_util.py:576 INFO loading image sizes. train_util.py:876 100%|███████████████████████████████████████████████████████████████████████████████| 19/19 [00:00<00:00, 18978.75it/s] INFO prepare dataset train_util.py:884 INFO preparing accelerator train_network.py:333 accelerator device: cuda 2024-08-26 13:37:08 INFO Building Flux model dev flux_utils.py:43 INFO Loading state dict from flux_utils.py:48 C:/Users/billi/AI/ComfyUI_windows_portable/ComfyUI/models/unet/flux1-dev.s afetensors INFO Loaded Flux: flux_utils.py:51 INFO Building CLIP flux_utils.py:70 INFO Loading state dict from flux_utils.py:163 C:/Users/billi/AI/ComfyUI_windows_portable/ComfyUI/models/clip/clip_l.saf etensors INFO Loaded CLIP: flux_utils.py:166 INFO Loading state dict from flux_utils.py:209 C:/Users/billi/AI/ComfyUI_windows_portable/ComfyUI/models/clip/t5xxl_fp16 .safetensors INFO Loaded T5xxl: flux_utils.py:212 INFO Building AutoEncoder flux_utils.py:58 INFO Loading state dict from flux_utils.py:62 C:/Users/billi/AI/ComfyUI_windows_portable/ComfyUI/models/vae/ae.sft INFO Loaded AE: flux_utils.py:65 import network module: networks.lora_flux INFO [Dataset 0] train_util.py:2326 INFO caching latents with caching strategy. train_util.py:984 INFO checking cache validity... train_util.py:994 100%|███████████████████████████████████████████████████████████████████████████████| 19/19 [00:00<00:00, 18996.85it/s] INFO caching latents... train_util.py:1038 100%|██████████████████████████████████████████████████████████████████████████████████| 19/19 [00:03<00:00, 5.16it/s] 2024-08-26 13:37:12 INFO move vae and unet to cpu to save memory flux_train_network.py:156 INFO move text encoders to gpu flux_train_network.py:164 Traceback (most recent call last): File "C:\Python3_10_11\lib\runpy.py", line 196, in _run_module_as_main return _run_code(code, main_globals, None, File "C:\Python3_10_11\lib\runpy.py", line 86, in _run_code exec(code, run_globals) File "C:\koya\kohya_ss\venv\Scripts\accelerate.EXE\__main__.py", line 7, in File "C:\koya\kohya_ss\venv\lib\site-packages\accelerate\commands\accelerate_cli.py", line 48, in main args.func(args) File "C:\koya\kohya_ss\venv\lib\site-packages\accelerate\commands\launch.py", line 1106, in launch_command simple_launcher(args) File "C:\koya\kohya_ss\venv\lib\site-packages\accelerate\commands\launch.py", line 704, in simple_launcher raise subprocess.CalledProcessError(returncode=process.returncode, cmd=cmd) subprocess.CalledProcessError: Command '['C:\\koya\\kohya_ss\\venv\\Scripts\\python.exe', 'C:/koya/kohya_ss/sd-scripts/flux_train_network.py', '--config_file', 'C:/koya/kohya_ss/outputs/prep\\model/config_lora-20240826-133657.toml']' returned non-zero exit status 3221225477. 13:37:51-568657 INFO Training has ended"

Franco Antonelli

I have tried both (training realistic photos from myself) and without captioning worked better for me

Max

Use Europe if possible, haven't had any problems there.

Max

I think the biggest issue was I was testing multi epochs using S/R script and that was causing it to have to load the new model and then move it after all generations. I switched to the regular model and it works fine for the 4070 seems like the same speed as the quantified one I was using. testing the epochs in independent generations instead of using that search replace script for each epoch vastly improved speed. sacrificing the automatic grid to see it at a glance wasnt a big deal.

Steve

same here

Franco Antonelli

i think people working to make work loras with such quantized dev models but not sure about latest status

Furkan Gözükara

use fp16 dev model it will cast to fp8. captioning reduces likeliness i have tested and gonna post hopefully tomorrow. for style training captions may work better though

Furkan Gözükara

yep hopefully windows, runpod and massed compute tutorials very soon

Furkan Gözükara

will you be doing a full flux tutorial with runpod kohya?

Arvin Flores

you were correct using the full size model to train fixed the issue. took about 25hours to train 100 epoch on a 4070 i believe total training was around 5k steps. The issue I'm running into now is that using those loras with the flux.1 dev bnb 4-bit model takes forever to generate art. ~about one hour per 35 step image.

Steve

Hi, Do I need to caption the dataset? and I notice that the "use fp8 base model" is truned on, does that mean I can use fp8 dev model? and Which model give better result?

guangyu niu

waiting for u

shen oracle

supposed to work in forge

Furkan Gözükara

Does the Lora is suppose to work in Forge or only in ComfyUI ?

ElecMat

no for fine tuning i will do a new research

Furkan Gözükara

你的json既可以finetune又可以lora?

shen oracle

yep runpod broken. 2.5 second great

Furkan Gözükara

Ok, so fortunately, it does work with the A100. So probably they (runpod) have some problems with the A40 Pods in Europe, because in terms of Memory, the A100 isn't nearly at it's limits :D But it's nice to see 1014x1024 only taking around 2.5-3 seconds per iteration :D

Max

I'm right now testing on an A100 GPU to really test it out

Max

Hmmm... What images are you using? 1024x1024, or 512x512? Because i tried it on 6 different pods, and no pod seem to be working :D

Max

flux.1 dev bnb 4-bit could not be supported. by the way the vram usage doesnt related to base model you pick during training. so use fp16 dev model the best handled case

Furkan Gözükara

hello just tested and it works. but A40 is slow :d https://pasteboard.co/QENsE96CfaBK.png https://pasteboard.co/jqaeX3as53C2.png probably it was broken pod

Furkan Gözükara

It's definitely checked. i used the flux.1 dev bnb 4-bit because I was using that for forge based on your benchmark. I figured once I got it working I would slowly work my way to higher models until I got OOM on my 12gb 4070. I haven't tried the update yet I'll be able to try it in a couple of hours.

Steve

Have you found out something? I also tested a bit but still cannot find where it's hanging right now (as it worked yesterday on that machine with this setting - which is not the case anymore, tested an older version but i get the same error)

Max

30 steps uni pc normal . If you have vram use dram 16bit

Furkan Gözükara

What are the best settings and sampler in SwarmUI to use with this flux model and lora for best generation results? Steps amount CFG etc Thank you!

Arcon Septim

what is 8/8? 18 gb is 1024x1024 for me :D - but it is raw. your windows will use some extra too

Furkan Gözükara

great. i use swarmui works perfect

Furkan Gözükara

i am testing right now to fix if broken thanks

Furkan Gözükara

Now i'm just frustrated. Fresh Kohya installs on the right repo, fresh python, your fix scripts run without error, but i can't get training under like 18gb even at 512 and 8/8. I am not in a hurry. Make sure you're sleeping, lol.

Adam Chido

One moment, i have to check. edit: Yes, it's the official runpod pytorch 2.1 with python 3.10 and Cuda 11.8.0, so exactly the one you mention in your guide :)

Max

I know ;) Already found out that forge is (still after the update) trying to patch LoRas which results in huge amounts of Vram, so i switched to Comfyui and the first Lora i trained was "ok". Way to overfitted and quality is "ok" as i trained it on 512, not 1024 pixels

Max

Yes it is unrelated :)

Furkan Gözükara

Did you select pytorch Cuda 11.8 template as Witten? I will test and let you know if broken or not. It is a40 gpu right?

Furkan Gözükara

2024-08-24 13:12:04 INFO epoch is incremented. current_epoch: 0, epoch: 1 train_util.py:668 /workspace/kohya_ss/venv/lib/python3.10/site-packages/torch/utils/checkpoint.py:1399: FutureWarning: `torch.cpu.amp.autocast(args...)` is deprecated. Please use `torch.amp.autocast('cpu', args...)` instead. with device_autocast_ctx, torch.cpu.amp.autocast(**cpu_autocast_kwargs), recompute_context: # type: ignore[attr-defined] Traceback (most recent call last): File "/workspace/kohya_ss/sd-scripts/flux_train.py", line 905, in train(args) File "/workspace/kohya_ss/sd-scripts/flux_train.py", line 736, in train accelerator.backward(loss) File "/workspace/kohya_ss/venv/lib/python3.10/site-packages/accelerate/accelerator.py", line 2159, in backward loss.backward(**kwargs) File "/workspace/kohya_ss/venv/lib/python3.10/site-packages/torch/_tensor.py", line 521, in backward torch.autograd.backward( File "/workspace/kohya_ss/venv/lib/python3.10/site-packages/torch/autograd/__init__.py", line 289, in backward _engine_run_backward( File "/workspace/kohya_ss/venv/lib/python3.10/site-packages/torch/autograd/graph.py", line 768, in _engine_run_backward return Variable._execution_engine.run_backward( # Calls into the C++ engine to run the backward pass File "/workspace/kohya_ss/venv/lib/python3.10/site-packages/torch/utils/checkpoint.py", line 1116, in unpack_hook frame.recompute_fn(*args) File "/workspace/kohya_ss/venv/lib/python3.10/site-packages/torch/utils/checkpoint.py", line 1400, in recompute_fn fn(*args, **kwargs) File "/workspace/kohya_ss/sd-scripts/library/flux_models.py", line 720, in _forward attn = attention(q, k, v, pe=pe, attn_mask=attn_mask) File "/workspace/kohya_ss/sd-scripts/library/flux_models.py", line 446, in attention x = torch.nn.functional.scaled_dot_product_attention(q, k, v, attn_mask=attn_mask) torch.OutOfMemoryError: CUDA out of memory. Tried to allocate 972.00 MiB. GPU 0 has a total capacity of 44.35 GiB of which 541.44 MiB is free. Process 1747024 has 43.81 GiB memory in use. Of the allocated memory 41.34 GiB is allocated by PyTorch, and 2.15 GiB is reserved by PyTorch but unallocated. If reserved but unallocated memory is large try setting PYTORCH_CUDA_ALLOC_CONF=expandable_segments:True to avoid fragmentation. See documentation for Memory Management (https://pytorch.org/docs/stable/notes/cuda.html#environment-variables) steps: 0%| | 0/2400 [00:06 sys.exit(main()) File "/workspace/kohya_ss/venv/lib/python3.10/site-packages/accelerate/commands/accelerate_cli.py", line 48, in main args.func(args) File "/workspace/kohya_ss/venv/lib/python3.10/site-packages/accelerate/commands/launch.py", line 1106, in launch_command simple_launcher(args) File "/workspace/kohya_ss/venv/lib/python3.10/site-packages/accelerate/commands/launch.py", line 704, in simple_launcher raise subprocess.CalledProcessError(returncode=process.returncode, cmd=cmd) subprocess.CalledProcessError: Command '['/workspace/kohya_ss/venv/bin/python', '/workspace/kohya_ss/sd-scripts/flux_train.py', '--config_file', '/workspace/kohya_ss/outputs/config_dreambooth-20240824-131040.toml']' returned non-zero exit status 1. 13:12:12-693701 INFO Training has ended. in the todays version of 48gb and even 24 GB i get this error when training on 1024*1024 images on an A40 (runpod) with 48GB of VRAM. It seems like there's an outofmemory issue because the memory handling doesn't seem to be working correctly. Do you have any ideas on how to solve this?

Max

updated configs and added Windows_Download_Training_Model_Files.bat file to download necessary training model files into the bat file run directory please try newest

Furkan Gözükara

this happens when you dont select flux1 checkbox. please make sure to check it. added screenshot to the top of page. also updated configs please download latest ones and which base model are you using? i will add 1 click downloader to download all necessary base models

Furkan Gözükara

still with 8/24 update getting the same error: Traceback (most recent call last): File "W:\Kohya_GUI_Flux_Installer_v3\kohya_ss\sd-scripts\flux_train_network.py", line 411, in trainer.train(args) File "W:\Kohya_GUI_Flux_Installer_v3\kohya_ss\sd-scripts\train_network.py", line 342, in train model_version, text_encoder, vae, unet = self.load_target_model(args, weight_dtype, accelerator) File "W:\Kohya_GUI_Flux_Installer_v3\kohya_ss\sd-scripts\flux_train_network.py", line 65, in load_target_model model = self.prepare_split_model(model, weight_dtype, accelerator) File "W:\Kohya_GUI_Flux_Installer_v3\kohya_ss\sd-scripts\flux_train_network.py", line 98, in prepare_split_model flux_upper.to(accelerator.device, dtype=target_dtype) File "W:\Kohya_GUI_Flux_Installer_v3\kohya_ss\venv\lib\site-packages\torch\nn\modules\module.py", line 1174, in to return self._apply(convert) File "W:\Kohya_GUI_Flux_Installer_v3\kohya_ss\venv\lib\site-packages\torch\nn\modules\module.py", line 780, in _apply module._apply(fn) File "W:\Kohya_GUI_Flux_Installer_v3\kohya_ss\venv\lib\site-packages\torch\nn\modules\module.py", line 805, in _apply param_applied = fn(param) File "W:\Kohya_GUI_Flux_Installer_v3\kohya_ss\venv\lib\site-packages\torch\nn\modules\module.py", line 1167, in convert raise NotImplementedError( NotImplementedError: Cannot copy out of meta tensor; no data! Please use torch.nn.Module.to_empty() instead of torch.nn.Module.to() when moving module from meta to a different device. Traceback (most recent call last): File "C:\Users\SysOp\AppData\Local\Programs\Python\Python310\lib\runpy.py", line 196, in _run_module_as_main return _run_code(code, main_globals, None, File "C:\Users\SysOp\AppData\Local\Programs\Python\Python310\lib\runpy.py", line 86, in _run_code exec(code, run_globals) File "W:\Kohya_GUI_Flux_Installer_v3\kohya_ss\venv\Scripts\accelerate.EXE\__main__.py", line 7, in File "W:\Kohya_GUI_Flux_Installer_v3\kohya_ss\venv\lib\site-packages\accelerate\commands\accelerate_cli.py", line 48, in main args.func(args) File "W:\Kohya_GUI_Flux_Installer_v3\kohya_ss\venv\lib\site-packages\accelerate\commands\launch.py", line 1106, in launch_command simple_launcher(args) File "W:\Kohya_GUI_Flux_Installer_v3\kohya_ss\venv\lib\site-packages\accelerate\commands\launch.py", line 704, in simple_launcher raise subprocess.CalledProcessError(returncode=process.returncode, cmd=cmd) subprocess.CalledProcessError: Command '['W:\\Kohya_GUI_Flux_Installer_v3\\kohya_ss\\venv\\Scripts\\python.exe', 'W:/Kohya_GUI_Flux_Installer_v3/kohya_ss/sd-scripts/flux_train_network.py', '--config_file', 'W:/NewLoraFactory/model/config_lora-20240824-051834.toml']' returned non-zero exit status 1. 05:19:07-202926 INFO Training has ended.

Steve

For me it's exactly the same, i even get an out of memory issue in forge, although i have 48GB of ram, but i assume this error is not related to lora size :)

Max

we don't use reg images for FLUX

Furkan Gözükara

you are welcome. you will merge lora with base model you trained don't forget

Furkan Gözükara

感谢

shen oracle

you can merge lora and extract lora again with lower rank via kohya gui lora tool

Furkan Gözükara

hello again. please try latest Kohya_GUI_Flux_Installer_v9.zip . don't forget Fix_For_FLUX_Step_2.bat . it works on my rtx 3060 perfect but slow

Furkan Gözükara

有工具可以让我不用重新训练,而把lora文件变小吗?

shen oracle

let me test latest version gui it may have broken. gui option was not working previously that is why i had to provide that

Furkan Gözükara

with that config i am training on my home RTX 3060 you can see video here : https://www.reddit.com/r/FluxAI/comments/1ey6ie3/kohya_ss_gui_flux_lora_training_on_rtx_3060_lora/ i will hopefully make a full video very soon that should help you

Furkan Gözükara

we save as float which doubles the size. you can save as fp16. also we use 128 rank. currently training 4, 8 , 16 , 32 , 64 to compare

Furkan Gözükara

the result lora file is more the 2GB,so big?

shen oracle

The following parameters in the 10_12_16GB_GPU configuration file are incorrect/throw errors. Consumer cards do not behave like commercial hardware: "additional_parameters": "--network_args train_blocks=single" -results in error prior to training commenceing, there is a gui option for train_blocks=single "apply_t5_attn_mask": true, - Only applies to double blocks "fp8_base": true, - fp8 is not available on consumer hardware "highvram": true, - why is highvram active on lowvram cards? Finally, these configurations, even when the appropriate corrections have been made, result in Cuda out of memory errors on 3 separate systems using 12gb cards. I do not believe this configuration is ready for release.

Adam Chido

you have to go to dataset preparation set instance prompt and class prompt, then set training images folder with 1 repeats and set the destination training folder, then click prepare training data and after its done in the cmd then click copy info to respective folders, it worked for me

Pidak

great

Furkan Gözükara

you are welcome

Furkan Gözükara

solved! thanks a lot

Franco Antonelli

sorry ! i can t see where the error is. is set a folder "traininng_imgs" with a subfolder with all my images. thanks

Franco Antonelli

thanks!

Franco Antonelli

sure let me know. man is class token helps model to understand what you train. if you train woman you write woman

Furkan Gözükara

Do we really have to write "man" at the end? Or is it just the name/triggerword? What happens if i train it on 25? I will just let it run as i'm in my 10th epoch right now (only going to 50). And i also used captioning, i will write about the results as soon as i get some :)

Max

folder name is like 1_ohwx man dont do 25 make 1 and train up to 200 epoch. usually 150 is good. save checkpoints and compare them. dont use reg images they dont help leave that alone

Furkan Gözükara

for flux 1 folder we dont use reg images. they dont improve results. make repeat 1. also ohwx man as prompt works great but i didnt test captioning with flux yet. hopefully will try

Furkan Gözükara

I just found out that even with Flux you have to name the Folders as in dreambooth. But do you have any recommendations on that? Or even a guide on what all of that means? So for me, i used 25, because i assumed it's then 25 steps per epoch, right? But what about the name and the classification? For the first lora i wanted to train it on myself, so i sticked to what you've used in the tutorial. But what if i want to train on a dog? should i then name the folder "25_[nameofdog] dog"?

Max

what about dataset preparation tab where do I put ohwx man or woman how many repeat no regularisation folder and destination training directory??

Arcon Septim

I followed the 22 August 2024 Update guide but you don't mention anything about the regularization images or the .txt files whit trigger words that we need for sd 1.5 or sdxl trainings. Do we need them for Flux trainings or just 1 folder whit all the images is enough for a good Flux Lora?

ElecMat

For me it's exactly the same. All my images are 3 Dimension (RGB) .jpg 512*512 files. And the script checks if the folder exists and contains data. However, if i click on training, i get the exact same error.

Max

i am gonna write this to them now :D

Furkan Gözükara

SwarmUI grid explained here : https://youtu.be/HKX8_F1Er_w 47:13 Full guide for extremely powerful grid image generation (like X/Y/Z plot)

Furkan Gözükara

What workflow are you using to generate your results?

Andrew Tomkins

Massedcompute never available for training :( Runpod it seems :)

Arcon Septim

you didnt set your training images folder path accurately max_train_steps (0 / 1 / 1 * 200 * 1) = 0 watch this tutorial carefully to understand how kohya works until i make a video. or i give private consultation too : https://youtu.be/sBFGitIvD2A

Furkan Gözükara

i got the same config as in the example but geting this error once i start training 13:55:05-144169 INFO Start training Dreambooth... 13:55:05-146170 INFO Validating lr scheduler arguments... 13:55:05-149171 INFO Validating optimizer arguments... 13:55:05-151171 INFO Validating C:/Users/billi/AI/ComfyUI_windows_portable/ComfyUI/models/loras existence and writability... SUCCESS 13:55:05-152172 INFO Validating C:/Users/billi/AI/ComfyUI_windows_portable/ComfyUI/models/unet/flux1-dev.safetensors existence... SUCCESS 13:55:05-153172 INFO Validating C:/Users/billi/AI/flux training/training_imgs existence... SUCCESS 13:55:05-157173 INFO Error: 'ok_messi' does not contain an underscore, skipping... 13:55:05-159173 INFO Regulatization factor: 1 13:55:05-160173 INFO Total steps: 0 13:55:05-163174 INFO Train batch size: 1 13:55:05-164174 INFO Gradient accumulation steps: 1 13:55:05-165174 INFO Epoch: 200 13:55:05-166175 INFO max_train_steps (0 / 1 / 1 * 200 * 1) = 0 13:55:05-167175 INFO lr_warmup_steps = 0 13:55:05-170176 INFO Saving training config to C:/Users/billi/AI/ComfyUI_windows_portable/ComfyUI/models/loras\Best_v1_5e_5_max_grad_norm_0_20240823-135505.json... 13:55:05-172176 INFO Executing command: C:\Kohya_GUI_Flux_Installer_v3\kohya_ss\venv\Scripts\accelerate.EXE launch --dynamo_backend no --dynamo_mode default --mixed_precision bf16 --num_processes 1 --num_machines 1 --num_cpu_threads_per_process 2 C:/Kohya_GUI_Flux_Installer_v3/kohya_ss/sd-scripts/flux_train.py --config_file C:/Users/billi/AI/ComfyUI_windows_portable/ComfyUI/models/loras/config_dreambooth-20240823-135505.toml 2024-08-23 13:55:15 INFO Loading settings from train_util.py:4189 C:/Users/billi/AI/ComfyUI_windows_portable/ComfyUI/models/loras/config_dreambooth-20240823-135505.toml... INFO C:/Users/billi/AI/ComfyUI_windows_portable/ComfyUI/models/loras/config_dreambooth-20240823-135505 train_util.py:42082024-08-23 13:55:15 INFO Using DreamBooth method. flux_train.py:101 WARNING ignore directory without repeats / 繰り返し回数のないディレクトリを無視します: ok_messi config_util.py:589 INFO prepare images. train_util.py:1803 INFO 0 train images with repeating. train_util.py:1844 INFO 0 reg images. train_util.py:1847 WARNING no regularization images / 正則化画像が見つかりませんでした train_util.py:1852 INFO [Dataset 0] config_util.py:570 batch_size: 1 resolution: (1024, 1024) enable_bucket: False network_multiplier: 1.0 INFO [Dataset 0] config_util.py:576 INFO loading image sizes. train_util.py:8760it [00:00, ?it/s] INFO prepare dataset train_util.py:884 ERROR No data found. Please verify the metadata file and train_data_dir option. / flux_train.py:155 画像がありません。メタデータおよびtrain_data_dirオプションを確認してください。 13:55:17-451793 INFO Training has ended.

Franco Antonelli

thanks

Furkan Gözükara

Great)

George Gostyshev

haha i see :D i will make a step by step tutorial video

Furkan Gözükara

Ahh)) I mean you to do little less complex overview) Not me)

George Gostyshev

well if you dont publish configs publicly and link here sure

Furkan Gözükara

Nice research! Can I ask to make some shorter\compact version of it?

George Gostyshev

you are welcome thanks for support. if you write from discord it is faster

Furkan Gözükara

Thank you, for spending time here with dumb questions! Apreciate that!

Vasiliy Bulanov

nope speed is normal. but you have more than 1 repeat. make repeating 1 and it will be done in 200 * 40 * 4.8 / 60 / 60 = 11 hours at most. to further speed up you can do 150 epoch and a lower resolution like 512 but it reduces quality

Furkan Gözükara

Hm. Works well with 2.1 pytorch template. but...... speed is terribly low, like 434 hrs for 40 img on 200epochs: steps: 0%| | 23/320000 [01:52<434:28:02, 4.89s/it, avr_loss=0.354]

Vasiliy Bulanov

ye i will make video. a40 should work actually i tested on rtx 3090 and 4090 both works perfect on runpod. but i used pytorch template : RunPod Pytorch 2.1 runpod/pytorch:2.1.0-py3.10-cuda11.8.0-devel-ubuntu22.04 you should use same template as me

Furkan Gözükara

probably you installed inaccurately. enter inside kohya ss and try to run gui.bat file and see if works. do you have python 3.10? i will make a video hopefully very soon. almost completed trainings

Furkan Gözükara

Hope your video on this topic coming soon! :) It's little bit to hard for me tackle all this minor issues :)

Vasiliy Bulanov

Yep, using LorA tab. Now having this issue with both configs "6e_05_best_raw_sigmoid.json" and latest "48_GB_GPUs.json": accelerator.unwrap_model(flux).move_to_device_except_swap_blocks(accelerator.device) # reduce peak memory usage File "/workspace/kohya_ss/sd-scripts/library/flux_models.py", line 973, in move_to_device_except_swap_blocks self.to(device) ... NotImplementedError: Cannot copy out of meta tensor; no data! Please use torch.nn.Module.to_empty() instead of torch.nn.Module.to() when moving module from meta to a different device. Using clear install with RunPod Pytorch 2.2.0 template. with A40 GPU

Vasiliy Bulanov

Windows_Start_Kohya_SS.bat can't open the gui..after installing all dependencies..

CodePlug

it totally depends on gpu. currently on massed compute 3000 steps takes like 4 hours - 1.2$

Furkan Gözükara

which base model you given. if you message me from discord and show screenshots i can tell error

Furkan Gözükara

please reload fresh config as LoRA not dreambooth - extract again from zip file

Furkan Gözükara

please reload fresh config as LoRA not dreambooth - extract again from zip file

Furkan Gözükara

Tried to use other config "10_12_16GB_GPUs" got an error with the text encoder instead: File "W:\Kohya_GUI_Flux_Installer_v3\kohya_ss\sd-scripts\flux_train_network.py", line 411, in trainer.train(args) File "W:\Kohya_GUI_Flux_Installer_v3\kohya_ss\sd-scripts\train_network.py", line 330, in train self.assert_extra_args(args, train_dataset_group) File "W:\Kohya_GUI_Flux_Installer_v3\kohya_ss\sd-scripts\flux_train_network.py", line 43, in assert_extra_args assert ( AssertionError: network for Text Encoder cannot be trained with caching Text Encoder outputs / Text Encoderの出力をキャッシュしながらText Encoderのネットワークを学習することはできません Traceback (most recent call last): File "C:\Users\SysOp\AppData\Local\Programs\Python\Python310\lib\runpy.py", line 196, in _run_module_as_main return _run_code(code, main_globals, None, File "C:\Users\SysOp\AppData\Local\Programs\Python\Python310\lib\runpy.py", line 86, in _run_code exec(code, run_globals) File "W:\Kohya_GUI_Flux_Installer_v3\kohya_ss\venv\Scripts\accelerate.EXE\__main__.py", line 7, in File "W:\Kohya_GUI_Flux_Installer_v3\kohya_ss\venv\lib\site-packages\accelerate\commands\accelerate_cli.py", line 48, in main args.func(args) File "W:\Kohya_GUI_Flux_Installer_v3\kohya_ss\venv\lib\site-packages\accelerate\commands\launch.py", line 1106, in launch_command simple_launcher(args) File "W:\Kohya_GUI_Flux_Installer_v3\kohya_ss\venv\lib\site-packages\accelerate\commands\launch.py", line 704, in simple_launcher raise subprocess.CalledProcessError(returncode=process.returncode, cmd=cmd) subprocess.CalledProcessError: Command '['W:\\Kohya_GUI_Flux_Installer_v3\\kohya_ss\\venv\\Scripts\\python.exe', 'W:/Kohya_GUI_Flux_Installer_v3/kohya_ss/sd-scripts/flux_train_network.py', '--config_file', 'W:/NewLoraFactory/model/config_lora-20240823-043513.toml', '--network_args', 'train_blocks=single']' returned non-zero exit status 1.

Steve

How much time did it take to train?

Thomas

(got this error trying to train I used the lowest Vram option) NotImplementedError: Cannot copy out of meta tensor; no data! Please use torch.nn.Module.to_empty() instead of torch.nn.Module.to() when moving module from meta to a different device.

Steve

use 24_GB_GPUs.json in newest zip file that is best

Furkan Gözükara

i never tried them :D give a try but i dont trust samples ever

Furkan Gözükara

you are welcome

Furkan Gözükara

true. i am still researching impact for big dataset and using reg images

Furkan Gözükara

ok now 27 images do this. 1 repeat and 200 epoch and save every 20 or 15 epoch and compare them because we do not use reg images. for reg images usage i am in special research

Furkan Gözükara

great

Furkan Gözükara

you dont need to reduce rank anymore. just use Fix_For_FLUX_Step_2.bat and it works as low as 17 gb with 128 rank. use latest 24gb config. but i didnt see very much difference

Furkan Gözükara

Sure, easy answer change repeats to 1 (1_ohwx woman for instance) that basically means the training is running through in your case the 27 images once then doing epoch 2 and so fourth and when it gets to epoch 10 it will save out a Lora file and continue on till 20 then 30 etc etc. as a rule of thumb I would recommend keeping you dataset lower than 20 (for now) this means less time per epoch but also forces you to only train the very best of your training set.

s h a r k e y

Would you mind helping me out? I always used to do 20 repeats, but when I do that now with 27 images and the suggested 200 epochs I get to (540 / 1 / 1 * 200 * 1) = 108000 steps. Way more than I'm used to. Is this correct?

Jeroen Van Harten

Found it, thanks!

Jeroen Van Harten

Thanks. Sample prompts with flux still doesn't works in kohya, right?

Giuseppe Liguori

For 24GB GPUs, what difference do you see in generation quality and likeness between rank 16 and rank 32?

Manpreet Singh

yes this image all you need with configs :) https://www.patreon.com/file?h=110293257&i=20234120 set as training folder as 1_ohwx man - so we do repeat 1

Furkan Gözükara

A written step-by-step guide somewhere would be awesome, even without a video. Is this image of yours all I would need? https://www.patreon.com/file?h=110293257&i=20234120

Manpreet Singh

Is 1e_04_fp8_bf16_accelerate_full_bf16_32_rank.json still the best for 24GB GPUs? Was 16_rank noticeably worse?

Manpreet Singh

yes you need to edit gui.bat file. remove update requirement part . the post has a screenshot of it look from top to bottom

Furkan Gözükara

After I run the Fix (torch 2.4.0 + cu124 update) I get Package wrong version and it reinstalls torch 2.1.2 and cu118 when i run the gui.bat. Any ideas how to bypass that?

Jeroen Van Harten

1 repeat and 200 epoch. save like every 20 epoch and compare. i have used 15 images adding training dataset screenshot to the post now so refresh

Furkan Gözükara

Hi, How many images did you use to train your face in these test? How many repetitions and epochs?

Giuseppe Liguori

use lora tab to load config - reload from 0 with my config

Furkan Gözükara

set text encoder learning rate 0.

Furkan Gözükara

Constantly having this issue: "AssertionError: network for Text Encoder cannot be trained with caching Text Encoder outputs". If disabled caching: "AttributeError: 'T5EncoderModel' object has no attribute 'text_model'" can't beat this thing. any tips, guys?

Vasiliy Bulanov

You are welcome

Furkan Gözükara

Did you Check out / switch to sd3 flux branch?

Furkan Gözükara

It's amazing, thank you very much))

Vlad

excellent appreciate it :D

s h a r k e y

I downloaded the 24 GB json, loaded Kohya and loaded the json. I changed all directories and put the fluxdev tensor in documents and pointed at it. Also put images in photos folder. I hit train button and get error: \Desktop\Kohya\kohya_ss\venv\lib\site-packages\gradio\queueing.py", line 532, in process_events response = await route_utils.call_process_api( \Desktop\Kohya\kohya_ss\venv\lib\site-packages\gradio\route_utils.py", line 276, in call_process_api output = await app.get_blocks().process_api( \Desktop\Kohya\kohya_ss\venv\lib\site-packages\gradio\blocks.py", line 1928, in process_api result = await self.call_function( \Kohya\kohya_ss\venv\lib\site-packages\gradio\blocks.py", line 1514, in call_function prediction = await anyio.to_thread.run_sync( \Desktop\Kohya\kohya_ss\venv\lib\site-packages\anyio\_backends\_asyncio.py", line 2177, in run_sync_in_worker_thread return await future \Desktop\Kohya\kohya_ss\venv\lib\site-packages\anyio\_backends\_asyncio.py", line 859, in run result = context.run(func, *args) \Desktop\Kohya\kohya_ss\venv\lib\site-packages\gradio\utils.py", line 832, in wrapper response = f(*args, **kwargs) \Desktop\Kohya\kohya_ss\kohya_gui\lora_gui.py", line 1171, in train_model "network_module": network_module, \Desktop\Kohya\kohya_ss\kohya_gui\lora_gui.py", line 1171, in train_model "network_module": network_module, UnboundLocalError: local variable 'network_module' referenced before assignment

GomezBro

yes just added 10gb config :)

Furkan Gözükara

i tested and it reduces likeliness a lot atm will test more

Furkan Gözükara

yes just added 10gb config :)

Furkan Gözükara

yes just added 10gb config :)

Furkan Gözükara

12 GB config eklendi

Furkan Gözükara

you are welcome sorry for delay

Furkan Gözükara

yep both coming hopefully. fine tuning next after this

Furkan Gözükara

Okay, awesome. Thank you so much!

Diggy Dre

Thank you for research and testing for us! I hope the video will be soon for Lora and full model fine tuning. For cloud services and PCs.

Arcon Septim

after LoRA Hopefully

Furkan Gözükara

for 4080 if kohya fixes the bug yes. currently sadly using 18 gb minimum which is supposed to be 12 gb. i am talking with him

Furkan Gözükara

Have you tried Dreambooth's comprehensive fine-tuning?

楠 陈

When I use reg images it is 200_ohwx man but I do 1 epoch and save based on steps like every 451 steps

Furkan Gözükara

When I don't use reg images it is 1_ohwx man

Furkan Gözükara

Henüz 12 gb çalışmıyor kohya ile konuşuyorum çalışması lazım diyor ama 18 gb kullanıyor aşırı yavaş

Furkan Gözükara

hocam bunu 12 gb lık ekran kartı ile yaptığınız test varmı

Cemil Hacimahmutoglu

how many repeats are you running for these tests, and how are you naming your dataset? I've had decent results naming ( 20_woman - 16 or so images - 1 epoch - then retraining the output lora about 4/5 times )

s h a r k e y

From what I've tested it wouldn't right now. I haven't seen my training take less than 18gb vram. That will change without weeks if not days though. So probably yes shortly.

s h a r k e y

Can this be done with a 4080?

Diggy Dre

same category harder

Furkan Gözükara

yep i will do after research is done

Furkan Gözükara

can you do a video tutorial, step by step, i like video more cuz it's easier

hazwam

Which route is more difficult? I think first attempt is same category. Like Same Brand, Shoe A, Shoe B, Shoe C.

Sugar Coat VFX Design

nice idea. are they same category or different like shoes bag and eye glasses or all shoes?

Furkan Gözükara

yes i will test its impact too once i have good base config

Furkan Gözükara

Is regularized training set currently supported?

楠 陈

for 24 gb gpu : 1e_04_fp8_bf16_accelerate_full_bf16_32_rank

Furkan Gözükara

this one but i am yet to test last 8 trainings working on them : 1e_04_bf16_128_rank_full_bf16

Furkan Gözükara

Which is the json of the best training parameters at present?

楠 陈

araştırma bitince İnşallah video yapacağım

Furkan Gözükara

Hocam video şart :D

Cemil Hacimahmutoglu

For example, a Lora for a brand which has 3 products. Use one Lora to trigger their product A,B,C.

Sugar Coat VFX Design

hopefully once i finalize settings

Furkan Gözükara

Nice. When is a video coming?

Manpreet Singh

that can be another time. but can you give me example of which concepts ? so i may make another tutorial for that

Furkan Gözükara

Thanks ~! Can you teach us how to train multiple concept at the same time in the coming tutorial?

Sugar Coat VFX Design

i couldn't find yet but researching it extensively

Furkan Gözükara

Hey! Is it possible to train on 12GB VRAM ?

Vlad

you need to git clone then do git checkout sd3-flux.1 and then install. i am preparing tutorial will show there

Furkan Gözükara

im not clear on how to install the flux into kohya? do install kohya first then how do i add flux into it as an option?

Josh Baker

You are welcome thank you for support

Furkan Gözükara

You're the best. Thanks

Yannis

just published : https://www.patreon.com/posts/forge-web-ui-and-110323512

Furkan Gözükara

sure working on it right now will publish asap

Furkan Gözükara

Hey :) Can you help us installing the latest version of ForgeUi for Flux on Runpod ? :) There are no updated templates for now...

Yannis


Related Creators