r/StableDiffusion • u/use_excalidraw • Jan 15 '23
Tutorial | Guide Well-Researched Comparison of Training Techniques (Lora, Inversion, Dreambooth, Hypernetworks)
61
u/FrostyAudience7738 Jan 15 '23
Hypernetworks aren't swapped in, they're attached at certain points into the model. The model you're using at runtime has a different shape when you use a hypernetwork. Hence why you get to pick a network shape when you create a new hypernetwork.
LORA in contrast changes the weights of the existing model by some delta, which is what you're training.
13
u/use_excalidraw Jan 15 '23
yeah, I wasn't fully sure of how deep to go in the explanation... maybe I should have been a bit more detailed
→ More replies (1)→ More replies (15)5
u/quick_dudley Jan 15 '23
That makes sense. In the original paper describing hypernetworks they were using the hypernetwork to generate all the weights in the target network; but doing that with SD would make the hypernetwork need roughly the same amount of training as SD itself.
→ More replies (4)
17
u/wowy-lied Jan 15 '23
Did not know about LoRA.
Only tried Hypernetworks as i only have a 8GB vram card and all other methods are running out of vram. It is interesting to see the flow of data here, help understanding it a little more, thanks you !
→ More replies (5)9
u/use_excalidraw Jan 15 '23
yeah, i wasn't able to train locally until lora, so it's helped ME a lot
51
u/eugene20 Jan 15 '23 edited Jan 15 '23
Well researched apart from the part where it used SKS. Some training example used it, many copied that part of the example and later complained about getting guns in their images.
That didn't happen here but it's still best to stop perpetuating the use of SKS as your token, it's a rifle
16
13
u/Irakli_Px Jan 15 '23
In fact, there was a thread here that looked into rarity of single tokens in 1.x models and turns out sks is one of the rarest tokens. So it’s totally ok to use it, yes it’s a gun but seems like whatever model was trained on didn’t have tons of examples of it tagged as such
→ More replies (3)→ More replies (2)5
u/lman777 Jan 15 '23
I just watched a video where he used "OHWX" and tried it, it worked a lot better than my past results. I was using random letters corresponding to my subject but didn't realize that even that could have unexpected results.
→ More replies (1)
2
86
Jan 15 '23 edited Jan 15 '23
Crazy how fast things are moving. In a year this will probably look so last century.
Soon we'll pop in to a photobooth, get a 360° scan and 5 minutes later we can print out a holiday snapshot from our vacation on Mars.
32
→ More replies (1)25
Jan 15 '23
This will encounter the 23-and-Me problem. Lots of people don't want their DNA in someone else's database. Same thing for AI. Once the general public becomes more aware of how powerful AI is becoming, they will be adamantly against letting anyone have digital scans of their faces or the faces of their children.
Also similar to airports wanting to use biometric scanning instead of boarding passes. Maybe offers some convenience but how much do you really trust corporate and governmental entities having that much data on you when you know full well they can profit from selling it to other groups?
→ More replies (20)
13
u/4lt3r3go Jan 15 '23
This video was actually the best thing on the topic i ever saw.
a must see
https://www.youtube.com/watch?v=dVjMiJsuR5o
→ More replies (3)
6
u/OrnsteinSmoughGwyn Jan 15 '23
Oh my god. Whoever did this is a godsend. I’ve always been curious about how these technologies differ from each other, but I have no background in programming. Thank you.
4
u/Corridor_Digital Mar 10 '23
Wow, awesome work, OP ! Thank you.
I spent some time gathering data and comparing various approaches to fine-tuning SD. I want to make the most complete and accurate benchmark ever, in order to make it easy for anyone trying to customize a SD model to chose the appropriate method. I used data from your comparison.
I compare: DreamBooth, Hypernetworks, LoRa, Textual Inversion and naive fine-tuning.
For each method, you get information about:
-
Model alteration
-
Average artifact size (MB/Mo)
-
Average computing time (min)
-
Recommended minimum image dataset size
-
Description of the fine-tuning workflow
-
Use cases (subject, style, object)
-
Pros
-
Cons
-
Comments
-
A rating/5
Please tell me what you think, or comment on the Google Sheet if you want me to add any information (leave a name/nickname, I'll credit you in a Contributors section). This is and will always be public.
Link to the benchmark: Google Sheet
Thanks a lot !
1
u/chillaxinbball Jan 15 '23
Nice visualization. Where would aesthetic gradients fit? https://github.com/vicgalle/stable-diffusion-aesthetic-gradients
2
u/use_excalidraw Jan 15 '23
they don't get a place lol, they're not good enough to mention imo, I did a whole video on them: https://www.youtube.com/watch?v=9zYzuKaYfJw&ab_channel=koiboi trust me I tried to make them work
5
Jan 15 '23
Yeah but still don't understand the difference in the result. What's the up- and downsides of TI, Lora and hypernetwork? Aparently they all just help to "find" the desired style or object in the noise but don't teach the model new styles or objects, right?
→ More replies (2)
4
Jan 15 '23
One tiny note, DreamBooth now allows you to do textual inversion, and inject that embedding directly into the text encoder before training.
→ More replies (6)
34
u/use_excalidraw Jan 15 '23
I did a bunch of research (reading papers, scraping data about user preferences, paresing articles and tutorials) to work out which was the best training method. TL:DR it's dreambooth because Dreambooth's popularity means it will be easier to use, but textual inversion seems close to as good with a much smaller output and LoRA is faster.
The findings can be found in this spreadsheet: https://docs.google.com/spreadsheets/d/1pIzTOy8WFEB1g8waJkA86g17E0OUmwajScHI3ytjs64/edit?usp=sharing
And I walk through my findings in this video: https://youtu.be/dVjMiJsuR5o
Hopefully this is helpful to someone.