Save the textual inversion settings to a text file
I have a dozen of textual inversion embeddings created to know which is the best combination of settings and I keep forgetting which one is which. This change saves all the settings made when creating an embedding in the log folder. It becomes easy to go back and see the learnings rate... The number of vectors per token , the number of training images for each embedding...
Seems to address #3352.
Thanks for this, @patrickas. I wrote a version for Hypernet and came across a few changes you might want to consider:
- If
preview_from_txt2img = False, ignore the txt2img-related settings. - Strip values of colons.
- Head each block with
initial_stepinstead ofdatetime. - Save settings only after the train function verifies
initial_stepis less than final step.
For more details please see my PR. Thank you again.
@timntorres Thanks for yourremarks, I will look into fixing this patch with your comments if there is any indication that there is interest in merging it...
- If
preview_from_txt2img = False, ignore the txt2img-related settings. Makes sense, I will look into adding this.
- Strip values of colons. This is not necessary, unless the parser is broken. You just do line.split(":" , 2) and it takes the name and value correctly no matter how many colons there are in the value. We will need to remove newlines though if you are thinking about writing a parser for this.
- Head each block with
initial_stepinstead ofdatetime. Makes sense to have the intitial_step I will add it, the datetime is useful for me and does not do any harm, so I think better to keep it.
- Save settings only after the train function verifies
initial_stepis less than final step. Makes sense.
Why is eval there?
This should be optional and off by default.
I would very much prefer if the implementation didn't list the same long list 3 times.
If there is more activity here, reopen the PR.