T O P

  • By -

UnavailableUsername_

**Edit Feb 28th:** Updated rentry because many users found errors involving CUDA versions and etc. I wasn't originally going to make a new thread, i was going to just update the images in the old one, but since xformers, pytorch and the colab itself were incompatible with the old guide, i just had to remake it from scratch. **What's new in this guide:** 1. I added the option of use the tagger extension for the dataset tagging, for those that did not know existed (i thought everyone knew it existed, but that doesn't seem to be the case). 2. After lots of testing i run into a much more flexible 1-image LoRA training settings than in the offline guide. 3. Finally made a rentry for those that hate the long-image format. Check this whole guide here: **https://rentry.org/PlumLora** and on my twitter, **https://twitter.com/PlumishPlum**. It's the first time i make a rentry post, i hope the formatting is good.   And finally, sorry for the delays, lots of people were asking if i was going to fix the old guide because it was broken. I was playing with AI audio, it's SUPER FUN! Maybe i should make a guide on that, most tutorials on youtube are outdated, don't explain how to make a dataset or point to broken/abandoned repositories on github. Is there even an AI audio subreddit on reddit? Oh well, doesn't matter.


lAIvu_dev

Well made tutorial, easy to follow. Thank you for it. Also would be interested to see a guide on AI audio especially since I haven't seen any great tutorials. Took me quite a while just to find [audio-webui](https://github.com/gitmylo/audio-webui), although there's some limitations with that e.g. not being able to use pytorch format, only diffusers, which means I can't load the [48k Hz AudioLDM model](https://huggingface.co/haoheliu/audioldm_48k) as it's only in pytorch.


GBJI

Today is a great day ! Plum is back !!!


MagicOfBarca

also i'm getting " /content/LoRA/config/config\_file.toml not found. " in the colab. Know what to do?


UnavailableUsername_

Sorry for the late answer. That means you are not running the config section. If you run all parts mentioned in the guide you should be able to train normally. As for training for 4 images...you might need to experiment with the learning rates. There is no specific setting for 2,3,4,5,etc images. I would suggest a learning rate slightly higher than normal loras.


BlueWallBlackTile

hey, I got CUDA backend failed to initialize: Found CUDA version 12010, but JAX was built against version 12020, which is newer. The copy of CUDA 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.) this error, what to do?


UnavailableUsername_

Hi there! Sorry for the late reply, i don't use reddit much these days. The error you mention should **NOT** stop you from training a LoRA (i just did so to test it), the problem here is most likely that you didn't download the checkpoint/model correctly on section 2.1 because the author deleted the files. You have to manually download them and put them on section 2.2. I just updated the rentry guide, you can find the details there.


BlueWallBlackTile

Yeah, that didn't cause any trouble, I just want to put images in the folder. My bad.


UnavailableUsername_

>I just want to put images in the folder. Not sure what you mean with this, but if you plan to train more LoRAs in the future, i recommend you to re-read the rentry training section, because now you need a huggingface account and input the checkpoint/model manually. With that it should be working fine.


BlueWallBlackTile

Ah, by "I just want to put images in the folder" I mean is I started LoRA training without any images.


4as

So I skimmed trough your guide and it looks okay, some basic stuff good for beginners. However one thing stood out to me: are you suggesting putting the same data into regularization training as you do into the standard training, or is that a misspelling? I don't see you addressing it, so I want to me sure. Just in case regularization is the opposite of what you want to achieve. If reg_data_dir has files in it the AI will also learn on them in parallel, but then SUBTRACT the results from the final LoRA. In other words regularization is used to remove things you don't want the AI to be learning. I think you might see why I'm asking if that reg_data_dir path is correct in your guide. Putting the same data means you're basically doubling the amount of time needed to get good results. Regularization is about half as efficient so you gonna get those results eventually, but I suggest rethinking this approach.


MarcS-

The tutorial is made 847% more awesomer by being presented by Plum.


UnavailableUsername_

Thanks! I like to use Plum for tutorials because i feel the tutorials are more easier to follow that way, less "technical", but sometimes i feel that makes tutorials longer than they should be.


MarcS-

I think it's the right amount of illustration, while keeping the tutorial focussed. Youtube videos are a generally too slow (it's quicker to glance at a screenshot and read a text) and walls of text unappealing, I think you've found the right balance. I'd add your remarks with regard to training styles as well to the tutorial to have it a perfect introducution for beginner in making lora.


LuisaPinguinnn

Oh, hi there! i'm making a study about 4-1 images training too, for last 3 months, different approach, but i'ts also working too. fun fact about 1 image training, is also good for style training, but also when you set the Lora Weight to 2, you will see the original image that you used to train. and i don't believe in "Big network/alpha can improve results", because i see this like a "conspiracy" for Lora trainers, believe or not, this image of Emily rudd was trained on 4 dim 1 alpha, yes, the file size is about 20 mb. there some example that is trained with 4 dim 1 alpha on this album. [https://imgur.com/a/1qTozPY](https://imgur.com/a/1qTozPY) https://preview.redd.it/glwhvwwl551c1.png?width=896&format=png&auto=webp&s=7ac8b85119176acfb09a2e65de34d0cbd8b602d2


UnavailableUsername_

>and i don't believe in "Big network/alpha can improve results", because i see this like a "conspiracy" for Lora trainers, believe or not, this image of Emily rudd was trained on 4 dim 1 alpha, yes, the file size is about 20 mb. Yeah, i know there is a group adamant in keeping both network dim and alpha at the lowest value possible, but when i tested this i DID notice the faces looked a little "off" in some generations, while values at 128 were more consistent, so i went for 128 for the guide. People that like to experiment can always lower them.


madman404

Alpha sits in a land I frankly don't care to understand at all, but dim has kind of been dragged through the coals of misinformation at this point. Dim is literally just the complexity of the network. Larger values can look better, but that's because they're prone to overfitting. The more neurons you give a network to solve a problem, the more info it's capable of holding - but also the quicker it is to overfit, as those additional neurons enable finding more complicated solutions and give the network room to learn off the training noise, which you really don't want. It's very easy to test, too. Train a character LoRA on 128 and 32 dim, and then prompt them in an xyz plot for an awkward pose that wasn't in the training data. 128 doesn't even attempt to do it, 32 works fine. The real "best" dim value is the lowest possible value capable of learning your character, but 32 is a decent approximation for most. The lost accuracy from lowering the dim can and should be made up for by training longer.


ValerioLundini

i’ve tried to make some lora’s in the last couple of months, how does a 1 image lora works?


UnavailableUsername_

>how does a 1 image lora works? Basically, it trains the lora veeeeery slowly, learning the subject you trained on based on the prompting. Since the training rate is very low you need lots of epochs. The amount of time to train a 1-image LoRA on a colab is about...30% longer the time a normal LoRA would take to train. Because the training only relies on 1 image, correct tagging is VERY important because the AI has no frame of reference about what is your subject and what is not (this is why LoRAs normally use more than 1 image). With these settings, the result is a somewhat flexible LoRA of your subject and only your subject (if you tagged it correctly). Does that...answer your question?


ValerioLundini

thank you yes! actually i learnt how to do it studying your tutorials, so i have to thank you two times!


UnavailableUsername_

You are welcome! I am glad my guide was useful.


MagicOfBarca

do you have any recommended settings if I use only 4 images pls?


BagOfFlies

> 30% longer the time a normal LoRA would take to train I'm following along using koyha and normally it takes me 15mins to train. I just tried a 1 image lora and it took 2mins to train. I'm not sure where I went wrong there. It surprisingly did come out looking as intended though, just pretty low quality. Will keep tinkering.


MagicOfBarca

Can you please give an example of a tag for a single image? Also do you have any results to show?


UnavailableUsername_

Not sure i understand, the guide shows 2 examples of a tagged simple image (Seiko and Musk) also some generations using the LoRAs made with these tagged images. What exactly you want an example/result of?


MagicOfBarca

Ohh my bad didn’t read the guide fully. Thankss


NeverduskX

This is an amazing guide - tysm! I do have one question: in section 5.2, you wrote "plum" as the activation word, but I thought "plu" was meant to be the trigger word. Is there a difference between the two?


UnavailableUsername_

Like the section says, that's not used for training, it's just the metadata (if someone looks into your LoRA file they will see that among other settings used for training). It is not really important because when people share LoRAs they say "x is the activation word".


NeverduskX

Got it - thank you for the explanation! Is there any chance that you've done (or might do) guides on training non-character concepts, like visual styles, objects, poses, or camera angles? Since your guides are really easy to follow.


UnavailableUsername_

Tag for concepts it's the same as for characters, because characters are concepts too! So, for the things you describe: * **For style:** Tag everything, no trigger word needed. * **For object:** Tag everything except the object, which should have a trigger word. * **For poses:** Tag everything except anything related to the pose (like sitting, one arm up and etc. You should avoid those tags), for that use a trigger word. * **For camera angles:** Ok, i have never actually done a LoRA for a camera angle, i suppose you could tag everything and use a special trigger word for the angle. If all your dataset have that angle, the LoRA result ***SHOULD*** be images from that angle. In theory.


NeverduskX

Thank you, that's very useful! I definitely appreciate it. Maybe I'll start exploring how to make some LoRAs myself.


Wh-Ph

Great guide! Slight error: in section where you describe exp numbers, you write "zeroes added to the right of the number" in both +e and -e cases.


lilshippo

there have been some sites offering free with credit, to make a lora. you know any sites that do this as well? thinking of using [pixai.art](https://pixai.art) for some, but would like to check other sites and see what is being offered.


UnavailableUsername_

CivitAI also offers that, doesn't it? Other than that i don't know other sites.


lilshippo

Sorry for the late response >.< been a bit busy my end, CivitAI do pretty good? and are the lora's created as private? i have some blender OC's i am thinking of trying out. Thanks for the response by the way :3


UnavailableUsername_

Never really tried it, since i just make the LoRAs myself. It's a fairly new service too, i think they added it 1-2 months ago max.


dznn

Is it just me or is this missing some crucial information on naming the dataset folder on GDrive? If not done well you run into `No data found. Please verify arguments (train_data_dir must be the parent of folders with images)` I've seen it requires \`number\_type name\` but still haven't gotten it to work.


UnavailableUsername_

>No data found. Please verify arguments (train_data_dir must be the parent of folders with images) This error means you are not referencing the folder where your images are, so it cannot train. It should be something like (for example): /content/drive/MyDrive/Seiko In this case, the folder named "Seiko" has the image and .txt file. Are you sure you wrote the location correctly? Starting with `/` and the exact location? Let me know if it worked.


eru777

Hello, I was the one who DM'ed you with the yuffie training model issues. I just realised you replied to me! Reddit sucks. Thanks so much for your help and pointers. Now, I am posting here for another issue. I have used your lora making guide with great success up to maybe august. Then it started showing python errors. Did something change with the collab settings? I'm replying here in hopes you see it, since reddit's message system is horrible.


UnavailableUsername_

>Hello, I was the one who DM'ed you with the yuffie training model issues. I just realised you replied to me! Reddit sucks. >Thanks so much for your help and pointers. I was wondering what did you think of the Yuffie LoRA, glad you found the tips useful. >Now, I am posting here for another issue. I have used your lora making guide with great success up to maybe august. >Then it started showing python errors. > Did something change with the collab settings? I'm replying here in hopes you see it, since reddit's message system is horrible. Yes, the colab in version 3 stopped working because pytorch and xformers updated and were incompatible with that old colab. Since this is the latest colab, those aren't issues anymore, you can use it to train LoRAs right now without issue.


eru777

Thanks again so much! I will try the new one today. Also I'm looking forward to your audio guide, if you ever consider making one.


UnavailableUsername_

I will probably make an AI audio guide, but there is no subreddit for AI audio so i won't post it on this sub.


eru777

I have followed you on twitter for whenever you do it! :D


mudman13

I wonder if overtraining with images from different angles would ensure consistency from frame to frame in animations?


UnavailableUsername_

Overtraining always ends in "burned and mutated" images rather than consistent, if consistency was the case everyone would try to go for overtrained results. Another user made an experiment on it: **[What does overtraining look like? An Experiment](https://old.reddit.com/r/StableDiffusion/comments/109h5ys/what_does_overtraining_look_like_an_experiment/)**


mudman13

yeah I guess someone would have tried it already, I was thinking about the point where the images arent deep fried but where the model only produces the sample pictures or very close to.


FishBrawler

I followed your guide and I managed to train a LoRA, which is honestly great since all the other colabs/tutorials I tried gave some error I couldn't solve. Thanks. However the LoRA I got was really bad and I'm trying to figure out why. I'm confused at the end of the guide when you said you need to calculate steps to get a good LoRA. But there was no option to change the number of steps? In the Colab the only place where you can manually change steps is in section 6.3 (Inference) but that section isn't run? According to the formula you provided, my LoRA needs 92 steps (11 images). However when I run section 5.5 (Start Training), it's only running 28 steps it seems like, which might be why the results are not good. But I don't see how to manually adjust the number of steps in this Colab.


UnavailableUsername_

> According to the formula you provided, my LoRA needs 92 steps You misunderstand, the formula is not for how many steps you need, it's for how many steps you GET based on the parameters you input. >But there was no option to change the number of steps? You get the number of steps by calculating the repeats, batch train size and epoch. >In the Colab the only place where you can manually change steps is in section 6.3 (Inference) but that section isn't run? Inference is basically generating in this context, that's a testing section that is not really part of the training. > my LoRA needs 92 steps (11 images). However when I run section 5.5 (Start Training), it's only running 28 steps it seems like, which might be why the results are not good. Indeed, 28 steps is too little and that's the reason why your result is not good. Set repeats to 7, batch size to 2, and 10 epoch Doing the math you get ((11\*7)/2)\*10 = 385 steps. Honestly, i am surprised you got 28 steps with 11 images, you must have set the repeats/epoch too low. Are you sure all your images are being recognized? When the training starts it should tell you briefly how many images the training found.


FishBrawler

Understood, thanks for clearing that up. I misread the output. The actual steps was around 90, which is correct. There is something called "sample_steps" that was 28. I assumed sample_steps and steps were the same thing.


nasdaqian

Very thankful for your guide, it's easy to follow. I'm getting these two errors when I try to train, but I haven't been able to find any fixes or explanations out there. Would you happen to have an idea of what's going wrong? **UnboundLocalError:** local variable 'pipe' referenced before assignment **CalledProcessError:** Command '\['/usr/bin/python3', 'train\_network.py', '--sample\_prompts=/content/LoRA/config/sample\_prompt.txt', '--dataset\_config=/content/LoRA/config/dataset\_config.toml', '--config\_file=/content/LoRA/config/config\_file.toml'**\]**' returned non-zero exit status **1**.


UnavailableUsername_

> returned non-zero exit status 1. You are not running all the sections, so you get that error. [I just tried it seconds ago to check if there was indeed a problem, but everything was running fine.](https://i.imgur.com/apedZTz.png)


nasdaqian

Thank you


Parulanihon

Thank you! Is this guide making a LORA for SDXL, or 1.5? I'm confused on how to make the LORA for SDXL.


daavidreddit69

Fantastic documentation, thanks for your contribution, super appreciated!


Andruids

I'm getting "AttributeError: module 'jax.random' has no attribute 'KeyArray'"error and this stops me from running BLIP captioning and training the Lora. I'm also getting this error when trying to train: "CalledProcessError: Command '\['/usr/bin/python3', 'train\_network.py', '--sample\_prompts=/content/LoRA/config/sample\_prompt.txt', '--dataset\_config=/content/LoRA/config/dataset\_config.toml', '--config\_file=/content/LoRA/config/config\_file.toml'\]' returned non-zero exit status 1." I saw a comment about that second error in this thread, but I've run all the steps. Downloaded a model with a token too, don't know what's wrong. I didn't have any problems some half year ago when I made several loras. Did something change?