Train multiple subjects in the same model
Opened this issue · 3 comments
Having the ability to train multiple subjects within the same model can be quite useful if you're using your model to create stories with multiple people and such.
As of now, the subject within the model is being triggered by one specific prompt that you type into the script.
But what if you gave the option to either set a specific trigger prompt (the current behavior) or use the image's filename as a prompt. For instance if you got a series of images called bob(0).png, bob(1).png, bob(2).png and so on, then those images will be trained to the trigger prompt "bob". Then you add a series of images of steve(0).png, steve(1).png, steve(2).png etc... Now you got 2 trigger prompts within the same model (bob and steve).
Would this be doable?
If this can be done, I think that'd make a great addition to the script.
is there any script providing multiple subjects in the same model, please share me the reference if any , Thank you
This one: https://github.com/TheLastBen/fast-stable-diffusion
You name your subjects like this "character1(0).png, character1(1).png, character1(2).png, character2(0).png, character2(1).png, character2(2).png", where the name of the image becomes the trigger prompt.
I've found a couple more that does this, but they're kinda half-ass at it and tend to just blend the characters together. This one does it right though.
This LoRA trainer also does a decent job with text files for each image specifying the characters / subjects:
https://github.com/hollowstrawberry/kohya-colab/blob/main/Lora_Trainer.ipynb
yall don't just copy/paste the concept .json code and fill in the blanks? That's what I do... I've trained 5 concepts on one ckpt before. only thing tht sucks is it takes forever for caching latents and if you're doing 1000 class img per 10 instance than you're going to be sitting a long time. and maybe running out of room in colab, which you can fix by just direct linking to your google drive paths, but, either way, you CAN train multiple concepts, just copy/paste the code that's there 3 or 4 times. You can't stop training early, or use early saves of it, because you'll be missing info since it'll have trained one concept more than the others-- so they all need the same amount of images, the same prompting, the same quality of images, and you gotta put your steps in multiples of however many class photos you have. for instance: if I have 4 concepts with 1000 class img each, I'm training the model in batches of 4000. After 4000, they're about even, and usually I'll have to go to 8000 steps with the learning rate turned way down so it doesn't overfit. but they come out really really nice. i have colab pro, as well as a 3090 that I use when I'm out of monthly compute units, tho, so, depending on your setup, it may not be a viable way to do things. but thought i'd share what works for me either way. cheers.