Train your own LORA model in 30 minutes LIKE A PRO!

  Рет қаралды 33,782

Code & bird

Code & bird

8 ай бұрын

In today’s video I want to show you how to train your own Lora. What is Lora first of all, and why do you need to train it.
Link to original notebook: colab.research.google.com/git...
Link to my copy:
colab.research.google.com/dri...
If you ever tried to make images in stable diffusion with the same character, pose or object, you might have noticed that its hard and default model will not give you consistent results.
So, Lora models are here to solve this problem.
LoRA stands for Low-Rank Adaptation. It allows you to use low-rank adaptation technology to quickly fine-tune diffusion models. The LoRA training model makes it easier to train Stable Diffusion on different concepts, such as characters, objects, animals, or a specific style. These trained models then can be exported and used by others in their own generations.
There are plenty of Loras pre-trained for you on websites like civitai but the best fun is to train your Lora yourself. It requires small amount of pictures and pretty low effort comparing to other types of models. So if you have your data ready you can do it for 10 minutes. And that’s what we gonna do now.

Пікірлер: 62
@user-se3ey1ey7s
@user-se3ey1ey7s 6 ай бұрын
Your'e a life saver.Can't thank you enough. Since the Google colab file really changed, it was hard to follow any other tutorial. Your saved version of Google colab file really helped! The newer version had some weird problem, it was not detecting any of my images. This tutorial was really easy to follow. But your copy of google colab was the real MVP for me. Thanks and keep making these tutorial.
@codeandbird
@codeandbird 6 ай бұрын
Glad it was helpful! I haven't seen the new colab yet, but hope you'll figure out how to use it too :)
@CRIMELAB357
@CRIMELAB357 6 ай бұрын
i just want to see one comment that says this worked
@saintgio3
@saintgio3 3 ай бұрын
You mention the sampler DDIM helps to not lose much quality in training. I was under the impression that samplers were just used for generating sample images, and not affecting the actual training itself. Will you elaborate on this?
@ahmadzaini
@ahmadzaini 3 ай бұрын
After successfully making one lora, if I want to make another lora I have to start from the beginning again or where can I start?
@danielortizespinoza740
@danielortizespinoza740 6 ай бұрын
Hello! I found your video, and I just wanted to say спасибо тебе большое!! (Увидел, что твой Драйв на русском 😅). But I had a question. Does the use of google colab for stable diffusion depend on my GPU? I know that Stable Diffusion doesn't work for AMD processors, which is my case.
@codeandbird
@codeandbird 6 ай бұрын
Ah thank you glad it was helpful ☺️ It doesn’t matter what gpu you’ve got, it all runs in colab environment, so you should be fine 👌
@shig100
@shig100 3 ай бұрын
Thank you for the tutorial! 4.2.3 On the custom captioning when I execute, I'm getting this error: " in :23 NameError: name 'train_data_dir' is not defined" I know it's referring to the path but not sure what I have to change. right now I have /My Drive/ LoRA/train_data/my_photos Thanks in advance any help is appreciated.
@georgea.3562
@georgea.3562 8 ай бұрын
Cool stuff! btw have you kept contact with your bird? So cute!
@codeandbird
@codeandbird 8 ай бұрын
Her new family sends me pictures and vids :)
@baheth3elmy16
@baheth3elmy16 3 ай бұрын
Great tutorial. Sadly, when I ran the training using your Colab copy, I got this error: RuntimeError: CUDA Setup failed despite GPU being available.
@user-jy4tr4bh1m
@user-jy4tr4bh1m 3 ай бұрын
I triple checked everything but I get this error. Would you help me out please? CUDA backend failed to initialize: Found cuDNN version 8700, but JAX was built against version 8904, which is newer. The copy of cuDNN that is installed must be at least as new as the version against which JAX was built. (Set TF_CPP_MIN_LOG_LEVEL=0 and rerun for more info.) /content/LoRA/config/config_file.toml not found.
@sambrainard3487
@sambrainard3487 8 ай бұрын
Took all of the steps you did... still wasn't able to get an output folder or a config folder. Any thoughts on how to fix this?
@codeandbird
@codeandbird 8 ай бұрын
Could be mistake in one of the paths? Try them without drive/MyDrive/ part maybe? Also make sure you allowed colab to write on google drive
@julietawibel4793
@julietawibel4793 6 ай бұрын
There is an error: ERROR: pip's dependency resolver does not currently take into account all the packages that are installed. This behaviour is the source of the following dependency conflicts. pandas-gbq 0.19.2 requires google-auth-oauthlib>=0.7.0, but you have google-auth-oauthlib 0.4.6 which is incompatible. How Can I Solve it? Thanks
@codeandbird
@codeandbird 6 ай бұрын
Hmm, not sure, does the notebook still run with this errors? I think you probably could ignore it if it works
@user-kk2ve1un4u
@user-kk2ve1un4u 8 ай бұрын
what about using SDXL model instead of SD1.5 or SD2 , does this colab can use it ?
@codeandbird
@codeandbird 8 ай бұрын
no, this one won't work, but there is a colab for XL from the same author too - colab.research.google.com/github/Linaqruf/kohya-trainer/blob/main/kohya-LoRA-trainer-XL.ipynb you can use it :)
@user-kk2ve1un4u
@user-kk2ve1un4u 8 ай бұрын
Thanks a lot , and keep going with more tutorials @@codeandbird 👍
@talhak3667
@talhak3667 7 ай бұрын
how can we upload the model on the replicate after training?
@codeandbird
@codeandbird 7 ай бұрын
Personally I've never done that, but there's a guide on the website replicate.com/docs/guides/push-a-model Try it out, for now, maybe I'll do a video about it later.
@discodisco3063
@discodisco3063 7 ай бұрын
can You explain how to use XL ?
@erdbeerbus
@erdbeerbus 6 ай бұрын
is there an option to train a lora localy? on my own pc? thx in advance!
@codeandbird
@codeandbird 6 ай бұрын
Yes you can do it locally too, if your hardware is powerful:)
@everythingsfine3064
@everythingsfine3064 7 ай бұрын
awesome!
@darrenvarley105
@darrenvarley105 Ай бұрын
Thank you. I want to do one for myself and one for my dog.
@infra1
@infra1 6 ай бұрын
I've noticed the Google collab notebook no longer works. It seems to no longer have CUDA resources? Anyone else run into this?
@codeandbird
@codeandbird 4 ай бұрын
Can be just the wrong cuda version, or you need to switch your runtime to gpu
@user-ev5yn6kn1q
@user-ev5yn6kn1q 6 ай бұрын
I managed to run through this successfully a couple of times, but all of a sudden I am now getting the following error every time I start to train: "CUDA backend failed to initialize: Found cuDNN version 8700, but JAX was built against version 8904, which is newer. The copy of cuDNN that is installed must be at least as new as the version against which JAX was built. (Set TF_CPP_MIN_LOG_LEVEL=0 and rerun for more info.)" I've tried multiple gmail accounts as well to no avail. Is the google colab broken?
@codeandbird
@codeandbird 6 ай бұрын
which colab do you run? the one I saved to gdrive or the original one? whichever it is, try to run another one:) if it won't help, i recommend you to google the error and see what people say, usually adding a cell to the colab and force install the right version of the lib it complains about will fix it
@My_Chaotic_Record_Collection
@My_Chaotic_Record_Collection 5 ай бұрын
@@codeandbird it is confirmed that your version still works? Thank you for your work
@aseideman
@aseideman 4 ай бұрын
same error, did you find a fix?
@codeandbird
@codeandbird 4 ай бұрын
Check if you run runtime with GPU
@user-li1qo2ic1w
@user-li1qo2ic1w 3 ай бұрын
Just got the same error. Did you find a way to fix this?
@mrdrsir2324
@mrdrsir2324 5 ай бұрын
Is this notebook still working? i heard that some simmilar note from civitai lora tutorial was banned by google.
@codeandbird
@codeandbird 5 ай бұрын
it works for me with colab pro - not sure about the free tier though
@RianTuanakotta
@RianTuanakotta 7 ай бұрын
can you train models in google colab without premium subscription?
@codeandbird
@codeandbird 7 ай бұрын
Haven’t tried, but I guess even if you can - it’s gonna be slow
@sylvia4764
@sylvia4764 7 ай бұрын
yes
@SamuelBoreas
@SamuelBoreas 3 ай бұрын
I have no Lora folders in my drive...and they won't create.
@kimjongoof5000
@kimjongoof5000 5 ай бұрын
would it be a bad idea to have like 70 pictures?
@codeandbird
@codeandbird 5 ай бұрын
you can have as many pictures as you want, just make sure that all the pics are different - it doesn't make sense to use many similar pics, it will slow down training and won't make results better
@kimjongoof5000
@kimjongoof5000 5 ай бұрын
@@codeandbird Well... I want the AI to make pictures of this "Geumsaegi" character from a badly drawn TV show called "Squirrel And Hedgehog" (look it up). Pictures of the character in full body are few and far between and most of them, despite being drawn by human artists back in the 90s and 2000s, look like badly done AI pictures (I am not kidding)
@inkyinc2541
@inkyinc2541 8 ай бұрын
👍
@user-li1qo2ic1w
@user-li1qo2ic1w 3 ай бұрын
At around 15:23 you say “…then we go into our web UI, you remember in the last video I showed you how to upload LoRAs here.” Where is our web UI (do you mean Google Drive?) and where is this previous video please? You mention the video again at 16:33 without telling us where it is.
@codeandbird
@codeandbird 3 ай бұрын
I was talking about this one: Forbidden Desires: Generate Adult Content with AI kzbin.info/www/bejne/j4jWdmSnjtCJsLc
@ROBOTRIX_eu
@ROBOTRIX_eu 3 ай бұрын
@AlizerLeHaxor
@AlizerLeHaxor 5 ай бұрын
the notebook got banned :(
@codeandbird
@codeandbird 5 ай бұрын
it works for me with colab pro - not sure about the free one though
@blendfile3_3
@blendfile3_3 5 ай бұрын
сначала не понял почему гугл на русском xd
@codeandbird
@codeandbird 5 ай бұрын
😅
@allcash3314
@allcash3314 5 ай бұрын
Очень сложно. Можно было бы и по русски(((
ULTIMATE FREE LORA Training In Stable Diffusion! Less Than 7GB VRAM!
21:14
LORA training EXPLAINED for beginners
27:33
Not4Talent
Рет қаралды 90 М.
1❤️#thankyou #shorts
00:21
あみか部
Рет қаралды 77 МЛН
1 класс vs 11 класс  (игрушка)
00:30
БЕРТ
Рет қаралды 3,5 МЛН
Would you like a delicious big mooncake? #shorts#Mooncake #China #Chinesefood
00:30
Training LoRA with Kohya (theory included!)
36:18
Laura Carnevali
Рет қаралды 85 М.
Relocating to Scotland? Here's the REALITY behind it!
9:16
Scotlandmagic
Рет қаралды 36 М.
LORA Training - for HYPER Realistic Results
36:20
Olivio Sarikas
Рет қаралды 92 М.
Lora Training using only ComfyUI!!
11:15
AIFuzz
Рет қаралды 16 М.
Train a LORA with JUST 1 IMAGE!!! - Koyha_ss, A1111, Vlad Diffusion
10:37
How to correctly train your Stable Diffusion model
11:48
That Arts Guy {Siddhant}
Рет қаралды 42 М.
ComfyUI EP07: How to use LoRA in ComfyUI [Stable Diffusion]
22:43
AI Angel Gallery
Рет қаралды 34 М.
Stable Cascade LORA training
11:47
FiveBelowFiveUK
Рет қаралды 4 М.
Easy SDXL LORA Training  - SAME FACE, CONSISTENT CHARACTER
34:38
Code & bird
Рет қаралды 4,9 М.