Save hypernetwork settings to a text file
Implements #3601 but for Hypernetworks. This, as with @patrickas's code, appends a new parameters block to settings.txt each time the training function is called.
A few improvements over #3601:
- ignores txt2img-tab-based settings when
preview_from_txt2img = False - strips values of colons (which would otherwise confuse settings.txt parsers down the line)
- heads each block with
initial_stepinstead ofdatetime. The latter is not only irrelevant to settings but somewhat redundant as well -- the enclosing folder is already named after the date anyway.
Interesting sidenote: saving initial_step hypothetically allows one to replicate the training of a model precisely as described by its settings.txt alone -- for each block, train with that block's settings until the next block's 'initial_step' is reached. (Of course, once you fork at a checkpoint, the trail of history is lost. If anyone has any solutions for this, let me know.)
If this is merged, I will look into writing load_settings_from_file.
✅Tested with "Read parameters (prompt, etc...) from txt2img tab when making previews" checked and unchecked. ✅Compatible with new training on old hypernetworks.