ULTIMATE FREE LORA Training In Stable Diffusion! Less Than 7GB VRAM!

Aitrepreneur
3 Feb 202321:14

Summary

TLDRThis video tutorial introduces 'Laura,' an efficient method for training AI models using personal images, optimized for devices with limited GPU resources. It combines elements of Dreambooth and textual inversion, enabling the creation of lightweight embeddings for various models. The guide walks viewers through the process using Koya SS GUI, from setting up the software to training a model with detailed steps and configurations. The result is a personalized AI model that can be mixed and matched for unique image generation, all achievable with minimal hardware requirements.

Takeaways

  • 😀 Laura is a method for training AI models using personal images, optimized for small graphics cards with only 6-7 GB of VRAM.
  • 🤖 Laura combines elements of Dreambooth and Textual Inversion, creating small files that can be used with any model, unlike larger Dream Booth models.
  • 🚀 The video demonstrates using Koya SS GUI, a user-friendly software for training models like Dreambooth, Textual Inversion embeddings, and fine-tuning models.
  • 🔧 The Koya SS GUI installation process requires Python, git, and specific Visual Studio redistributables, with detailed steps provided in the video.
  • 📁 A specific folder structure is necessary for Laura training, including image, model, and log folders, with the image folder containing subfolders named after training step counts.
  • 🖼️ Image preparation for Laura involves high-quality, varied images, resizing to 512x512 resolution, and using tools like blip for image captioning.
  • ✍️ Captioning images for Laura requires adding the character's name to the beginning of the caption for more precise training results.
  • 🔢 The number of training steps is determined by the formula of at least 100 steps per image, with a total minimum of 1500 steps, influencing the subfolder naming.
  • 📝 Two configuration files are provided for training: one basic and one for systems with less than 8 GB of VRAM, simplifying the setup process.
  • 🔧 Training parameters like batch size, learning rate, and resolution can be adjusted, with suggestions given for weak GPUs to use memory-efficient options.
  • 🎨 The final Laura model can be used in Stable Diffusion with an extension, allowing the weight of the model to be adjusted in prompts for varied image results.

Q & A

  • What is Laura in the context of this video?

    -Laura is a method for training a subject using your own images, optimized for small graphics cards, requiring only 6 to 7 gigabytes of VRAM, making it accessible for users with limited GPU resources.

  • How does Laura compare to Dreambooth and Textual Inversion in terms of resource requirements?

    -Laura is more resource-friendly compared to Dreambooth and Textual Inversion, as it allows for training a subject with significantly less VRAM, making it suitable for users with less powerful GPUs.

  • What is the file size of the embeddings created by Laura?

    -The embeddings created by Laura are small, typically ranging between 300 megabytes and 100 megabytes, which is considerably less than the size of a Dream Booth model.

  • Can Laura embeddings be used with any model?

    -Yes, Laura embeddings can be applied to any model in the same way as Textual Inversion embeddings, making them versatile for various applications.

  • Why is the Dreambooth extension not used for training Laura in this video?

    -The Dreambooth extension is not used because it often does not work well with the automatic 11 due to new updates that can break the training process, which the presenter finds annoying and prefers to avoid.

  • What is the Koya SS GUI and how is it used in the video?

    -The Koya SS GUI is a software that simplifies the training process for a Dreambooth model, a checkpoint, and a texture inversion embedding, or even fine-tuning your own model. It is used in the video to train Laura efficiently and easily.

  • What are the system requirements for installing the Koya SS GUI?

    -To install the Koya SS GUI, one needs to have Python and git installed, as well as Visual Studio 2015, 2017, 2019, or 2022 with the distributable libraries. If not already installed, an Excel file is provided to assist with the installation.

  • How does one set up the Koya SS GUI for training?

    -The setup involves installing the necessary software, creating a new folder for the Koya installation, copying and pasting command lines into Windows Powershell, and following the prompts to complete the installation process.

  • What is the recommended image resolution for training with Laura?

    -The recommended image resolution for training with Laura is 512 by 512 pixels. However, for higher quality results with a powerful GPU, training at 768 by 768 pixels is suggested.

  • What is the minimum number of images recommended for training with Laura?

    -It is recommended to have at least 10 high-quality images for training with Laura. The number of training steps should be at least 100 steps per image, with a total of at least 1500 steps.

  • How can one use the trained Laura model in Stable Diffusion?

    -After training, the Laura model can be used in Stable Diffusion by copying the saved tensor file and pasting it into the Stable Diffusion UI folder's models/Laura directory. An extension called 'Koya SS Additional Networks' needs to be installed to utilize the model within the UI.

  • How does one mix different Laura models in a prompt for Stable Diffusion?

    -Multiple Laura models can be used together in a prompt by selecting them and adjusting their respective weights to control the emphasis on each model's influence on the final image, ensuring the total weight does not exceed one.

  • What is the impact of using a lower batch size during training?

    -Using a lower batch size, such as one, can improve the quality of training, especially when the number of images is limited. However, it may increase the training time and use less VRAM compared to higher batch sizes.

  • What are the benefits of training at a higher resolution like 768x768?

    -Training at a higher resolution such as 768x768 can result in better-looking models, especially when high-quality images are available. However, it requires a more powerful GPU due to increased VRAM usage.

  • How can one ensure the proper naming of folders for training steps in Laura?

    -The folder name should include the number of training steps per image followed by an underscore and the name of the character, ensuring the total training steps are at least 1500 and each image has at least 100 steps.

  • What are the configuration files provided in the description for?

    -The configuration files provided are used to automatically set optimal training parameters for Laura, including one for general use and another for systems with less than 8 gigabytes of VRAM.

  • What is the role of the 'enable buckets' option during training?

    -The 'enable buckets' option is used when training with images of different dimensions, ratios, and resolutions. It allows the training process to accommodate images that are not uniformly cropped or sized.

  • How can one modify the weight of a Laura model in a prompt?

    -The weight of a Laura model in a prompt can be modified by adjusting the number associated with the model's call-out text in the prompt. A value of 1 corresponds to 100% influence, 0.9 to 90%, and so on.

Outlines

00:00

🤖 Introduction to Laura AI Training Method

This paragraph introduces Laura, an AI training method that uses personal images and is optimized for small graphics cards, requiring only 6-7 gigabytes of VRAM. Laura is described as a hybrid between dreambooth and textual inversion, creating small files for use with any model. The video will not use the dreambooth extension due to compatibility issues with automatic updates, instead focusing on the Koya SS GUI, a user-friendly software for training models and fine-tuning. The paragraph concludes with acknowledgments to contributors who provided tips and created instructional videos for using the Koya SS GUI.

05:02

🛠️ Setting Up Koya SS GUI for AI Training

The paragraph outlines the process of installing the Koya SS GUI, starting with accessing the repository and ensuring prerequisites like Python and git are installed. It details the installation steps, including running commands in Windows Powershell as an administrator, and provides a link for downloading required libraries if not already installed. The process involves creating a new folder for the installation, copying and pasting code from GitHub, and following the installation prompts. An optional step is also mentioned for users with NVIDIA 30 or 40 series graphics cards to improve training speed.

10:04

🖼️ Preparing Images for Laura Training

This section explains the preparation of images for Laura training, emphasizing the importance of high-quality and varied images. It suggests using a website for resizing images to 512x512 resolution and manually modifying captions for each image to perfectly describe them. The process involves using a tool like blip for image captioning and then editing these captions to include the character's name for more precise training. The paragraph also describes creating a specific folder structure for training, including an images folder, a model folder, and a log folder, with the training steps determined by the number of images provided.

15:05

🔧 Configuring Training Parameters for Laura

The paragraph discusses configuring training parameters for Laura, starting with choosing a base stable diffusion model and selecting appropriate checkboxes based on the model's version. It introduces two configuration files provided by the video creator for optimal training settings, one for general use and another for systems with less than 8 gigabytes of VRAM. The video creator guides viewers on how to input folder URLs for images, outputs, and logs, and how to set the model output name. It also touches on various training parameters such as batch size, learning rate, and resolution, with advice on selecting settings based on the strength of the user's GPU.

20:06

🚀 Starting the Laura Training Process

This paragraph instructs viewers on initiating the Laura training process by clicking the 'train model' button after configuring all settings. It provides insights into training parameters like batch size, which affects training speed and VRAM usage, and the importance of selecting the right settings for users with limited VRAM. The paragraph also explains how to use the provided configuration files for easy setup and how to modify settings for low VRAM systems. The training time is highlighted, noting that 1500 steps with a batch size of 2 takes only 6 minutes, and the final result is a save tension file that can be used in stable diffusion with the help of an extension.

🎨 Using Trained Laura Models in Stable Diffusion

The final paragraph demonstrates how to use the trained Laura model in stable diffusion, detailing the process of copying the trained model file into the appropriate folder and installing the necessary extension. It explains how to integrate the Laura model into prompts by using additional networks and adjusting the model's weight to influence the image generation. The creator shows examples of image generation with different model weights and mixing two Laura models to create unique images, emphasizing the flexibility and power of Laura for quick AI training even with limited GPU resources.

Mindmap

Keywords

💡Laura

Laura is a method for training AI models using personal images, optimized for devices with limited GPU resources. It allows users to train a subject with as little as 6-7 gigabytes of VRAM, making it accessible for those without high-end graphics cards. In the video, Laura is described as a hybrid of Dreambooth and textual inversion techniques, creating small files for use in AI models, which is central to the video's theme of efficient AI training.

💡VRAM

VRAM, or Video Random Access Memory, refers to the dedicated memory used by a graphics processing unit (GPU) for storing image data. In the context of the video, VRAM is a critical resource for AI model training, with Laura requiring significantly less VRAM compared to other methods like Dream Wolf or textual inversion, thus democratizing the training process for users with smaller GPUs.

💡Dreambooth

Dreambooth is a technique for training AI models on custom datasets, allowing the creation of models that can generate images based on specific subjects or styles. The video script mentions Dreambooth as a comparison point for Laura, indicating that Laura is a more efficient method in terms of VRAM usage while still achieving similar results.

💡Textual Inversion

Textual inversion is a process in AI training where text embeddings are used to influence the generation of images. The video describes Laura as being similar to textual inversion in that it creates small files that can be used as embeddings in AI models, but with the added benefit of lower VRAM requirements.

💡Koya SS GUI

Koya SS GUI is a software tool mentioned in the video that simplifies the process of training AI models, including Dreambooth models, checkpoints, and embeddings like Laura. It is highlighted for its user-friendly interface and the ability to fine-tune models, making it a key component in the video's tutorial on training with Laura.

💡Training Parameters

Training parameters are the settings used to configure the AI model training process, such as batch size, learning rate, and resolution. The video script provides detailed instructions on how to set these parameters for optimal training with Laura, emphasizing the importance of these settings in achieving high-quality results.

💡Batch Size

Batch size in AI training refers to the number of samples processed before the model's internal parameters are updated. The video suggests choosing a batch size of one for a small number of high-quality images to improve training quality, or two by default for a balance between speed and VRAM usage.

💡Embeddings

In the context of AI, embeddings are vector representations of words, phrases, or images that capture their semantic meaning. The video explains that Laura creates small embeddings that can be applied to any model, similar to textual inversion, but with a smaller file size, which is crucial for efficient model usage.

💡Stable Diffusion

Stable Diffusion is a type of AI model used for generating images from text descriptions. The video mentions Stable Diffusion as the base model on which Laura embeddings can be applied, showcasing its versatility and the integration of Laura with existing AI technologies.

💡Extensions

In the video, extensions refer to additional features or functionalities that can be added to AI models or training software. The script discusses the use of extensions like 'safe tensors' with Stable Diffusion to enhance model performance, emphasizing the importance of selecting the right extensions for training stability.

💡Regularization

Regularization in AI training is a technique used to prevent overfitting by introducing additional information or constraints to the model. The video mentions that regularization images are not necessary for Laura training when training a single subject, indicating a simplification in the training process compared to other methods.

Highlights

Introduction of Laura, a method for training AI models using personal images with minimal VRAM requirements.

Laura is optimized for small graphics cards, requiring only 6-7 gigabytes of VRAM.

Comparison of Laura with Dreambooth and Textual Inversion, noting its smaller file size and flexibility.

Explanation of how Laura creates small 100-megabyte embeddings applicable to any model.

Mention of Koya SS GUI, a user-friendly software for training models and fine-tuning.

Details on the installation process of Koya SS GUI and prerequisites like Python and git.

Instructions for setting up the command line and executing the installation script.

Optional steps to improve training speed for NVIDIA 30 or 40 series graphics cards.

Description of the folder structure necessary for training with Laura.

Importance of image quality and variation for effective training.

Process of resizing images to 512x512 resolution for training.

Use of blip for image captioning and the manual modification of captions for precise training.

How to name training folders to determine training steps based on the number of images.

Preparation of configuration files for training parameters to simplify the process.

Selection of base stable diffusion models and the impact on training settings.

Recommendation to use 'safe tensors' for stable diffusion models.

Discussion on training parameters like batch size, learning rate, and resolution.

Techniques for mixing multiple Laura models to create unique images.

Demonstration of the final results and the capability to adjust model weights for different outcomes.

Conclusion emphasizing the power of Laura for quick training on weak GPUs.

Transcripts

play00:01

and in this video I will show you how

play00:03

you can train your own subject using

play00:05

Laura now what is Laura well Laura is a

play00:09

method of training your subject using

play00:10

your own images that is optimized for

play00:13

small graphics card meaning that

play00:15

compared to dream wolf or textual

play00:17

inversion you can train a subject with

play00:19

only 6 to 7 gigabytes of vram which is a

play00:22

super good news for all of you who don't

play00:24

have a good GPU now basically Laura is

play00:26

kinda like a love child between

play00:28

dreambooth and textual inversion in the

play00:31

sense that it creates these small 100

play00:33

megabytes file that you can use in the

play00:35

exact same way as textual new version

play00:37

embeddings meaning that they can be

play00:39

applied to any model and the size of

play00:41

these embeddings usually range between

play00:43

300 megabytes in 100 megabytes which is

play00:46

definitely way less than a dream Booth

play00:48

model and of course just like dreamwoof

play00:50

and textual inversion you can train a

play00:52

style or a character absolutely anything

play00:55

you want now in this video I'm not going

play00:57

to be using the dreambooth extension to

play00:59

train Laura now I've already explained

play01:01

why in my previous Dreamboat video then

play01:03

the dreambooth extension often does not

play01:06

work very well with the automatic 11

play01:08

because of new updates so sometimes a

play01:11

new update can completely break the

play01:12

training and it's very annoying and I

play01:15

personally don't want to deal with this

play01:16

anymore but don't worry because we're

play01:18

going to be using something even better

play01:19

and that is the Koya SS GUI it is a

play01:22

super cool piece of software that is

play01:24

super easy to use where you can train a

play01:26

dreamboof model and lower a checkpoint

play01:28

and texture inversion embedding or even

play01:31

fine-tune your own model and thanks to

play01:33

the configuration files that I'm gonna

play01:34

provide you in the description down

play01:36

below it is super easy and fast to set

play01:38

up so let's go but before we begin let

play01:41

me thank two people for making this

play01:42

video possible the first one is spy BG

play01:44

who gave me a lot of tips and tricks on

play01:47

how you can use Laura efficiently and

play01:49

the second one is Bernard malte that

play01:51

made two amazing videos explaining how

play01:52

to create a lower weight using the Koya

play01:55

SS GUI and that is also responsible for

play01:57

making the Koya SS GUI that we're gonna

play01:59

be using today so again the link for

play02:01

their channels will be in the

play02:02

description down below alright then now

play02:04

let's begin alright so to install the

play02:05

Koya SS GUI you're gonna click the link

play02:07

to description down below you're gonna

play02:08

arrive on this page on the Korea SS GUI

play02:10

repository you're gonna scroll down

play02:12

you're gonna make sure that you have

play02:14

Python and git installed if you already

play02:16

have stable division installed it should

play02:18

be already there if you follow my

play02:20

tutorial video but also make sure that

play02:22

you have the visual studio 2015 2017 19

play02:25

2022 with distributable already

play02:27

installed if you don't have it installed

play02:29

already you can click on this link right

play02:31

here and it will download an Excel file

play02:33

and then just run the Excel file to

play02:35

install the required libraries it's very

play02:37

easy very simple very fast nothing to

play02:39

worry about so then once you have

play02:41

everything installed you're gonna come

play02:43

here and select this command line and

play02:45

Ctrl C to copy it then you're gonna go

play02:47

into your Windows startup menu and look

play02:49

for Windows Powershell and then click on

play02:52

run as administrator and then just paste

play02:54

the command line that we copied

play02:56

previously and then press enter it's

play02:58

going to ask you if you want to change

play02:59

the execution policy and here you're

play03:01

gonna type

play03:02

Aya that basically corresponds to yes

play03:04

for all and then press enter and there

play03:06

we go so now that this is done you can

play03:08

close the window and we're going to

play03:10

create a brand new folder on our

play03:12

computer so right click new folder I'm

play03:15

gonna call mine Koya which is where

play03:17

we're gonna put the koyan installation

play03:19

then go inside that folder click on the

play03:21

folder URL Ctrl C to copy it then go

play03:24

back to the Windows startup again look

play03:26

for Powershell but this time no need to

play03:28

run it as administrator you can just run

play03:30

it normally and then what we need to do

play03:32

is that we need to go and design the

play03:33

folder that we created right here and to

play03:35

do this you're gonna type CD space and

play03:38

then paste your folder URL right here

play03:40

now if you created a folder that is not

play03:42

on the C drive instead of Simply putting

play03:45

CD you're gonna have to add slash D and

play03:48

then the path of your folder let's say

play03:49

your folder is on your drive e this is

play03:52

what this would look like but in my case

play03:54

since this is on my C drive I don't need

play03:56

the slash D so I'm simply going to be

play03:58

using CD and then the URL of my folder

play04:01

and then press enter and as you can see

play04:03

now we are inside the folder that we

play04:05

just created right here so now we go

play04:07

back to GitHub and we're going to click

play04:08

on this button right here to copy this

play04:10

entire code and then we're gonna paste

play04:12

the entire code in the center Windows

play04:14

Powershell window and if it gives you a

play04:16

warning you can just click on test

play04:18

anyway and as you can see right now it

play04:20

has started running all the lines of

play04:22

code that we copy and pasted before now

play04:24

this might take some time so be patient

play04:26

it shouldn't take too long this is not a

play04:28

stable diffusion installation after all

play04:30

but for some of you it might still take

play04:31

some time now at the end of the

play04:33

installation it will stop at the

play04:34

accelerate config line code and to

play04:37

finish the installation you can just

play04:38

press enter so then it's going to ask

play04:40

you a few questions so for the first

play04:42

question you're going to choose this

play04:43

machine so here just press enter no

play04:46

distributed training so press enter

play04:48

again here you're gonna type no press

play04:50

enter torch Dynamo you're gonna type no

play04:53

again then press enter they want to use

play04:55

deep speed you're going to press no then

play04:57

press enter again What GPU should be

play04:59

used you're gonna type all then press

play05:01

enter Then you wish to use fp16 or bf16

play05:04

for this one you're going to be choosing

play05:06

fp16 so just press the down arrow and

play05:09

then press enter and now finally as you

play05:11

can see the installation is done now

play05:13

technically we could stop right here but

play05:15

there is an additional optional stand

play05:16

that you can take that will improve the

play05:19

training speed if you have a 30 or 40

play05:21

series graphics card for NVIDIA but

play05:23

don't worry it's very simple all you

play05:25

have to do is just click on this link

play05:26

right here and it will download a zip

play05:28

file and if for some reason this link

play05:30

does not work or is too slow I will also

play05:32

give you a mega link that you can use

play05:34

instead so once you've downloaded the

play05:36

zip archive on your video you just right

play05:37

click and then extract it then you're

play05:39

gonna go inside that folder select the

play05:41

cud and N Windows Ctrl C to copy it then

play05:45

go inside the Koya SS folder and paste

play05:47

the folder right here then we go back to

play05:49

GitHub click on this button right here

play05:51

to copy these two lines of code go back

play05:53

to the windows Powershell window and

play05:55

then paste the lines of codes right here

play05:57

and again if it gives you a warning you

play05:59

can just click pay list anyway and then

play06:01

press enter and as you can see now

play06:02

everything is done we did the most

play06:05

difficult part of this video

play06:06

congratulations and now if we go inside

play06:08

our Konya SS folder you will see a bunch

play06:11

of files but don't worry because

play06:13

actually there is only two files that

play06:14

interest us that is the goo either but

play06:16

in the upgrade.ps one for example next

play06:19

time that you want to update Koya SS all

play06:21

you have to do is just come here on the

play06:23

upgrade.ps1 right click and then run

play06:25

with Powershell and as you can see it

play06:27

will automatically update the Korea SS

play06:30

folder and then finally if we want to

play06:31

run the Korea SS GUI all you have to do

play06:34

is just double click on the gui.bat file

play06:36

and to load the CSS and just like stable

play06:38

diffusion it will give you a local URL

play06:40

that you can easily open in your browser

play06:42

but just holding down control and then

play06:44

click on the local URL and there you go

play06:46

now we are inside the Koya SS GUI and we

play06:49

can finally begin the dreambooth Laura

play06:51

training now obviously before we can

play06:53

begin the training there is a few steps

play06:55

that we need to do before and the first

play06:56

step is of course to prepare our images

play06:58

now will not be going into too much

play07:00

details about that in this video because

play07:02

I've already talked about it in my

play07:04

previous text uni version video so

play07:06

definitely watch this video before

play07:08

watching this one or at least watch the

play07:10

beginning of the video where I explain

play07:11

how to perfectly caption an image

play07:13

because the process is pretty much the

play07:15

exact same but if I had to summarize

play07:17

first make sure that all the images are

play07:19

of high quality and that the images have

play07:22

a lot of variation so you have different

play07:24

lights in different angles make sure to

play07:26

have at least 10 images as long as they

play07:28

are of high quality it's better to have

play07:30

a small amount of images of high quality

play07:32

than a lot of images with bad quality

play07:34

then you can use a website like berm.net

play07:36

to resize your images to 512 by 512

play07:39

resolution although for lower training

play07:42

you don't necessarily need to resize any

play07:44

images you can use images of any

play07:46

resolution but if you're not confident

play07:48

and you want to make sure that

play07:49

everything works well just process the

play07:51

images manually it will work absolutely

play07:53

fine then you're gonna capture each

play07:55

image using a process like blip that

play07:58

will do like 80 of the world work for

play08:00

you and you can do this process either

play08:01

inside stable diffusion or inside the

play08:04

koyagui by going into utilities and then

play08:06

believe captioning it will basically do

play08:08

the exact same thing it will analyze

play08:10

every image and then create a text file

play08:13

with the same name as your image and

play08:15

then for each image you're gonna have to

play08:16

go and manually modify the captioning so

play08:18

that it perfectly describes the picture

play08:20

now the small difference compared to

play08:22

textual inversion captioning is that in

play08:24

the beginning of the captioning you're

play08:26

going to input the name of your

play08:28

character now you don't necessarily need

play08:30

to do it you could simply leave it like

play08:32

that so that the next time that you use

play08:33

the Laura embedding every women in your

play08:36

prompt will look like your character but

play08:38

if you want more Precision for your

play08:39

prompt you can simply input the name of

play08:41

your character in the beginning of the

play08:43

caption this way when you use your name

play08:44

in The Prompt the name of your character

play08:46

in the lower embedding will be linked

play08:48

together but that's not a big deal if

play08:50

you don't want to do it it's really up

play08:52

to you so now that our images are

play08:54

prepared we're gonna have to create a

play08:56

specific folder structure so this is

play08:58

also something that is different because

play08:59

compared to the textual inversion

play09:01

training but again don't worry it is

play09:02

fairly easy all you have to do is just

play09:04

right click new folder I'm not going to

play09:06

call mine Wednesday Adams Laura I'm

play09:08

going to select all the files and images

play09:10

Ctrl C to copy it then going to send the

play09:13

Wednesday Adam's Laura folder and here

play09:14

we're going to create three folder an

play09:16

image folder a model folder and finally

play09:19

a log folder now we're gonna go and send

play09:22

the image folder and again here we're

play09:24

going to create a new folder but this

play09:26

time this will be a little special

play09:27

because the way we name our folder will

play09:30

determine the amount of training steps

play09:32

that the koyagui will do and this will

play09:34

depend on the amount of images that you

play09:36

have so first you need to make sure that

play09:38

you do at least 100 steps per image with

play09:41

a final training steps of at least 1500

play09:44

so for example if you only have 10

play09:46

images and you need at least 1500 steps

play09:49

of training you're gonna take 1500

play09:51

divided by the number of images that you

play09:54

have and it's going to give you 150 and

play09:57

this number is the amount of training

play09:59

Style types per image that we need to

play10:01

input into folder name so for this

play10:03

you're going to right click new folder

play10:05

and you're gonna type 150 underscore and

play10:09

then the name of your character so in my

play10:11

case it's Wednesday Adams then you're

play10:14

going inside that folder and you paste

play10:16

your images right here so as I said

play10:18

previously this number right here is

play10:19

what determines the amount of training

play10:21

steps per image that the Lora training

play10:24

will do so in this example I only give

play10:26

you a number if you only had 10 images

play10:28

but let's say you add 20 images for

play10:30

example well in that case there would be

play10:32

1500 divided by 20 and gives you 75 but

play10:36

as I said this number should be at least

play10:39

100 so if you already have 20 images you

play10:43

don't need to do this math anymore and

play10:45

you can just input instead of 150 100

play10:48

same if you have 25 images 30 images etc

play10:52

etc this number should be at least 100

play10:54

but if you have less than 15 images you

play10:57

need to do this little math and for

play10:59

example simple in my case I only have 11

play11:01

images 11 is less than 15 so I'm gonna

play11:05

have to do some math so 1500 divided by

play11:07

11 gives me 136 well this is the number

play11:11

that I'm going to be using for the

play11:13

folder name so again instead of 100 I'm

play11:15

gonna put

play11:16

136 and now finally after we've prepared

play11:19

your images after we prepare the folder

play11:21

structures we can finally start the last

play11:24

step which is training and for this I

play11:26

will make your life very simple because

play11:28

I prepared for you two configuration

play11:30

files that you can use to automatically

play11:32

determine the training parameters so for

play11:34

this you're gonna click the link in

play11:35

description down below and you're gonna

play11:37

have two Json files the first is the

play11:39

Lora basic settings which is basically

play11:41

the basic lower settings that work with

play11:43

pretty much every single training and

play11:45

the second one is a special settings

play11:46

file that you can use if you have less

play11:48

than 8 gigabytes of vram so just

play11:50

download these two files put them

play11:52

somewhere safe then you're gonna come

play11:54

here click on the configuration file

play11:56

button click on open and then choose one

play11:58

of these two files so here I'm just

play12:00

gonna choose the Laura basic settings

play12:01

file and then click open and if you

play12:03

click on training parameters you can see

play12:06

that some of these options were already

play12:07

done for you these are the most optimal

play12:10

settings that work for the Laura

play12:12

training and that you can use as is so

play12:14

if you don't want to waste time this is

play12:16

a super quick way to start a training

play12:18

but I'm also gonna explain a few

play12:19

settings that you might want to modify

play12:21

the padding on your training now first

play12:23

before we begin let's actually choose

play12:25

our base stable diffusion model

play12:27

basically what stable diffusion model

play12:29

are you going to be using to train a

play12:31

Lora model and here in the model quick

play12:33

pick you have already a bunch of

play12:35

pre-selected models the 1.4 the 1.5 the

play12:38

2.0 2.1 the 2.0 512 by 512 and the 2.1

play12:43

512 by 512 and if you select one of

play12:46

these models it will be automatically

play12:47

downloaded from GitHub and also

play12:49

depending on the model that you select

play12:51

some options will be selected so if you

play12:54

select for example the 1.5 you will see

play12:56

that this checkbox will not be selected

play12:58

because this is not a V2 model however

play13:00

if you select the 2.0 base you will see

play13:03

that this checkbox is now checked and if

play13:05

you choose the 2.0 768 version you will

play13:08

see that now this V parameterization

play13:10

checkbox is checked also now you need to

play13:13

keep these checkboxes in mind because if

play13:15

you come here and click on custom you

play13:17

can actually choose your own model and

play13:20

if you choose a custom model you need to

play13:21

know what model this was based on so for

play13:24

example if I come here and I choose the

play13:25

protogen V 2.2 model I know that this

play13:28

model is based on the 1.5 meaning that I

play13:31

don't need to check any of these

play13:33

checkboxes however if I select the model

play13:35

that is based on the 2.0 model I need to

play13:37

check this checkbox right here and if

play13:39

it's based on the 2.0 768 version I need

play13:43

to check this additional checkbox right

play13:44

here so this is something to keep in

play13:46

mind but I personally think that most of

play13:48

you will use the 1.5 model as a base for

play13:51

training so you will probably not need

play13:53

to use any of these check boxes and here

play13:55

with the safe train model as we have a

play13:57

bunch of extensions that you can choose

play13:59

from but of course I highly recommend

play14:01

that you keep safe tensors because it is

play14:03

now the safest extension for stable

play14:04

diffusion models so whenever you have

play14:06

the choice just choose saved answers so

play14:09

now you're gonna click on the folders

play14:10

Tab and here for each section you're

play14:12

going to input the folder URL so for

play14:14

example for my image folder you're going

play14:16

to click here and as you remember we

play14:18

created a brand new folder for that and

play14:19

mine is inside Wednesday Adam's Laura

play14:22

folder and this is the folder that we

play14:23

want to use do not go inside that folder

play14:26

you need to select this image folder

play14:28

right here so just click select folder

play14:30

for the output folder mine is in

play14:33

Wednesday Addams Laura and then select

play14:35

folder and same thing with the login

play14:37

folder once they add UPS Laura and then

play14:39

sync folder now you can also choose a

play14:41

regularization folder where you have

play14:43

your regularization images but for lower

play14:45

training you don't really need

play14:46

regularization images since you're going

play14:49

to be training one subject anyway so

play14:51

here you're gonna input the model output

play14:52

name so in my case I will put Wednesday

play14:54

Addams then click on the training

play14:56

parameters and here you're gonna see a

play14:58

bunch of options but as I said since we

play15:02

have loaded the configuration file you

play15:04

don't actually need to touch anything if

play15:07

you want to start the training right now

play15:08

all you have to do is just click on the

play15:10

train model button and you are done but

play15:13

let's go through some of these training

play15:14

parameters anyway so the train batch

play15:16

size is basically the amount of images

play15:18

that you're gonna train at one time so

play15:20

the higher the number the faster the

play15:21

training will be because you basically

play15:23

divided the amount of training steps by

play15:25

this number but here's a little advice

play15:27

if you don't have a lot of images if you

play15:30

only have like 10 or 15 images I highly

play15:33

suggest that you choose a batch size of

play15:35

one it actually improve a little bit the

play15:37

quality of the training sure it might

play15:39

take longer but the final result will be

play15:41

worth it and of course a higher batch

play15:43

size will also increase the amount of

play15:45

vram used for the training so if you

play15:47

have a weak graphics card I suggest that

play15:49

you put a batch size of one otherwise

play15:52

you just leave it at 2 by default so

play15:54

when it comes to everything right here

play15:55

you're gonna leave everything by default

play15:56

the learning rate is really good you

play15:58

don't really need to change anything

play16:00

this basic settings basically work for

play16:02

every single training so the max

play16:03

resolution this is the resolution that

play16:05

you're going to be training your images

play16:06

at so if you only have 512 by 5 12

play16:09

images You're Gonna Leave It 512 by 512

play16:11

by default but if you can this is my

play16:13

advice if you have a good GPU instead of

play16:16

512 or 512 try training this at 768 by

play16:21

768 yes you will use way more vram but

play16:24

if you have high quality images your

play16:27

final model will look way better

play16:28

otherwise if you have a weak GPU just

play16:31

leave it at 512x512 by default also

play16:33

right here the enable buckets if you

play16:36

often crop your images yourself and you

play16:38

have images of different dimensions and

play16:40

ratio and resolutions you should enable

play16:42

this option right here this will make it

play16:45

so it can train images with different

play16:46

resolutions otherwise if you just

play16:48

cropped it yourself you can just disable

play16:50

this option right here so again here you

play16:52

can leave everything else by default but

play16:54

if you have a weak GPU I suggest that

play16:56

you enable memory efficient attention

play16:58

and and gradient checkpointing this

play17:01

might increase the training time but

play17:03

will also use less vram and if you're

play17:05

lazy like me and you don't want to

play17:06

enable all of these options each time

play17:08

that you want to train if you have a

play17:10

weak GPU you can just come here in the

play17:12

configuration file click on open and

play17:14

then select the lower end of your arm

play17:16

settings file and then click open and as

play17:18

you can see all the low vram options

play17:20

will be selected automatically and then

play17:22

guess what now we are completely done

play17:25

and if we want to begin the training

play17:27

just scroll down and click on train

play17:29

model and as you can see it will finally

play17:31

start the training and for 1500 steps

play17:34

with a batch size of 2 this training

play17:36

takes only 6 minutes which is really

play17:38

super super cool and then after the

play17:40

training is complete if you go inside

play17:42

the model folder you're gonna see your

play17:44

final save tension file right here and

play17:46

to use it inside stable diffusion you're

play17:48

gonna select it Ctrl C to copy it go

play17:51

inside your stable diffusion with UI

play17:52

folder models Laura and then paste your

play17:55

file right here and then you can launch

play17:57

stable diffusion and not to be able to

play17:58

use the lower weight that we train

play18:01

inside koyagui we need to install a

play18:03

special extension so for this you can

play18:05

click on extensions click on available

play18:07

load from then you're gonna scroll down

play18:09

and look for Konya SS additional

play18:12

networks and then click install then

play18:14

you're gonna click on installed and then

play18:16

click apply and restart UI and once you

play18:18

see the additional networks tab that

play18:20

means that the extension was installed

play18:22

correctly and then finally to be able to

play18:24

use Laura inside your prompt you're

play18:26

going to select your model write your

play18:27

prompt and then you're going to click on

play18:29

this button right here to show the extra

play18:30

networks and then choose Laura as you

play18:33

can see right here you have all the

play18:34

lower weight that we created previously

play18:36

and if you want to use one of them

play18:38

inside your prompt you can just click on

play18:40

it and as you can see this line will

play18:41

then appear inside your prompt then you

play18:43

can then select and put it in the

play18:45

beginning of your prompt and the way it

play18:47

works is that this is the text that's

play18:49

going to use to call out the lower

play18:50

weight called Wednesday Addams and the

play18:53

number that you see right here is the

play18:54

weight of the model so exactly as if you

play18:57

would select a prompt tag and put

play18:59

brackets or or a higher number right

play19:01

here this will use a higher percentage

play19:03

of the model the one corresponds to a

play19:06

hundred percent a 0.9 at 90 percent 0.8

play19:09

at eighty percent

play19:11

etc etc and you can create some really

play19:13

cool images just by modifying the weight

play19:15

right here and also what's super cool is

play19:17

that you can use multiple lauraway

play19:19

together for example if I click on

play19:21

another one and I put it right together

play19:22

we are now using two different lauraway

play19:25

together but we need to make sure that

play19:27

the number right here when put together

play19:29

is not over one so if I use for example

play19:32

0.5 here I'm gonna have to use 0.5 right

play19:36

here if I use 0.2 right here I would

play19:38

have to use 0 for the hand right here

play19:40

and the bigger the number the more

play19:42

emphasis it's gonna put on this slower

play19:44

weight but for this example let's

play19:45

actually do a normal one just keep it at

play19:48

one then click on close and then finally

play19:50

click on generate and this is the final

play19:52

result looks pretty good and as you saw

play19:55

with only 6 minutes of training with

play19:57

less than 8 gigabytes of error M you can

play19:59

have a results like this and that's

play20:01

really super powerful and as I said if

play20:04

we keep for example the same seed and if

play20:06

you want to decrease for example the

play20:07

weight of our model if I put something

play20:09

like 0.8 and then click on generate

play20:11

you're gonna have now a slightly

play20:13

different image maybe better maybe worse

play20:16

it kind of depends on what you're

play20:17

looking for and as I showed you

play20:19

previously you can easily mix it with

play20:20

another Laura model so if I take this

play20:22

one for example we just trained on top

play20:24

of a Shelby if I put 60 percent of

play20:26

Wednesday atoms and 40 of Thomas Shelby

play20:29

using the same exact seed and I click on

play20:31

generate it gives me this image and as

play20:33

you can see we are slowly starting to

play20:35

have a little bit more manly look and

play20:37

with brighter eyes and that is because

play20:39

Thomas Shelby has blue eyes so obviously

play20:42

you're gonna have this look influence

play20:43

into the image and if we go even higher

play20:45

you'll see that our character is

play20:47

starting to look more and more like

play20:48

Thomas Shelby and less like Wednesday

play20:50

Adams but it's still super super cool

play20:52

because you can definitely mix and match

play20:54

a lot of different lower weight to

play20:56

create very interesting looking images

play20:58

and there we have it folks now you can

play21:00

train any subject you want in only a few

play21:02

minutes with a very weak GPU all of that

play21:05

thanks to Laura and there you go thank

play21:07

you guys so much for watching don't

play21:09

forget to subscribe and smash the like

play21:10

button for the YouTube algorithm and

play21:12

I'll see you guys next time bye bye

Rate This

5.0 / 5 (0 votes)

関連タグ
AI TrainingGPU OptimizationDreamboothTextual InversionImage ProcessingCharacter CustomizationStable DiffusionKoya SS GUIEmbedding WeightsModel Mixing
英語で要約が必要ですか?