While the line `return scripts.AlwaysVisible if is_img2img else False` correctly makes the script always visible in the img2img tab, for some reason A1111 is not using the script. This requires further investigation and troubleshooting, however, the other features of this script patch is ready for use. So the AlwaysVisible feature is being rolled back while the other features are kept.
UI Changes:
- Made extension always visible on the img2img tab. This will allow for other scripts to be run alongside extension.
- Added triggers to determine if the script should run. Triggers are if a model is selected or if an image is present.
- Removed "Deepbooru (Native)" from being the default model, so that script is not active by default.
- Set `clip_api_mode` to "best" to better align with 'clip-interrogator-ext' defaults
Optimizations:
- Library declarations needed to be organized and cleaned of repetition.
- Script will no longer run if there is no image to interrogate, (I think that img2img probably should not run if there is no images anyways...)
The more I thought about unloading models after they are used, the more I liked it.
Anyways, my reasoning is that many systems might need the VRAM that the model uses up for the generation of their image. So it would be better to unload the WD model when it is not in use. CLIP model needs to be unloaded from the CLIP interrogator tab.
New API Interaction Suite:
-Added API awareness.
-Added Interaction Hooks for:
-CLIP Interrogator Ext ('clip-interrogator-ext')
-WD14 Tagger ('stable-diffusion-webui-wd14-tagger')
UI Overhaul:
-Clutter Cleanup, now unused options and sliders are hidden
-Changed the `up_front` checkbox to a radio.
-Created dynamically visible options accordion for:
-CLIP Interrogator Ext
-WD14 Tagger
-Users that do not have the API interrogators will not see the option to use them in the `model_selector`.
Bug Fixes:
-Replaced the backward slashes `\` with forward slashes `/` for better OS compatibility.
-Fixed some typos in the comments
Allows users to filter out content from the interrogation without having to put it in the prompt or negative prompt. This also allows users to reuse their custom filters from a previous run, allowing users to keep their filters through different sessions.
There are also some UI cleanup items. Such as moving the model select dropdown to the top of the UI, instead of being at the bottom. Changed "Deepbooru Tools" to "Filtering Tools" since it is being applied to CLIP too. I also changed my user name.
Enables script to run both of the natively supported interrogation models. Deepbooru and CLIP can now be run sequentially. The dropdown menu allows users to determine the order of interrogation models.
The default for interrogation model is set to Deepbooru, to maintain original operation.
Two new toggles to filter prompt content from interrogator prompt output.
1. Negative prompt content filtered from the interrogator prompt output (Removes contradictions from the prompt)
2. Prompt content filtered from the interrogator prompt output (Removes duplicates from the prompt)
Additional housekeeping change, Script.interrogator changed to interrogator, as Script.interrogator no longer exists.
Added a toggle to enable or disable the prompt weighting. Prompt weighting is enabled by default, which is the vanilla behavior.
I found that prompt weighting sometimes caused problems and thought that it would be nice if users could choose whether interrogator prompts were weighted or not.