Home Creators Posts Import Register Favorites Logout

Downloads

Content

Here you will find 6 optimized training presets for LORA inside Kohya SS. Whether you're training locally or using Runpod.What's inside?

3 Local Training Presets: Designed for those who love to train on their own systems.

Normal Training: For your everyday needs.

Style Training: Unleash your creativity and give your models a unique flair.

LowVRAM: Optimized for local systems with limited VRAM.

3 Runpod Presets: Perfect for those using Runpod's GPU renting platform. These presets automatically locate the location of the stable diffusion XL model for you.

Normal Training: The classic training preset.

Style Training: Let your models stand out with a distinctive style.

Small LORA Files: Ideal for those working with smaller LORA file sizes.

Why These Presets?

For LORA training, every little optimization can make a huge difference. These presets are the culmination of countless hours of experimentation and refinement. By using them, you're ensuring that your LORA training is both efficient and effective, regardless of where or what you're training.

And as always, supporting me on Patreon allows me to keep creating helpful resources like this for the AI art community. Thank you for your support - now go train some awesome LORAs!

Files

Comments

Flonix

This is exactly what i was searching for for the last week. 🔥, You are the best

ZanderZrantZ

What did u use in the video to see what celebrity stable diffusion knows?

ZanderZrantZ

Sorry i mean the part where you said When u try to look for margot robbie in sd itself... and u can't find milly alcock in it.. it looks like the ul is dream? dream studio?

Aitrepreneur

ah it's dreamstudio, it's just stable diffusion online, it's paid but it's the same as using it locally, I used in the video because I had all the pods busy

Flonix

just prompt for the person in a1111

Steve

edit: nevermind first part that was my error....isn't SDXL trained at noise offset of 0.0357? also what is your take on WD14 vs Blip?

EmmanuelMr18

If you are running it on a pod, you can execute the log files with tail. With this you always see the latests logs, just like a terminal tail -f -n 50 kohya_ss.log

Nenad Kuzmanovic

How many repeats of images per epoch? that is kinda really important, i guess all parameters are based on that...? Style for example..

JoeyDotDigitize

How about a drawing style, will the process work the same?

State of Mind

Here's a translation with native English fluency: Firstly, thank you – I sometimes forget my manners. 13 months ago, I left my job to focus on studying generative AI. I can proudly say that thanks to your channel and hours of training, many entrepreneurs, artists, and educators are now using Stable Diffusion. So, in short, thank you. Now, onto my question. I've never used this platform before, so please excuse me if this isn’t the right place: "When I change the number of training images (in the examples it's done with 10), should I also change the number of steps, epochs, etc?" "I really loved the idea of creating a token that recognizes the model to facilitate training. If the model doesn't recognize the individual, do you think it's a good idea to first create a general Dreambooth for it to get acquainted, and then a specific Lora to refine it? (kind of like what you did with Margot, in the sense that the model already knows her)" Thank you again. If this isn’t the right place, I'll move the thread. And if you prefer discussing this on Discord, please let me know. A big shoutout to the community!

Aitrepreneur

hey, so first no, you don't need to change anything you can use the same training parameters no matter how many images you have unless you are training a style and you are using a looooot of images like 50+, in that case it's better to increase the batch size otherwise the training will take forever. There is also no reason to train a new character in dreambooth then train a lora on it, it's not only a waste of time but will also most definitely not work correctly, the characters already present in sdxl where not done using dreambooth but fine-tuned using special tools, it's really not the same process. Also it almost doesn't even matter if the celebrity you chose doesn't look like your character, the training will fix that very quickly, as long as there are some similarities between the characters like hair color and age and sexe, the training will be done very quickly and the final model will be very accurate.

State of Mind

I could live my whole life with this answer. Many thanks from Madrid!

Robb

I have 4070 with 12G VRAM. I know it's not as powerful as the 3090 but it's taking me MUCH longer than yours is showing. I have 12 images, using the LOW VRAM config with 20 steps and batch size of 1. When it starts up the total number of steps is 4800 and it takes something like 16 hours of training! I can train SD 1.5 models and it takes less than 30 minutes. Why is it taking soooooo much longer to train? Like I said I know the 3090 is more powerful but I don't think it would make the time to train go from ~2 hours to ~16 hours. There must be something I'm setting wrong.

Aitrepreneur

each gpu is different, even between the same GPUs you can have differences, but it's true that 16h is a bit too long for 4800 steps... without more info it's difficult to know for sure what's happening

Robb

I found the problem. It was my cuda drivers. I uninstalled cuda toolkit and re-installed with the latest. Then I re-installed a new version of koyha ss, I had installed it before. Now it's doing the same 4800 steps in 3 hours which is much more reasonable!

Kayzee

Hi there, so after watching a lot of videos of you, I finally decided to join here on Patreon. Onto my question. I downloaded all the files (and thank you for all the reg images, btw), used your SDXL template file and changed a few bits here and there. One thing I noticed: I changed the "Network Rank (Dimension)" to 64 - and after a bit of training the result was more or less the same as with 256, but the safetensor files were MUCH smaller. (As expected.) After trying my own images (photos with txts) I noticed: I will always get a photorealistic result - even when trying to prompt for an anime style version of me etc. It always sticks to "photos". Removing the prompt for my lora immediately changed the image to what I wanted initially (without me, of course). So it seems my lora is not flexible, but how can that be? Do you have any advice maybe? Apart from that I also tried using larger "Network Rank (Dimension)" again. But that was not the culprit.... Thank you. :)

Gio Sebastian

I got a n00b question for the AiGOAT/Overlord....I watched your previous video on Lora training and your latest one (SO LEGIT!) I noticed a lot more information and steps are taken with the XL lora training video than your first one...my question is: could I use this new SDXL.json file (change the model to a 1.5 based checkpoint) and train a lora that would then work with 1.5 based checkpoints? Or would I need to change the training resolution to 768? Or are there other settings and steps that would need to be adjusted to make a lora for 1.5? Following all the steps in your latest video but making it for a 1.5 model (if that makes sense) thank you!

Aitrepreneur

Network rank's results can vary a lot depending on the subject you are trying to train, as you saw in the video with Billie Eilish so sometimes having a smaller network rank really isn't gonna change results that much. For the photorealistic part that means that it's a bit too overtrained,so either choose a model that is less trained or decrease the learning rate to something like 0.0001 instead of 0.0003

Aitrepreneur

I think you could try, altough don't forget that for 1.5 you need 512x512 resolution images instead (regularization images too) I can't of course promise it will work as well since 1.5 are not as easy to train /flexible/precise as SDXL

Johannes Granlund

Hi, First of all, thanks alot for your great guide! I also wonder this, especially because the sdxl-model does not seem to support inpainting very well (yet). Besides changing the resolution on the dataset, do you have any other advice on what to change? For example, training rate, optimizer setting, etc?

watzon

As a follow up from your video on SDXL training, would it be possible to train a character using a more well known person as a base, but then change the trigger word so it actually matches the character you're training? Training Millie Alcock but then having to use Sasha Luss as a trigger word is somewhat non-ideal, especially if you plan on distributing your trained LoRA.

Kayzee

Thanks. I will try that next! EDIT: I reduced the learning rate by a big margin and the results are a lot better already. Thanks again!

Gio Sebastian

Thank you for getting back to me. I'm going to give it a shot. If I recall correctly in your first lora video you did train a 1.5 model with 768x768 resolution (and no regularization images) so I was hoping I could just follow all your new steps to make a better lora for 1.5. If you ever happen to train 1.5 model again, it would be awesome to get your updated .json settings.

Merrick Cox

On Runpod I got all the way to the end where I press Start Training, but nothing happens. GPU usage appears flat. When I run Kohya locally, the terminal window stays open and I can watch the progress (or it gives an error), but on Runpod I can't tell what went wrong, it just doesn't do anything. I'm certain I'm missing something super dumb and obvious. :(

Adam Winn

Note: the SDXL Runpod JSON, I think, has an outdated reference to the SDXL base safetensors path if you are using the Rundpod template. You should maybe change the pretrained_model_name_or_path to wherever your sdxl base model is. At the time of writing, I changed my JSON's pretrained_model_name_or_path to "/workspace/stable-diffusion-webui/models/Stable-diffusion/sd_xl_base_1.0.safetensors"

Aitrepreneur

no it's the already updated model, the sd_xl_base_1.0.safetensors is the older model, you should use the vae model instead

Matt McEwen

New to this: I have been following these great tutorials and I am training 20 images (like recommended) on my RTX 4070 and it is estimating 104 hr with the recommendations made in the video. What have I done that has made this process so slow? Thank you for your help.

Aitrepreneur

that's a bit slow indeed, what is the number of total steps it gave you? and the number of it/s?

Gustavo Marques

Kohya buttons not working on mac. I thought it was because needed the configuration file, then I subscribed for you patreon to download the files but the open button doesn't work at all... I tried some solutions from Reddit but the venv folder doesn't contain the Scripts folder. How do I fix it?

Tyrell Hoxter

Thank you for the SDXL presets. would you happen to have any presets for the older models like the 1.5?

Aitrepreneur

you can try using it the same way, just change the resolution to 512x512 and lr to 0.0001

Jhonry Tuillier

Is there a technical impossibility for character LoRAs to work with the SDXL refiner? The character seems alright during the base model pass, and then is replaced at the refiner pass by the person I used as instance prompt keyword for the training. I tried with Auto1111 v1.6 and ComfyUI. Style LoRAs work fine with the refiner.

Jhonry Tuillier

A workaround I found is to use ADetailer, so the whole picture uses the refiner, and the face is then rerendered without it.

POLYHEDRON_AI

Hi there. I was using your SDXL preset for Runpod successfully, but today I got an error message: "Illegal instruction (core dumped)". Any idea how to fix that? :) And: I got really big training files, over 1.7 GB per epoch. Is this necessary? Or can I reduze the network size without loosing quality or prune it later on in Koyha_SS? Thank you so much. Frank

Aitrepreneur

sd 1.5 training is not as good as sdxl, that's why I use it now, can't expect the same level of quality from 1.5 than for sdxl, that's the whole point of using it compared to the 1.5

Aitrepreneur

you can't train the refiner for now, so of couse since it doesn't work the same way as the sdxl base model and doesn't know your character, it's gonna mess up the final generation, so yeah instead use some upscaler or high-res fix

Aitrepreneur

not sure about that error but if you want to have a smaller film size you need to reduce the network size or indeed optimize it in kohya, however of crouse no matter what you do, it will change the final quality of the lora

POLYHEDRON_AI

Okay ... thanks. :) If you get the same error, please give me a note; perhaps something changed in the overall template ... *shrug* ^^

Aitrepreneur

yes the template actually changed yesterday, for me it doesn't work as well as it did, my advice is to change the version of the template, for this after you've selected the gpu, click on customize deployment and change the container name from ashleykza/stable-diffusion-webui:1.9.2 to ashleykza/stable-diffusion-webui:1.7.1 it should work better, at least it did for me

POLYHEDRON_AI

Ah! :D I'll try ... Your're the best! :-* Thanks, my overlord.

Troyificus

Hi! Having a problem using the LOWVRAM script. If I run the standard SDXL script it will work fine, but starts with 8000 steps and will take over 120 hours to run (I'm using a 1080ti 11Gb card). So I tried the LOWVRAM script, but it keeps failing. There's a whole bunch of errors that come up, one of which is "AssertionError: full_bf16 requires mixed precision='bf16'", however I already made sure that I'd selected fp16 for both the Mixed and Save Precision dropdowns. Any idea if there's something else I need to change in the settings that might be causing this?

Aitrepreneur

first 11gb of vram is not gonna be enough to use the normal sdxl preset so I'm not even sure how and why it can start, even the lowvram preset might be too much for your gpu you need at least 12gb of vram for that, for the error, make sure that you have installed kohya with fp16 and not bf16 otherwise you might have to change the accelerate configuration file saved at: C:\Users\USERNAME/.cache\huggingface\accelerate\default_config.yaml

Troyificus

Thanks for the reply. I changed it to fp16 when running the normal SDXL preset, so I think everything is installed correctly. The default_config.yaml has 'downcast_bf16' set to NO and 'mixed_precision' set to fp16, would that be right? **EDIT** OK I fixed it. Went into the SDXL-LOWVRAM.json file and changed all instances of bf16 to fp16. Now going to take 6 hours for 10 epochs, which is much better. Thank you for the scripts, they're extremely useful!

POLYHEDRON_AI

So, up and running, yeah! :D But I had to upload the model (sdxl 1.0 base) manually, cause 1111 is not running properly anymore. *sigh* One last question: Do you keep your runpods? There is a -well - "rental fee" for that. Is this okay?

Aitrepreneur

I don't keep my pods running no, once the training is finished and I downloaded the models I delete the pod and start another one when I need it, it takes less than 2 mins to set up

Matthew Hart

Is there a easy to follow guide for running Kohya on runpod?

Aitrepreneur

Yes I show how to do that in my latest lora training video

Aitrepreneur

yeah so it's a little complicated but long story short the runpod template was recently updated (like 2-3 days ago) to feature the auto1111 webui version 1.6 which apparently uses more vram being idle and because of that this uses too much vram on the gpu for a lora training, I contacted the creator of the template and he kindly created a new Application Manager to stop apps that you don't use, I will show how to use that in my next video but for now, if you want to train a lora on runpod you need to click on connect then click on port 8000 which will open the application manager, from there you will have the option to start or stop the A1111 (sd webui), kohya, and comfyui, if you want to train a lora with kohya, just click on stop for both a1111 and comfyui, then you can start the training. If you again want to use the SD webui after training, you can come back in that app manager and click on the start button for a1111, then wait a few seconds for it to start ;)

Aitrepreneur

No worries I wasted a lot of hours too trying to figure it out ;)

baran mengül

You are the best.🙌 You work very hard, my gratitude. I couldn't wait for you, I couldn't wait for you. And thanks to you, I did 5 style studies. Now I get an error with 2200 normalized images and 110 working images. Cuda out of memory error. With 24GB VRAM (3090) in RunPod, which RunPod preset should I use for these tutorials (2200Picture/110 Picture)🤪? How do I resolve this error? thanks.

Michael Mc Avoy

how do you download the scripts there is no download link?

A J

double click on it

Aitrepreneur

the files are attached to the post, right below the thank you message

derek honour

hi Aitrapeneur, i keep getting the following error in runpod when training , this time it hapnd after 3 epochs "CalledProcessError: Command '['/workspace/kohya_ss/venv/bin/python3', './sdxl_train_network.py', '--enable_bucket', '--min_bucket_reso=256', '--max_bucket_reso=2048', '--pretrained_model_name_or_path=/workspace/stable-diffusion-webui/models/Stable -diffusion/sd_xl_base_1.0.safetensors', '--train_data_dir=/workspace/Dex01-Nicholas Braun/img', '--reg_data_dir=/workspace/Dex01-Nicholas Braun/reg', '--resolution=1024,1024', '--output_dir=/workspace/Dex01-Nicholas Braun/model', '--logging_dir=/workspace/Dex01-Nicholas Braun/log', '--network_alpha=1', '--save_model_as=safetensors', '--network_module=networks.lora', '--text_encoder_lr=0.0003', '--unet_lr=0.0003', '--network_dim=256', '--output_name=Dex01-Nicholas Braun', '--lr_scheduler_num_cycles=10', '--no_half_vae', '--learning_rate=0.0003', '--lr_scheduler=constant', '--train_batch_size=1', '--max_train_steps=12000', '--save_every_n_epochs=1', '--mixed_precision=bf16', '--save_precision=bf16', '--caption_extension=.txt', '--cache_latents', '--cache_latents_to_disk', '--optimizer_type=Adafactor', '--optimizer_args', 'scale_parameter=False', 'relative_step=False', 'warmup_init=False', '--max_data_loader_n_workers=0', '--bucket_reso_steps=64', '--gradient_checkpointing', '--xformers', '--bucket_no_upscale', '--noise_offset=0.0']' returned non-zero exit status 1.

derek honour

it seems to stop there for some reason

derek honour

i closed everithing and started from scratch , same error after one epoc, what could this be?

derek honour

for training i should choose the vae one?

Erwin Contreras

Hello, first of all I want to thank you for the tutorials and tools you are sharing. Second, I want to ask if anything has changed with your runpod template for kohya_ss.... When I started to use it, when I assigned it to a pod, it loaded almost immediately. Now, using the same pod, it downloads a lot of stuff and takes forever to start.

Semon Xue

Thanks @Aitrepreneur , your work very helpful for me. I tried the sdxl runpod training present. At the beginning it always show mem not enough error. It works when I stop the A111 from the 8000 port UI. PS: In jupyter , you can use terminal function and run command "tail -f /workspace/logs/kohya_ss.log" to view logs realtime.

Aitrepreneur

yes the template has changed, check out my last style training video I explain everything about it

Aitrepreneur

yes I am aware of that, I showed why in my last style training video, the template was updated

Debamalya Das

I having issues using the runpod script. │ /workspace/kohya_ss/venv/lib/python3.10/site-packages/accelerate/commands/la │ │ unch.py:580 in simple_launcher │ │ │ │ 577 │ process.wait() │ │ 578 │ if process.returncode != 0: │ │ 579 │ │ if not args.quiet: │ │ ❱ 580 │ │ │ raise subprocess.CalledProcessError(returncode=process.ret │ │ 581 │ │ else: │ │ 582 │ │ │ sys.exit(1) │ │ 583 │ ╰──────────────────────────────────────────────────────────────────────────────╯ CalledProcessError: Command '['/workspace/kohya_ss/venv/bin/python3', './sdxl_train_network.py', '--enable_bucket', '--min_bucket_reso=256', '--max_bucket_reso=2048', '--pretrained_model_name_or_path=/workspace/stable-diffusion-webui/models/Stable -diffusion/sd_xl_base_1.0_0.9vae.safetensors', '--train_data_dir=/workspace/vin-mena/img', '--reg_data_dir=/workspace/vin-mena/reg', '--resolution=1024,1024', '--output_dir=/workspace/vin-mena/model', '--logging_dir=/workspace/vin-mena/log', '--network_alpha=1', '--save_model_as=safetensors', '--network_module=networks.lora', '--text_encoder_lr=0.0003', '--unet_lr=0.0003', '--network_dim=256', '--output_name=vin-mena', '--lr_scheduler_num_cycles=10', '--no_half_vae', '--learning_rate=0.0003', '--lr_scheduler=constant', '--train_batch_size=1', '--max_train_steps=12500', '--save_every_n_epochs=1', '--mixed_precision=fp16', '--save_precision=fp16', '--caption_extension=.txt', '--cache_latents', '--cache_latents_to_disk', '--optimizer_type=Adafactor', '--optimizer_args', 'scale_parameter=False', 'relative_step=False', 'warmup_init=False', '--max_data_loader_n_workers=0', '--bucket_reso_steps=64', '--gradient_checkpointing', '--xformers', '--bucket_no_upscale', '--noise_offset=0.0']' returned non-zero exit status 1.

Erosi

The problem is adetailer doesnt seem to be working with different styles (like painting\comics\drawing) or with other loras in combination

Erosi

I had no idea about the refiner, thank you for that info

Carlos Baena

Thanks for the command: "tail -f /workspace/logs/kohya_ss.log", very useful

Semon Xue

Hi @Aitrepreneur , if I want train a sd1.5 character lora , is it just change the pretrained_model_name_or_path to a sd1.5 model. And update the input image and reg image to 512 or 768. Is this works?

Aitrepreneur

yes pretty much, you might also want to change the learning rate to 0.0001

Semon Xue

Cool. Thank you.

Zen (edited)

Comment edits

2026-09-08 20:00 I got this error, OutOfMemoryError: CUDA out of memory. Tried to allocate 2.00 MiB (GPU 0; 23.65 GiB total capacity; 12.36 GiB already allocated; 1.69 MiB free; 12.50 GiB reserved in total by PyTorch) If reserved memory is >> allocated memory try setting max_split_size_mb to avoid fragmentation. See documentation for Memory Management and PYTORCH_CUDA_ALLOC_CONF steps: 0%| | 0/13600 [00:01 │ │ │ │ 5 from accelerate.commands.accelerate_cli import main │ │ 6 if __name__ == '__main__': │ │ 7 │ sys.argv[0] = re.sub(r'(-script\.pyw|\.exe)?$', '', sys.argv[0]) │ │ ❱ 8 │ sys.exit(main()) │ │ 9 │ │ │ │ /workspace/kohya_ss/venv/lib/python3.10/site-packages/accelerate/commands/ac │ │ celerate_cli.py:45 in main │ │ │ │ 42 │ │ exit(1) │ │ 43 │ │ │ 44 │ # Run │ │ ❱ 45 │ args.func(args) │ │ 46 │ │ 47 │ │ 48 if __name__ == "__main__": │ │ │ │ /workspace/kohya_ss/venv/lib/python3.10/site-packages/accelerate/commands/la │ │ unch.py:918 in launch_command │ │ │ │ 915 │ elif defaults is not None and defaults.compute_environment == Comp │ │ 916 │ │ sagemaker_launcher(defaults, args) │ │ 917 │ else: │ │ ❱ 918 │ │ simple_launcher(args) │ │ 919 │ │ 920 │ │ 921 def main(): │ │ │ │ /workspace/kohya_ss/venv/lib/python3.10/site-packages/accelerate/commands/la │ │ unch.py:580 in simple_launcher │ │ │ │ 577 │ process.wait() │ │ 578 │ if process.returncode != 0: │ │ 579 │ │ if not args.quiet: │ │ ❱ 580 │ │ │ raise subprocess.CalledProcessError(returncode=process.ret │ │ 581 │ │ else: │ │ 582 │ │ │ sys.exit(1) │ │ 583 │ ╰──────────────────────────────────────────────────────────────────────────────╯ CalledProcessError: Command '['/workspace/kohya_ss/venv/bin/python3', './sdxl_train_network.py', '--enable_bucket', '--min_bucket_reso=256', '--max_bucket_reso=2048', '--pretrained_model_name_or_path=/workspace/stable-diffusion-webui/models/Stable -diffusion/sd_xl_base_1.0_0.9vae.safetensors', '--train_data_dir=workspace/Teekawong_v5/img', '--reg_data_dir=workspace/Teekawong_v5/reg', '--resolution=1024,1024', '--output_dir=workspace/Teekawong_v5/model', '--logging_dir=workspace/Teekawong_v5/log', '--network_alpha=1', '--save_model_as=safetensors', '--network_module=networks.lora', '--text_encoder_lr=0.0003', '--unet_lr=0.0003', '--network_dim=256', '--output_name=Teekawong_v5', '--lr_scheduler_num_cycles=10', '--no_half_vae', '--learning_rate=0.0003', '--lr_scheduler=constant', '--train_batch_size=1', '--max_train_steps=13600', '--save_every_n_epochs=1', '--mixed_precision=bf16', '--save_precision=bf16', '--caption_extension=.txt', '--cache_latents', '--cache_latents_to_disk', '--optimizer_type=Adafactor', '--optimizer_args', 'scale_parameter=False', 'relative_step=False', 'warmup_init=False', '--max_data_loader_n_workers=0', '--bucket_reso_steps=64', '--gradient_checkpointing', '--xformers', '--bucket_no_upscale', '--noise_offset=0.0']' returned non-zero exit status 1.
2023-09-21 16:17

Aitrepreneur

checkout my LORA style training video, I explain why you have this error, this is a problem with the updated runpod template

Robert Hoffmann

Is there are solution with runpod und the updated runpod template? Even if I stop the other two services (Stable Diffusion and Comfy), the same error continues to occur. Thank You!

Aitrepreneur

the template works, I use it every day, just make sure that you had make sure that stopping the app worked, sometimes for some reason I have to do it twice, just check that the GPU usage is at 0% after stopping the A1111, this tells you that the app was stopped successfully

Robert Hoffmann

It's running now, let's see if it runs to the end. The error was: I had forgotten to download the SDXL model from Huggingface. The model was already in the model folder, but only had a size of a few kb. But the file name was the same. Another error: After downloading, the correct model file is supplemented with .1. This does not work either. Only after I deleted the dummy file and removed the extension ".1" from the correct model file - does it seem to work now.

Robert Hoffmann

Wow, thank you for the command! Great!!!

Justin Berken

I cant seem to get up and running with LoRA / SDXL. I just get a trace back error. I've tried multiple configs. [Dataset 0] loading image sizes. 100%|█████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 10/10 [00:00<00:00, 1694.94it/s] make buckets min_bucket_reso and max_bucket_reso are ignored if bucket_no_upscale is set, because bucket reso is defined by image size automatically / bucket_no_upscaleが指定された場合は、bucketの解像度は画像サイズから自動計算されるため、min_bucket_resoとmax_bucket_resoは無視されます number of images (including repeats) / 各bucketの画像枚数(繰り返し回数を含む) bucket 0: resolution (768, 768), count: 400 mean ar error (without repeats): 0.0 preparing accelerator loading model for process 0/1 load Diffusers pretrained models: runwayml/stable-diffusion-v1-5, variant=None unet\diffusion_pytorch_model.safetensors not found Loading pipeline components...: 100%|█████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 4/4 [00:03<00:00, 1.19it/s] Traceback (most recent call last): File "C:\kohya\kohya_ss\sdxl_train_network.py", line 183, in trainer.train(args) File "C:\kohya\kohya_ss\train_network.py", line 224, in train model_version, text_encoder, vae, unet = self.load_target_model(args, weight_dtype, accelerator) File "C:\kohya\kohya_ss\sdxl_train_network.py", line 44, in load_target_model ) = sdxl_train_util.load_target_model(args, accelerator, sdxl_model_util.MODEL_VERSION_SDXL_BASE_V1_0, weight_dtype) File "C:\kohya\kohya_ss\library\sdxl_train_util.py", line 34, in load_target_model ) = _load_target_model( File "C:\kohya\kohya_ss\library\sdxl_train_util.py", line 84, in _load_target_model pipe = StableDiffusionXLPipeline.from_pretrained( File "C:\kohya\kohya_ss\venv\lib\site-packages\diffusers\pipelines\pipeline_utils.py", line 1191, in from_pretrained raise ValueError( ValueError: Pipeline expected {'text_encoder_2', 'tokenizer', 'vae', 'scheduler', 'unet', 'text_encoder', 'tokenizer_2'}, but only {'tokenizer', 'vae', 'scheduler', 'unet', 'text_encoder'} were passed. Traceback (most recent call last): File "C:\Users\Berken\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\Berken\AppData\Local\Programs\Python\Python310\lib\runpy.py", line 86, in _run_code exec(code, run_globals) File "C:\kohya\kohya_ss\venv\Scripts\accelerate.exe\__main__.py", line 7, in File "C:\kohya\kohya_ss\venv\lib\site-packages\accelerate\commands\accelerate_cli.py", line 47, in main args.func(args) File "C:\kohya\kohya_ss\venv\lib\site-packages\accelerate\commands\launch.py", line 986, in launch_command simple_launcher(args) File "C:\kohya\kohya_ss\venv\lib\site-packages\accelerate\commands\launch.py", line 628, in simple_launcher raise subprocess.CalledProcessError(returncode=process.returncode, cmd=cmd) subprocess.CalledProcessError: Command '['C:\\kohya\\kohya_ss\\venv\\Scripts\\python.exe', './sdxl_train_network.py', '--enable_bucket', '--min_bucket_reso=256', '--max_bucket_reso=2048', '--pretrained_model_name_or_path=runwayml/stable-diffusion-v1-5', '--train_data_dir=C:/JUSTIN 512/img', '--resolution=768,768', '--output_dir=C:/JUSTIN 512/model', '--logging_dir=C:/JUSTIN 512/log', '--network_alpha=1', '--save_model_as=safetensors', '--network_module=networks.lora', '--text_encoder_lr=0.0012', '--unet_lr=0.0012', '--network_dim=128', '--gradient_accumulation_steps=4', '--output_name=justin', '--lr_scheduler_num_cycles=10', '--no_half_vae', '--full_bf16', '--learning_rate=0.0012', '--lr_scheduler=constant', '--train_batch_size=1', '--max_train_steps=1000', '--save_every_n_epochs=1', '--mixed_precision=bf16', '--save_precision=bf16', '--caption_extension=.txt', '--cache_latents', '--cache_latents_to_disk', '--optimizer_type=Adafactor', '--optimizer_args', 'scale_parameter=False', 'relative_step=False', 'warmup_init=False', '--max_data_loader_n_workers=0', '--bucket_reso_steps=64', '--gradient_checkpointing', '--xformers', '--bucket_no_upscale', '--noise_offset=0.0']' returned non-zero exit status 1.

Justin Berken

I uninstalled CUDA toolkit and ran DDU on display driver. It seems to be working now. Thanks!

gru koin

thank you for these and the tutorials! I'm repeatedly running into the same error: "returned non-zero exit status 1." I've posted the complete koyha log here https://pastebin.com/feTNRmQd thank you so much for any help on this!

Aitrepreneur

cuda out of memory, it's a problem with the newest version of the template, I explain why that is in my style training video, you need to click on port 8000 and click on the stop button for the a1111, which will stop auto1111 from running and taking on resources, check the video for more info

ABA (edited)

Comment edits

2026-09-08 20:00 Im using your SDXL standard presets to try and train a likeness. Im running on a 4090 and with your settings its running about 10k steps and looks to be about 5 hours training time. 4/batch 41images/100 steps 10/epochs (no regs)...does this sound right for likeness training in SDXL(using base model)? Thanks
2023-10-30 22:19

Aitrepreneur

sounds about right, depends on every GPU, you can also try reverting back to an older driver version (like the 531 drivers version) from Nvidia, might give you even more speed

javi de la chica

hello! first of all, thanks a lot for this collection of tutorials and tools. this is the worthiest patreon i've ever been. i've been training several loras with really good results. but having a beast of a computer it seems very slow. only uses a 20% of memory. i'd like to boost it but i dont know how. thanks in advance

zuzu

When I tried training a kohya lora, this is the error i got, first line: Traceback (most recent call last) ────────────────────────────────╮ │ C:\AI ART\kohya_ss\sdxl_train_network.py:176 in │ │ │ │ 173 │ args = train_util.read_config_from_file(args, parser) │ │ 174 │ │ │ 175 │ trainer = SdxlNetworkTrainer() │ │ ❱ 176 │ trainer.train(args) & Last line error: ╰──────────────────────────────────────────────────────────────────────────────────────────────────╯ CalledProcessError: Command '['C:\\AI ART\\kohya_ss\\venv\\Scripts\\python.exe', './sdxl_train_network.py', '--enable_bucket', '--min_bucket_reso=256', '--max_bucket_reso=2048', '--pretrained_model_name_or_path=C:/AI ART/a1111/stable-diffusion-webui/models/Stable-diffusion/sd_xl_base_1.0.safetensors', '--train_data_dir=C:/Users/User/Downloads/SDXL LORA SETUP/SDXL Lora Output\\img', '--reg_data_dir=C:/Users/User/Downloads/SDXL LORA SETUP/SDXL Lora Output\\reg', '--resolution=1024,1024', '--output_dir=C:/Users/User/Downloads/SDXL LORA SETUP/SDXL Lora Output\\model', '--logging_dir=C:/Users/User/Downloads/SDXL LORA SETUP/SDXL Lora Output\\log', '--network_alpha=1', '--save_model_as=safetensors', '--network_module=networks.lora', '--text_encoder_lr=0.0003', '--unet_lr=0.0003', '--network_dim=256', '--output_name=VINTAGE_SHIRT', '--lr_scheduler_num_cycles=5', '--no_half_vae', '--learning_rate=0.0003', '--lr_scheduler=constant', '--train_batch_size=3', '--max_train_steps=4100', '--save_every_n_epochs=1', '--mixed_precision=bf16', '--save_precision=bf16', '--caption_extension=.txt', '--cache_latents', '--cache_latents_to_disk', '--optimizer_type=Adafactor', '--optimizer_args', 'scale_parameter=False', 'relative_step=False', 'warmup_init=False', '--max_data_loader_n_workers=0', '--bucket_reso_steps=64', '--gradient_checkpointing', '--xformers', '--bucket_no_upscale', '--noise_offset=0.0']' returned non-zero exit status 1. pls help. I've trained loras before on google collab and they function pretty well. I'm new to kohya

pietje puk

Thanks a lot for creating these. I am training for a character and have 100 - 200 images. Is there anything I should/can adjust for larger amount of images?

Aitrepreneur

not really but you don't need this many images for character training because it will take a while to train but otherwise no you're good to go

Jean Lou

Hello, It seems amazing but I just had an issue on RunPod so I downloaded the log file because, I saw that it updated every single seconds at the beginning and then...nothing. Can I send you my file?

Jean Lou

Thank You! Really appreciated! I think this is the important message: OutOfMemoryError: CUDA out of memory. Tried to allocate 242.00 MiB (GPU 0; 23.68 GiB total capacity; 15.41 GiB already allocated; 195.38 MiB free; 15.57 GiB reserved in total by PyTorch) If reserved memory is >> allocated memory try setting max_split_size_mb to avoid fragmentation. See documentation for Memory Management and PYTORCH_CUDA_ALLOC_CONF

NilsWranglesAI

Hi Aitrepreneur, thanks for all your work. I just ran into the same issue as Jean Lou, CUDA out of memory issue on Runpod, RTX3090, 32vCPU 125GB RAM, 50GB Disk 75Gb Pod Volume

NilsWranglesAI

Ah just watched the newer video. Will see if disabling ComfyUI and SD helps.

Aitrepreneur

yeah so for this I explained the problem in my style lora training video, here check it out (I put the correct timeframe already): youtu.be/1BCYdd9r1To?t=2081 just stop the a1111 from running before doing the training since it hogs important ressources

Aris Leou

Can we use it with amd gpu and windows?

Aitrepreneur

Unfortunately no, it's either Nvidia on windows or if you want to use AMD, you need to use it on Linux but it's still kinda experimental

Johannes O'Kelly

Hi, I get the following error when I run the LoRa training on the runpod: 2023-12-20 11:37:19.448110: E tensorflow/compiler/xla/stream_executor/cuda/cuda_dnn.cc:9342] Unable to register cuDNN factory: Attempting to register factory for plugin cuDNN when one has already been registered 2023-12-20 11:37:19.448272: E tensorflow/compiler/xla/stream_executor/cuda/cuda_fft.cc:609] Unable to register cuFFT factory: Attempting to register factory for plugin cuFFT when one has already been registered 2023-12-20 11:37:19.448407: E tensorflow/compiler/xla/stream_executor/cuda/cuda_blas.cc:1518] Unable to register cuBLAS factory: Attempting to register factory for plugin cuBLAS when one has already been registered 2023-12-20 11:37:19.455528: I tensorflow/core/platform/cpu_feature_guard.cc:182] This TensorFlow binary is optimized to use available CPU instructions in performance-critical operations. To enable the following instructions: AVX2 FMA, in other operations, rebuild TensorFlow with the appropriate compiler flags. 2023-12-20 11:37:24.198671: W tensorflow/compiler/tf2tensorrt/utils/py_utils.cc:38] TF-TRT Warning: Could not find TensorRT

Andrew M

Does LowVram work for older cards like a 1080 with 8gb vram?

Aitrepreneur

it can work if you use the latest Nvidia drivers but the training will be extremely long since it will use your Ram to make up for the lack of vram

JW

Hi. Thanks for your help and material. Per my PM, why is my LoRa only visible when non-SDXL checkpoints are used. I swear I clicked the SDXL checkbox in Kohya. Could there be any other reason?

Aitrepreneur

that means you might have trained on a non sdxl model, a1111 automatically show the compatible loras once a checkpoint is selected. If you select an sdxl model, it will only show loras trained on a sdxl model same thing with sd 1.5

JW

Thank you, this one seems solved.

Freethink

Hi! Id also like a 1.5 lora training preset, the link you posted is expired. Thank you!

Alejandro Duque

Hey, thank you all the content you are creating. I have a RTX 3060 12 GB. I have been trying to train but the amount of time it takes is too much. Do you have any presets suggestion for this kind of hardware? Thank you!

Aitrepreneur

use the same presets, just uncheck the sdxl checkbox and change the resolution to 512,512 instead of 1024,1024

Aitrepreneur

You can just use the sdxl presets, just change the model to a 1.5 model and change the training resolution from 1024,1024 to 512,512

Sebastian Paulmann

Im not sure which one to take. I got a pretty beefy Laptop - 3080 ti 16gb Vram 64gb ram ryzen9, ill just try sdxl

dwinchester

this is for style or training persons?

Jolly Coder

Hello, thanks for the presets. Could you please tell me more about the threshold for VRAM for each preset? Also are we talking about the total VRAM or the available VRAM? I have an RTX 3070 8gb but the in my system info, it says there is 16.5gb VRAM available and 30.4gb total. I'm kinda confused on which one should I take into consideration. I tried doing the exact same thing you did with Milly Alcock in my configuration and it looks like it would take 2 days to finish based on the training speed I was noticing. I appreciate any help. Thanks!

Aitrepreneur

yeah it's 8gb, and it'sis really a bit too low for sdxl training (or at least it will take some time) you could try on a SD 1.5 model training instead maybe, same principle but it will use less vram to train, just change the resolution to 512x512 instead of 1024x1024

Jolly Coder

Thanks! I just switched to runpod. I used the SDXL - RUNPOD.json but loading it doesn't change any parameters in Kohya_ss GUI. The Kohya version looks different though so I don't know if it's a compatibility issue...Is there a chance it needs an update or am I doing something wrong? (still following your video step by step btw)

Aitrepreneur

no it should work, are you sure you got the correct path to the json file?

Jolly Coder

It worked. The UI is just different now and the buttons don't have any description on them. One of the buttons I clicked just saved the default configuration back to the file, which caused losing the runpod configuration. All good now once I figured out the new UI. Thanks!

eduardo

do you have presents to train 1.5 loras and checkpoints?

Tere Garcia

Hi! I'm trying to use this in rundifusion but it doesn't seem to work. Any tips? Thank's, great content

Aitrepreneur

it's pretty much the same, just change the model to a 1.5 model (uncheck sdxl checkbox) and change the training resolution to 512x512 instead of 1024x1024

Aitrepreneur

these presets are for training a lora inside Kohya, not sure what rundifusion really is

eduardo

great! also, id like to train a chekpoint with dreambooth, (locally with eiither Kohyah or A111. SD1.5 and XL Model) what woudl be your latest tutorial to follow? i see a few you have but most of your newones are all about Loras

Tere Garcia

Rundifusion is a server containing Stable Diffusion. They have the last version of Kohya. Tryed with this files as the tutorial sayed, and didn't work. Any tips? Thanks

Aitrepreneur

oh I see, well again I'm not sure how to help, never used it before but if it's like runpod there must be a place to upload the preset file and put the path of the file inside the kohya webui like I showed in the video, otherwise not much I can do, I can't provide support for other paid third party tools I haven't used myself ya know

eduardo

Actually, i used this sdxl setting not for the Lora but for the dreambooth checkpoint trainning. They work but very slow. Anything i should chabge for model training vs Lora for sdxl

Aitrepreneur

Tbh I don't really recommend DB training instead of Lora, I mean lora is litterally just DB training but more optimized to run on consumer hardware, so yeah I don't see a lot of reason to use DB instead of Lora. DB is a bit more powerful but tbh the results shouldn't be that big and Loras are easier to use since they are small files and not full checkpoints

Moonlight

I have tried LORA training on SDXL, however once it finishes, when I load the LORA. it throws warnings like these: lora key not loaded: model.diffusion_model.output_blocks.2.1.transformer_blocks.7.norm2.bias lora key not loaded: model.diffusion_model.output_blocks.2.1.transformer_blocks.7.norm2.weight lora key not loaded: model.diffusion_model.output_blocks.2.1.transformer_blocks.7.norm3.bias . It's a long list of these warnings, the LORA doesn't resemble a single bit while generating images. What could be the reason?

can sakhi

hey is this still uptoDate . i tried using it on runpod the RUNPOD_SMALLORA but im getting error : File "/workspace/kohya_data/kohya_ss/venv/lib/python3.10/site-packages/gradio/components/dropdown.py", line 169, in "enum": [c[1] for c in self.choices],