The word None which many txt metadata files contain as value for the GFPGAN field should not be considered to be a model name.
If the value is None, disable the checkbox
Also, force the properties to be in a consistent order so that, for example, LoRA strength will always be the line below LoRA model. I've rearranged the properties so that they are saved in the same order that the properties are laid out in the UI
* Add support for LoRA to dnd.js
Adds support for LoRA to dnd.js (task restoration, use settings, etc.).
* Correct extensions for LoRA
---------
Co-authored-by: cmdr2 <shashank.shekhar.global@gmail.com>
The Inpainting toggle doesn't get restored at the very first attempt.
Repro steps:
1. Create a task with a source image and enable the inpainting toggle.
2. Copy the task to the clipboard
3. Refresh the page (F5)
4. Paste the task from the clipboard
Expected result:
The task gets restored and the toggle is ON.
Actual result:
The task is restored, but the toggle is OFF.
To fix that, we have to restore the toggle's state after loading the source image.
Here is a more robust fix for task restoration in dnd.js. Task restoration will fail if the JSON contains "use_face_correction": false, which can happen under some circumstances.
The fix checks if the filename passed to getModelPath is actually a string, which covers both the previous scenario (filename === null) and this new one (filename === false).
In dnd.js, when models are restored in the UI, there is code that strips the path from the model file name. Now that we allow models to be hosted in subfolders, this code break the task restoration (e.g. use settings, D&D, copy/paste) because "/my models/model.ckpt" becomes "model.ckpt", which won't be found.
https://discord.com/channels/1014774730907209781/1014780368890630164/1063726724573052948
parseContent(text) doesn't check the text content being passed actually described a task, which causes some corner case scenarios to break (image task settings are incorrectly cleared because an empty image task is created).
Only triggers events when there actually was a state change. Also opportunistically removed the hardcoded delay in favor of an even-driven flow, which makes the whole thing more robust and much more reactive.