stable-diffusion-webui icon indicating copy to clipboard operation
stable-diffusion-webui copied to clipboard

Save the textual inversion settings to a text file

Open patrickas opened this issue 3 years ago • 3 comments

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...

patrickas avatar Oct 24 '22 22:10 patrickas

Seems to address #3352.

timntorres avatar Oct 25 '22 01:10 timntorres

Thanks for this, @patrickas. I wrote a version for Hypernet and came across a few changes you might want to consider:

  1. If preview_from_txt2img = False, ignore the txt2img-related settings.
  2. Strip values of colons.
  3. Head each block with initial_step instead of datetime.
  4. Save settings only after the train function verifiesinitial_step is less than final step.

For more details please see my PR. Thank you again.

timntorres avatar Oct 26 '22 21:10 timntorres

@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...

  1. If preview_from_txt2img = False, ignore the txt2img-related settings. Makes sense, I will look into adding this.
  1. 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.
  1. Head each block with initial_step instead of datetime. 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.
  1. Save settings only after the train function verifiesinitial_step is less than final step. Makes sense.

patrickas avatar Oct 26 '22 23:10 patrickas

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.

AUTOMATIC1111 avatar Jan 04 '23 15:01 AUTOMATIC1111