Commit Graph

39 Commits (909122682fa479dbf4d363f7eae91c2eccff8601)

Author SHA1 Message Date
Smirking Kitsune ec9ec7689c
Removed Excessive Attention Syntax
Removed excessive attention syntax that was mistakenly introduced.
2024-07-23 22:06:49 -06:00
Smirking Kitsune 7697954079
Trailing Commas Fix
Fixes trailing commas, and minor organization of how the final interrogation is processed and handled.
2024-07-15 16:48:52 -06:00
Smirking Kitsune 6b8d65c8db
Concatination Fix
Concatenation was concurring without a separator comma. This fixes that.
2024-07-15 16:23:25 -06:00
Smirking Kitsune 56f128ece8
Syntax Correction
There was a stray parenthesis on line 392 that caused premature termination of script, by error.
2024-07-06 06:56:37 -07:00
Smirking Kitsune 50bcbb8868
Refresh Model Selection Selector
Adds a button to refresh model_selection selector.
2024-07-06 06:48:55 -07:00
Smirking Kitsune edec8720f1
Bug Fixes
- Pruned some emojis from experimental tool `no_punctuation_mode`.
 - Changed the save button to red, to highlight the destructive capabilities of overwriting a file.
 - Changed all `custom_filter` read/write functions to encode in `utf-8`
 - Added print statements for finding and hooking to extensions.
2024-07-06 06:35:00 -07:00
Smirking Kitsune 6395a823be
AlwaysVisible and Experimental (Fun) Tools
**BASED ON PULL REQUEST #10**

Converted Script for AlwaysVisible Use.
 - Changed to `process_batch` method.
    - This should run even if only one image is in queue.
 - Implemented a prompt cleaner for batch job p.prompt contamination. 
    - It resets when `job_no` is less than or equal to 0, as the start of a batch job is uncontaminated.
 - Disabled all settings, to ensure user can operate without script, without needing to disable script, if they choose to
    - Script requires user to select a model to ensure script runs during img2img job.
    - `prompt_weight` is no longer on by default.

Experimental Tools:
 - Implemented a verbose development mode, to output to console debugging prints
 - Moved the `prompt_weight` into the experimental tools section.
 - Implemented a tool to remove all punctuation from prompt, except for commas, `'s`, `...`. and a variety of emojis as `no_puncuation_mode`
 - Added a toggle to the exaggeration filters, as `exaggeration_mode`
 - Added a toggle to place interrogations in the negative prompt instead of the prompt (thought it would be interesting), as `reverse_mode`

Changes to Filter:
 - Changed custom filter to be saved manually, instead of during runtime.
 - Changed custom filter to encode as `UTF-8`, in the event that custom filter prompt includes unusual characters.
 - Added a save confirmation.

Other Changes:
 - p.init_images[0] is saved prior to conversion and reassigned after interrogation. This is to allow img2img or other scripts to handle the Alpha channel. 
 - Split the `prompt_weight_mode` from the `in_front` logic, so that they operate independently, allowing for contamination cleaner's interrogation collection at the end of a job.
2024-07-05 19:31:02 -07:00
Smirking Kitsune 1a423bf1dc
Updated Shared State
Updated Shared State references to be uniform.
2024-07-04 14:28:17 -07:00
Smirking Kitsune 82aa96f3f0
Job State Bug Fix
Bug was discovered where CLIP-EXT was resetting the Job state.
2024-07-04 14:24:58 -07:00
Smirking Kitsune efb6fc0e26
Cleanup (bug fix)
Removed unnecessary snippets from the state integration that had a syntax error.
2024-06-29 01:39:41 -07:00
Smirking Kitsune 250d912fc0
Shared State Integration
Since the user can add a lot of interrogation models, I thought it might be a good idea to integrate the A1111 state system.
2024-06-29 01:25:12 -07:00
Smirking Kitsune 17b11276b0
Interrogation Concatination Bug Fix
Bug was introduced that caused extra "CLIP (EXT)" and "WD (EXT)" to be left out of the interrogation. This happened when user added multiple "CLIP (EXT)" or "WD (EXT)" models to the job, as their nested loops were overwriting the interrogation. Fixed by adding concatenation to all interrogator statements, instead of at the end of loop.
2024-06-29 00:46:58 -07:00
Smirking Kitsune b3743e43b2
Quirk Fix
Fixed a known quirk with the model_selector, where the models "CLIP (EXT)" and "WD (EXT)" will still appear the first time users click on the model_selector drop down menu, even if the associated extensions are not installed or enabled.
2024-06-28 22:09:40 -07:00
Smirking Kitsune 8bc9ece0ec
Over Exaggeration & Emoji Bug Fixes
- An bug was occurring that caused over exaggeration of tags. This notably happened when using the tagger models (WD and Deepbooru). Multiple models would coincidentally output the same tags, so the interrogations could have multiple instances of the same tag causing exaggeration of the tag. Fixed by making preliminary interrogations filter itself by the interrogation before adding to interrogation.

 - An bug was occurring with the underscore remover. It would break underscore emojis that the WD tagger produced. Created a function to identify emoji patterns before determining if underscore should be replaced with a space.

 - Added some documentation. 

 - Changed some UI wordings.
2024-06-28 21:10:26 -07:00
Smirking Kitsune 16740ad1eb
Bug Fixes
Found a bug that caused WD unloading to fail.
2024-06-28 07:53:01 -07:00
Smirking Kitsune 1f8d537350
Direct Extention Interaction
Major overhaul to this patch. I was unsatisfied with the performance and restraints that working through the API caused. So API has been removed in favor of direct extension interactions.
2024-06-28 06:45:39 -07:00
Smirking Kitsune b7f1440367
Rollback of UI Always Visible Overhaul
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.
2024-06-27 22:31:28 -07:00
Smirking Kitsune 6b1b47f392
Always Visible UI Overhaul
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...)
2024-06-27 17:44:48 -07:00
Smirking Kitsune fa3234ecbf
Update sd_tag_batch.py
- Removed a Library that was Erroneously Imported (was used for something that did not work out...)
 - Minor Comment Changes
2024-06-27 00:26:10 -07:00
Smirking Kitsune e47443ee98
Additional Model Unloading Options
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.
2024-06-27 00:19:10 -07:00
Smirking Kitsune a483fd1505
API Inerrogator Update for sd_tag_batch.py
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
2024-06-26 23:43:17 -07:00
Smirking Kitsune a59149c550
Update sd_tag_batch.py
Forgot to change the run definition in the commit.
2024-05-13 23:02:49 -07:00
Smirking Kitsune 7c1b35d902
Filtering Update 2 sd_tag_batch.py
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.
2024-05-13 22:24:18 -07:00
Ryan Mochizuki Miller cd590fb990
Multiple Interrogations Update sd_tag_batch.py
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.
2024-05-12 21:55:56 -07:00
Santiago Alvarez d8ba8b05e1 add accordion for the options 2024-05-07 22:26:29 -03:00
RookHyena b83d6f20d2
Update sd_tag_batch.py 2024-05-07 15:11:02 -07:00
RookHyena 8412f15aa9
Filter negative and duplicate content from interrogator sd_tag_batch.py
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.
2024-05-07 14:48:08 -07:00
Santiago Alvarez c743c9caed
Merge branch 'main' into patch-1 2024-05-07 05:36:39 -03:00
Alvi 4e2dcb9d9e Fix prompt usage 2024-05-07 05:26:55 -03:00
RookHyena 153f3f3863
Prompt Weighting Toggle for sd_tag_batch.py
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.
2024-05-06 20:25:34 -07:00
Alvi cb9ab96ad3 fix apha channel 2024-02-10 06:40:32 -03:00
Alvi 7f4e4eb064 Fix prompt 2023-08-30 20:49:42 -03:00
Alvi 3db3b37551 Fix prompt 2023-08-30 00:26:12 -03:00
Santiago Alvarez 2ebe74c277 fix 2023-03-28 20:17:43 -03:00
Santiago Alvarez 95421dc79e add use A1111 interrogator 2023-03-28 19:05:58 -03:00
Santiago Alvarez 00756db06c change prompt_weight values 2023-03-27 23:24:31 -03:00
Santiago Alvarez 922df9f55f fix weigth slider 2023-03-27 22:45:18 -03:00
Santiago Alvarez 0c773d9d3e add weight 2023-03-27 19:16:24 -03:00
Santiago Alvarez c625bd4d54 add code 2023-03-27 18:28:49 -03:00