Save Hypernetwork strength to infotext.
Addresses #3825. Saves a generation's Hypernetwork strength to infotext (both PNG chunks/EXIF data and .txts). Also loads it with PNG info's "Send to..." tabs.
Also made it so infotext explicitly states when Hypernet is None. This unloads a Hypernet when a PNG Info with "Hypernet: None" is sent anywhere.
Also made it so infotext explicitly states when Hypernet is None. This unloads a Hypernet when a PNG Info with "Hypernet: None" is sent anywhere.
Cheekily, None.pt gets loaded if it exists in the hypernetworks folder. Thinking of the cleanest way to fix this.
I don't know; this one's got me stumped. FWIW, a file named None.pt also erroneously loads on master (when None is selected from the settings tab), so the issue isn't unique to this branch. I think I'll head to bed and think about it more in the morning.
Fixed it.
I don't want to always include Hypernet: xxx into infotext.
I don't want to always include Hypernet: xxx into infotext.
@AUTOMATIC1111 gotcha. Undid that part!
EDIT: Converting this to draft for now because it's failing to load the right hypernetwork reliably. EDIT 2: Even master isn't loading hypernetworks reliably at all anymore. Very erratic behavior. Will investigate further. EDIT 3: As late as d885a4a5, hypernets load normally from infotext. Four commits later, on 3c207ca6, the bug appears. (The commits between are difficult to test because of other errors.)
I don't want to always include Hypernet: xxx into infotext.
Wait, does this mean you intend for PNG Info to ignore Hypernet -- It'll no longer be saved to PNG Info entirely?
It should be included if it's used when making an image, and should not be included otherwise.
Okay, thank you for the clarification. This feature now works as intended (also thanks to 35c45df). Summary:
- When hypernet is None, no hypernet info is saved to infotext.
- When a hypernet is loaded, hypernet name AND strength saved to infotext.
- “PNG info” tab also loads hypernet strength (when present).
- A hypernet named "None.pt" no longer causes buggy behavior (as it currently does on master)