Commit Graph

73 Commits (main)

Author SHA1 Message Date
Santiago Alvarez ed91cec663
Merge pull request #11 from SmirkingKitsune/patch-1
Gradio 5 Compatibility Update
2025-01-04 19:29:16 -03:00
Smirking Kitsune 6567cfba52
Compatibility Update
Compatibility update that makes this forward compatible with Gradio 5, while keeping Gradio 4 functionality.
2025-01-01 21:08:50 -08:00
Santiago Alvarez 627c565ceb
Merge pull request #10 from SmirkingKitsune/patch-2
Additional Interrogator, AlwaysVisible and Experimental (Fun) Tools Update
2024-07-31 20:52:43 -03:00
Smirking Kitsune 41940cf0d4
Update README.md
Picture Formatting Fix
2024-07-31 16:35:12 -06:00
Smirking Kitsune 39af667544
Update README.md
Clarification on e621 use.
2024-07-30 18:28:54 -06:00
Smirking Kitsune b1163a5f66
Prompt-Interrogation Concatiation Formatting Patch
Change to how the prompt is concatenated with the interrogation. This will prevent excessive commas when concatenating prompt and interrogation like f"{prompt}, {interrogation}"
2024-07-30 18:26:13 -06:00
Smirking Kitsune 261ac7c6e1
Reremoved Excessive Attention Syntax
Somehow I pushed out an update based on the version with excessive attention syntax. This syntax has been removed again.
2024-07-26 21:36:12 -06:00
Smirking Kitsune e9d4c28010
Update README.md
Images were offset by an index, due to miscellaneous additional image.
2024-07-25 20:23:23 -06:00
Smirking Kitsune 2e4039288a
Update README.md
- Uploaded Images and added to the readme.
 - Updated Help Doc
 - Updated Todo list
2024-07-25 20:15:57 -06:00
Smirking Kitsune faabfd2401
Add files via upload
HelperDoc images to better show users what to expect.
2024-07-25 19:43:09 -06:00
Smirking Kitsune 60bc36d5d9
Find & Replace Update
Adds a feature to find and replace words within the interrogation.
2024-07-25 19:08:44 -06:00
Smirking Kitsune 919f4cfb31
Ratings Update
WD extension has the ability to rate interrogated images. This allows users to append that rating to the end of their preliminary WD interrogations so that SD might have a better understanding of the image.
2024-07-25 15:07:10 -06:00
Smirking Kitsune 909122682f
Update README.md 2024-07-24 12:06:41 -06:00
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 5bbf505e9f
Merge pull request #1 from SmirkingKitsune/SmirkingKitsune-patch-3
AlwaysVisible and Experimental (Fun) Tools
2024-07-05 20:00:42 -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
Santiago Alvarez 7903ad73bc update img 2024-05-15 02:26:24 -03:00
Santiago Alvarez d5718405ed gitignore change 2024-05-15 02:22:55 -03:00
Santiago Alvarez 23dfd1fde2
Merge pull request #8 from SmirkingKitsune/patch-1
Filtering Update 2 sd_tag_batch.py
2024-05-15 02:21:05 -03: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
Santiago Alvarez c93b278001
Merge pull request #7 from SmirkingKitsune/patch-1
Multiple Interrogations Update sd_tag_batch.py
2024-05-14 00:53:56 -03: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 240792b6ad
Merge pull request #6 from RookHyena/patch-1
Filtering Patch
2024-05-07 22:28:29 -03: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 bf6b78866f
Merge pull request #5 from RookHyena/patch-1
Prompt Weighting Toggle for sd_tag_batch.py
2024-05-07 05:37:30 -03: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