devilismyfriend / StableTuner

Finetuning SD in style.
GNU Affero General Public License v3.0
666 stars 51 forks source link

Proof of concept shuffle comma separated prompts #102

Closed allenbenz closed 1 year ago

allenbenz commented 1 year ago

This is a conversation starter and maybe should be thrown away.

Basic idea: prompt "A,B,C,D" can be permuted in the middle of training with an optional number of leading comma separated sections not getting permuted.

Anyways, labeled as a POC because there isn't a clear ideal way to do this, or at least this isn't it. Is this how you want this done? Or doing the shuffling against the actual text and recreating input_ids every time make more sense, or something else entirely?

I'm not familiar with pytorch so I suspect what I added can be optimized.

For danbooruy prompts this improved the dropout behavior of individual words, decreased overfitting of the sample prompt and makes order not matter. I didn't try this on more normal 1.4/1.5 prompts. I imagine it would do something similar.

What is not implemented and would be worth doing is partial prompt dropout, or at least I've seen that done with some of the other training tools.

So a technically working implementation of this with a bunch of asterisks:

allenbenz commented 1 year ago

Going to close this and eventually make another PR as this isn't enough. Notes for future me/anyone else: