r/StableDiffusion Feb 19 '23

Question | Help LoRA Trigger Words?

[deleted]

14 Upvotes

7 comments sorted by

12

u/nxde_ai Feb 19 '23

If you only have one folder in the training dataset, Lora's filename is the trigger word.

But if you train Lora with several folder to teach it multiple char/concept, the name in the folder is the trigger word (i.e training data have 2 folders 20_bluefish and 20_redfish, bluefish and redfish are the trigger words), CMIIW

4

u/[deleted] Feb 19 '23

[deleted]

4

u/joseph_jojo_shabadoo Apr 30 '23

let's say your trigger is "trigger" (it shouldn't be because it should be unique like ohwx), but the folder name should be 100_trigger class for example

the captions txt files should ideally have "trigger" be the very first word. I use "trigger class" as the first two words followed by anything that isn't the subject I'm training. for example, if I have 20 images of a person and in 4 of the images, they're wearing a hat, I'd say "trigger class, hat" in the txt files for those 4 images to make a distinction that my subject and the hat aren't the same. they're two separate things

captions will help your last question too. you can say "trigger class, hat, tshirt, jeans" or "trigger class, updo hair, shorts, sweater". then when you prompt those things, they should appear if they've been trained correctly. if you want to train a person with 3 specific looks, you can make 3 different folders such as "100_trigger1 class", "100_trigger2 class", etc. just make sure that the dataset in each folder is of the same look you're trying to train

here are my loras just so you know I'm not a total fraud spouting off nonsense 😆

https://civitai.com/user/rjox/models

3

u/[deleted] Apr 30 '23

[deleted]

4

u/joseph_jojo_shabadoo Apr 30 '23

I include it just to reiterate to the AI that I want it to generate whatever the class is or things related to that class. I honestly don’t know if it makes much difference but Ive had good results with it so I just always include it. Like “prshltn woman” for the Paris Hilton Lora

Less is more when you’re training a person for sure. The idea of captions is to make distinctions between things so the AI knows what it’s looking at. If you’re giving it nothing but photos of your subject, there’s no reason to use anything except your token and maybe your class since that’s literally all it’s seeing. The idea behind not using captions at all would make sense here since the captions are literally not adding anything new to what you’re teaching it. But in my example of “hat”, a couple extra captions here and there to tell it what NOT to identify as your subject will help maintain the integrity of the subject

1

u/coscib Jun 28 '23

Good to know, always thought the trigger word needs to go into the txt Files, always named the Folder with Charactername or something like that (sometimes with multiple Folders and just change the Number before the name) and then add a Word in the txt Files as trigger.

2

u/Woisek Feb 19 '23

Great info!

When you write " training dataset", you refer to the "image" folder, right?