You should set the command line argument for each one of those folders like (--lora-dir, --embeddings-dir, etc.). Check the wiki for the command line arguments you must use.
Can't edit the original but here is a reupload. Keep in mind that this is a rather old post (before CivitAI and perhaps even before Dreambooth) so it's value has depreciated quicker than a used Ferrari.
I've been out of training since a few months back, almost since I made this post and for the time I played around with it, I stuck with these settings for the most part, so my experience is kinda limited.
My results were personally satisfactory so I kept the same guidelines for the most part but as a tip I can say that you should see these (or any other settings) as a starting point and work from there. Training involves a lot of trial and error because my goals and test subjects aren't the same as yours so the end result might not be achieved the same way. I mean, once you start training a few models you'll get a feeling for the amount of steps, class and instance images you'll need, etc. Google Colab is free (used to be at least), so it's quite easy to get into training and you'll be able to reach your own conclusions in no time.
I only used cosine scheduler a couple of times but don't recall seeing a perceptible difference from polynomial so I can't say it's better or worse. If other guides suggest it, give it a try, things might have evolved since then that it's now a better option.
I never captioned class images because they were generated by SD with the single token they represented so I didn't see the need for extra captioning. As for instance images, you might get better "promptability" if you caption them but it'll work without as well. My recommendation is to try a training with/without and see each one is more versatile in terms of prompting. I might be misremembering but I don't think Shivam's supports per image captions, you can leverage the multi concept list to achieve similar effect for instance, if you have a subject with multi angle photos like closeup, waist up, portrait, full body, etc. you can set up several concepts that hold these angles. If you are comfortable with python you might be able to hack something to read captions from a sidecar file for instance but I think LastBen's repo is able to do it.
Again this is something you'll see for yourself once you have a few training sessions under your belt but from my experiments, quality is rather important because the training will pick up the artifacts quite easily if they are present on the majority of the training set. If your generated tests don't resemble the training data it's usually a signal that it needs more steps, lowering the number of class images will reach the sweet spot sooner but the model might overfit too quickly or it might bleed into other subjects too much so it's a matter of balance. But you're right, if you're overfitting but your subject is represented on the tests (almost replicating the source images) you should try reducing step count. If the test subject is not visible on the tests but the training is somehow overfitting, lower the number of class images.
What I'm trying to say is that, no matter how many opinions I have about this and that, you should be the one to make your own and you'll be able to do it once you start tweaking some base values (these or someone else's).
Also, I found Lora training much faster and more convenient in terms of file size for pretty much anything other than general purpose models like you see on CivitAI or something where the details are very important like a person's facial features, that's mainly were Dreambooth is still unbeatable in my opinion. Stuff like art style, popular characters, clothing, etc. I would go for a Lora instead.
It looks like there is some problem with your OUTPUT_DIR, the error happens while trying to assign a WEIGHTS_DIR from the current session but it can't, I haven't got that error yet but it's probably because something went wrong earlier or you didn't run all the previous cells in order.
That step is only executed after the training session is completed and the diffusers folder is in place. It does the first thing I mentioned, it converts to a .ckpt file so that you can use it on the webui.
Like it says in the description, you should only enter something in the text field if you want to convert a previously trained model and know where the diffusers folder is.
Yeah I train the text encoder, it's one of the arguments on the accelerate function on the original post. Not sure what you mean with set values for it though...
Usually you'll only need to setup weight's dir's when you finish the training session and need to convert from diffusers folder structure into a ckpt file in order to load it on the web ui, this weight's dir is usually setup automatically.
The other case is when you want to do the opposite and want to use another ckpt file to do training over it, to do this you need to convert it to diffusers before training. If you setup the training model as an HuggingFace repo like "runwayml/Stable-Diffusion-v1-5" you probably don't (or shouldn't) need to enter a weight's dir because the diffusers will come from there instead.
Without knowing the error it's hard to troubleshoot your issue.
You can always consume the API, they are still working on it and I found a couple of bugs trying to get the upscalers but it's working fine for the most part and I'm sure that will be fixed soon. It's a great way to design your own gui. I'm doing that as a personal project to learn Blazor because I like the .Net environment but you can use other frontend frameworks like Angular or React.
However this means you'll end up with your own implementation and server to run alongside Auto's webui, so it's not really integrating into the original code but more of an external resource users could use as well. Deploying the code is also something that will probably require a bit of skill from the end user to set everything up unless you create and package a desktop app or something along those lines. For python there is PyQt for the gui and pyinstaller to pack it up into a nice executable.
You should have a field to set that up on the notebook you're using but if you can't find it try typing that in the --class_data_dir argument of the accelerate function, it's the last cell you run before training.
No need to mess with checkpoint files to display a simple thumbnail, a sidecar file with the same name as the model would suffice I guess, much like yaml configs and vaes already do.
The design looks clean and simple but Gradio isn't the most flexible and extensive of gui frameworks, you'll probably need to hack a lot to get those customized dropdown items, if it's even possible.
That's kinda what the number of vector tokens on Automatic's implementation of Textual Inversion does, the more tokens you assign to the embedding the better it will perform but it'll use up more tokens for a single embedding while prompting.
For Dreambooth, you can use captioned datasets to expand your token usage for the trained model, I guess that's similar. Instead of having a single instance prompt to train with, it trains on several prompts for their corresponding instance images; more or less how the multiple concept training works.
I see, thanks for the correction, was under the impression they were the same but that makes sense.
I run into issues while trying to train some textual inversions on Colab in the earlier days before Automatic's implementation, the initialization token had a checker to allow only a single token to be used, trying "lady" once didn't pass it and that's how I knew about the OpenAI tokenizer, perhaps the TI implementations were using it.
Interesting, "lady" is 2 tokens [75, 4597] but "Lady" is a single one [38887]. I wonder how impactful that is for inference. Makes it look like they are treated as two very distinct words but the token weights might be close enough in the end that it doesn't really matter.
Your datasets of regularization images look really useful too! Have you shared them here? I must have missed it but I'm glad I found them. Thanks mate.
Muito bom! These are the kinds of posts and discussions I look for the most in the sub. Even for someone not working in the field who needs only a superficial explanation of the processes there is still a lot of interesting information to be learned out there.
It doesn't entirely depend on the size of the word but more on it's usage in common English, for instance, "woman" is a single token but "lady" is composed of 2. You can use a tokenizer to check them, also available as an extension for Automatic's.
That's cool. Someone made an overall timeline for the AI's being released these couple of years, can't seem to find the link unfortunately but it was an interesting read as well. I think Emad retweeted that at some point so it might be easier to look for it there.
EDIT: Found it, Emad shares quite a lot of great stuff so this took a bit of scrolling but was able to spot it ahah.
Yeah seeds can have great influence on the general layout and color scheme of your outputs but in the end the token weights of the prompt will do most of the work (relative to cfg scale of course).
I love those nuggets of info that are shared here from time to time. We are experiencing the gold rush of AI generated imagery.
The class images amount is used per concept, if you set it at 100, every concept will use 100, no need to sum them up. Mind you this is for Shivam's implementation but I would guess others work the same way.
If you want to train multiple concepts with prior preservation, keep them within the same range of instance images, otherwise you could risk overfitting some and/or underfitting others due to inappropriate amount of class images they would train with.
For max number of steps I just use the total amount of instance images and multiply that to 80 to 100 times, however I've been running without class images lately, probably need to give it a few thousand more steps to accommodate them as well, not sure though.
Edit: I also haven't trained with more than one hundred or so instance images, so I usually just set the training to 10k, save at 1k intervals and see if it needs another session in the end or in case of overfitting I just use one of the previous states.
Thanks for the settings, I'll have to test them and see how they compare, I usually run with 1e-6 but since it's polynomial it runs at lower than that for most of the training, constant at that rate might be more predictable in the long run.
What about illustrations? Is it able to do something like this?
SFW https://civitai.com/images/111441972
You should set the command line argument for each one of those folders like (--lora-dir, --embeddings-dir, etc.). Check the wiki for the command line arguments you must use.
Can't edit the original but here is a reupload. Keep in mind that this is a rather old post (before CivitAI and perhaps even before Dreambooth) so it's value has depreciated quicker than a used Ferrari.
That's nothing, wait until I show you #6664201337GR3GRU7K0W5KY, it'll blow your gpu.
I've been out of training since a few months back, almost since I made this post and for the time I played around with it, I stuck with these settings for the most part, so my experience is kinda limited.
My results were personally satisfactory so I kept the same guidelines for the most part but as a tip I can say that you should see these (or any other settings) as a starting point and work from there. Training involves a lot of trial and error because my goals and test subjects aren't the same as yours so the end result might not be achieved the same way. I mean, once you start training a few models you'll get a feeling for the amount of steps, class and instance images you'll need, etc. Google Colab is free (used to be at least), so it's quite easy to get into training and you'll be able to reach your own conclusions in no time.
I only used cosine scheduler a couple of times but don't recall seeing a perceptible difference from polynomial so I can't say it's better or worse. If other guides suggest it, give it a try, things might have evolved since then that it's now a better option.
I never captioned class images because they were generated by SD with the single token they represented so I didn't see the need for extra captioning. As for instance images, you might get better "promptability" if you caption them but it'll work without as well. My recommendation is to try a training with/without and see each one is more versatile in terms of prompting. I might be misremembering but I don't think Shivam's supports per image captions, you can leverage the multi concept list to achieve similar effect for instance, if you have a subject with multi angle photos like closeup, waist up, portrait, full body, etc. you can set up several concepts that hold these angles. If you are comfortable with python you might be able to hack something to read captions from a sidecar file for instance but I think LastBen's repo is able to do it.
Again this is something you'll see for yourself once you have a few training sessions under your belt but from my experiments, quality is rather important because the training will pick up the artifacts quite easily if they are present on the majority of the training set. If your generated tests don't resemble the training data it's usually a signal that it needs more steps, lowering the number of class images will reach the sweet spot sooner but the model might overfit too quickly or it might bleed into other subjects too much so it's a matter of balance. But you're right, if you're overfitting but your subject is represented on the tests (almost replicating the source images) you should try reducing step count. If the test subject is not visible on the tests but the training is somehow overfitting, lower the number of class images.
What I'm trying to say is that, no matter how many opinions I have about this and that, you should be the one to make your own and you'll be able to do it once you start tweaking some base values (these or someone else's).
Also, I found Lora training much faster and more convenient in terms of file size for pretty much anything other than general purpose models like you see on CivitAI or something where the details are very important like a person's facial features, that's mainly were Dreambooth is still unbeatable in my opinion. Stuff like art style, popular characters, clothing, etc. I would go for a Lora instead.
Here is an ancient post that you might enjoy.
It's from a time before dreambooth, model merging and novelai's leak, the only models we had to play with were sd1.4, waifu diffusion and trinart.
It looks like there is some problem with your OUTPUT_DIR, the error happens while trying to assign a WEIGHTS_DIR from the current session but it can't, I haven't got that error yet but it's probably because something went wrong earlier or you didn't run all the previous cells in order.
That step is only executed after the training session is completed and the diffusers folder is in place. It does the first thing I mentioned, it converts to a .ckpt file so that you can use it on the webui.
Like it says in the description, you should only enter something in the text field if you want to convert a previously trained model and know where the diffusers folder is.
Yeah I train the text encoder, it's one of the arguments on the accelerate function on the original post. Not sure what you mean with set values for it though...
Which notebook you are using?
Usually you'll only need to setup weight's dir's when you finish the training session and need to convert from diffusers folder structure into a ckpt file in order to load it on the web ui, this weight's dir is usually setup automatically.
The other case is when you want to do the opposite and want to use another ckpt file to do training over it, to do this you need to convert it to diffusers before training. If you setup the training model as an HuggingFace repo like "runwayml/Stable-Diffusion-v1-5" you probably don't (or shouldn't) need to enter a weight's dir because the diffusers will come from there instead.
Without knowing the error it's hard to troubleshoot your issue.
On the model database but here is the direct link to it.
You can always consume the API, they are still working on it and I found a couple of bugs trying to get the upscalers but it's working fine for the most part and I'm sure that will be fixed soon. It's a great way to design your own gui. I'm doing that as a personal project to learn Blazor because I like the .Net environment but you can use other frontend frameworks like Angular or React.
However this means you'll end up with your own implementation and server to run alongside Auto's webui, so it's not really integrating into the original code but more of an external resource users could use as well. Deploying the code is also something that will probably require a bit of skill from the end user to set everything up unless you create and package a desktop app or something along those lines. For python there is PyQt for the gui and pyinstaller to pack it up into a nice executable.
You should have a field to set that up on the notebook you're using but if you can't find it try typing that in the --class_data_dir argument of the accelerate function, it's the last cell you run before training.
No need to mess with checkpoint files to display a simple thumbnail, a sidecar file with the same name as the model would suffice I guess, much like yaml configs and vaes already do.
The design looks clean and simple but Gradio isn't the most flexible and extensive of gui frameworks, you'll probably need to hack a lot to get those customized dropdown items, if it's even possible.
That's kinda what the number of vector tokens on Automatic's implementation of Textual Inversion does, the more tokens you assign to the embedding the better it will perform but it'll use up more tokens for a single embedding while prompting.
For Dreambooth, you can use captioned datasets to expand your token usage for the trained model, I guess that's similar. Instead of having a single instance prompt to train with, it trains on several prompts for their corresponding instance images; more or less how the multiple concept training works.
I see, thanks for the correction, was under the impression they were the same but that makes sense.
I run into issues while trying to train some textual inversions on Colab in the earlier days before Automatic's implementation, the initialization token had a checker to allow only a single token to be used, trying "lady" once didn't pass it and that's how I knew about the OpenAI tokenizer, perhaps the TI implementations were using it.
Interesting, "lady" is 2 tokens [75, 4597] but "Lady" is a single one [38887]. I wonder how impactful that is for inference. Makes it look like they are treated as two very distinct words but the token weights might be close enough in the end that it doesn't really matter.
Your datasets of regularization images look really useful too! Have you shared them here? I must have missed it but I'm glad I found them. Thanks mate.
Muito bom! These are the kinds of posts and discussions I look for the most in the sub. Even for someone not working in the field who needs only a superficial explanation of the processes there is still a lot of interesting information to be learned out there.
It doesn't entirely depend on the size of the word but more on it's usage in common English, for instance, "woman" is a single token but "lady" is composed of 2. You can use a tokenizer to check them, also available as an extension for Automatic's.
That's cool. Someone made an overall timeline for the AI's being released these couple of years, can't seem to find the link unfortunately but it was an interesting read as well. I think Emad retweeted that at some point so it might be easier to look for it there.
EDIT: Found it, Emad shares quite a lot of great stuff so this took a bit of scrolling but was able to spot it ahah.
Lorn is awesome and so is the video but this is actually a repost, I don't mind though, it's always great to watch it again.
Yeah seeds can have great influence on the general layout and color scheme of your outputs but in the end the token weights of the prompt will do most of the work (relative to cfg scale of course).
I love those nuggets of info that are shared here from time to time. We are experiencing the gold rush of AI generated imagery.
Even empty prompts will generate output, the base seed essentially. It's a nice way to find good ones.
The class images amount is used per concept, if you set it at 100, every concept will use 100, no need to sum them up. Mind you this is for Shivam's implementation but I would guess others work the same way.
If you want to train multiple concepts with prior preservation, keep them within the same range of instance images, otherwise you could risk overfitting some and/or underfitting others due to inappropriate amount of class images they would train with.
For max number of steps I just use the total amount of instance images and multiply that to 80 to 100 times, however I've been running without class images lately, probably need to give it a few thousand more steps to accommodate them as well, not sure though.
Edit: I also haven't trained with more than one hundred or so instance images, so I usually just set the training to 10k, save at 1k intervals and see if it needs another session in the end or in case of overfitting I just use one of the previous states.
Thanks for the settings, I'll have to test them and see how they compare, I usually run with 1e-6 but since it's polynomial it runs at lower than that for most of the training, constant at that rate might be more predictable in the long run.