Sexy.ai Useful tools

Adds useful tools to the Sexy.AI❤️ image generator. [🔠Dynamic Prompts]. [📚Complete Tags feature], [🔎Search images by Index], [🔓Generate Button Always Enabled], [🔁Undo/Redo Button], [🖼️Keeps Images Feature] and more

These are versions of this script where the code was updated. Show all versions.

  • v6.01 2024-05-02
  • v6.01 2024-05-02

    I recently bought a better graphics card that can run Stable Diffusion locally, so future updates to this script may take a while or not happen at all, I'll be focusing on other projects.❤️

    Changelogs:

    • The code to get the model button element was giving an error and the code did not continue, so I used try catch and changed the xpath
    • Local storage of positive and negative prompt has changed
  • v6.00 2024-04-23

    Wow, this new sexyai update took me by surprise, I'll have to adapt my script to this new interface. 🤡 "Ah shit, here we go again"

    Change Logs:

    • Modification of the code linked to the advanced box
    • there is only 1 'generate' button
    • I removed the "Advanced settings always open" function, this would no longer be useful.
    • Removed "Better Memento"
    • modification of the Set_Text() function
    • removed variable promptarea, negpromptarea, DataList_Bkp
    • Removed button from Unlock Pro features, the 4 images option can be done by clicking 2 times on the 2 images button.
    • The "Manage Script Interface" function will have a new functionality, if you want to move some script interface within the advanced box, just put "s" at the end
      • Works only in "Main Config Box", "Word Bypass Box", "Random Prompt Box", "Dynamic Prompts Box"
      • The new default value will be "1,2,3s,4s,5s,6s"
    • correction in the Replace_Prompt_Tag() function
    • Increased the default size of the Dynamic Prompts textarea
    • Removed the function that transfers information from the prompt to the generator configuration
    • Added "Press Enter to Generate" button. This means that when you press the "Enter" shortcut, it will generate an image
    • Added a new type of tag list view which is the floating box, which will be below the prompt
      • Appears 1 second after you type and takes 3 seconds to disappear, this can be changed in the FB_start and FB_end variables
  • v5.10 2024-04-20
    • Some corrections in the code
      • Bug in the getResults() function, where it did not identify the limit of tags in the wildcards and exceeded the number, leaving the list too large and crashing
      • I changed the operation of the selectedarea variable
      • Removed the _filter argument in the Replace_Prompt_Tag function
      • Fixed the bug of the weight syntax string doubling when the value becomes negative
      • Correction in the regex of the `getWord() function
      • Corrections to Dynamic Prompts
      • Improved the function of Dynamic Prompts buttons
    • When you type a wildcard in the prompt, the name of the wildcard will appear in the tag list and then the keywords within the wildcard
    • Improved the option to order the list of tags
    • Now when one of the boxes hides, the name of the box will appear in the center
    • Hide box button was added in Tag List Box to hide this box. And the button that was there will have a "⚙️" emoji
    • I changed the position of the buttons in the Dynamic Prompts Box.
    • Blank spaces in wildcards will be replaced by hyphen
    • Omitting Bounds is now possible in Dynamic Prompts. Example: {-2$$chocolate|vanilla|strawberry} or {1-$$chocolate|vanilla|strawberry}
  • v5.00 2024-04-19

    This version of the script is where I worked a lot on the Dynamics Prompts function, making it more complete

    Change logs

    • Added function to add filter to images
      • Contrast, Saturation, Brightness
    • I removed the horizontal margin to label 'Move Word'
    • I made Dynamic Prompts have a separate interface from the others. Because I intend to add wildcards.
      • So, for this interface to appear, you must add the value 6 in the "Manage script interface" option
    • I confused the Weighting Options part in Dynamic Prompts, it should take the relative frequency, not the strength of the word. 🤡
    • Separator is now possible in Dynamic Prompts. Example : {2$$ and $$chocolate|vanilla|strawberry}
    • Range Options is now possible in Dynamic Prompts. Example : {1-2$$chocolate|vanilla|strawberry}
    • Corrections in Dynamics Prompts such as it should not choose the same words when you enter multiple values
    • Wildcards are now possible in Dynamic Prompts
      • You can open the wildcards file on your computer or create one from scratch.
      • More syntaxes were added to dynamic prompts
    • The Main Config interface will be in a grid format to align the buttons, the same goes for Random Prompt Box and Tag List Box
    • Dynamic prompts can be tested in the console. Example: "text string".dynamicPrompts();
    • When you change pages, it causes an error and the screen goes white with the message "Application error: ...", now this will no longer happen, all because the script deleted the <h1> element which was the title "Generate Images", now the script just hides the element, instead of removing it.
    • Fixed issue with favorite tags appearing again when you click "Show More"
    • Added a 🧾 button to the Tag List Box to show wildcards in the tag list
    • The tag list is updated when you click the "🧾" or "⭐" buttons
    • Added title attribute to favorite and wildcards button
    • Added a new type of tag list view which is the grid
    • Added search type in Tag List Box settings
      • Linear Search, Contains Text, Equal
    • Added title attribute to <select> elements
    • Tag search and tag replacement will not ignore the "_" and "-" character because of wildcards that need this character. Replace Prompt Tag() and getResults() function
    • Wildcards will automatically appear in the tag list when you start the entry with the character "_", even if the enable wildcards button is disabled.
    • Added Shortcuts
      • You can click on the tag using "Ctrl" so it will add the tag
      • Using "Ctrl" + Up in the prompt makes the keyword have more weight, "Ctrl" + Down decreases the weight
    • I changed the way the tag list gets the prompt word.
      • It will split the prompt using 2 separators. the comma or whitespace, so the tag list can take words from the prompt divided by commas or whitespace
      • It does not split the prompt using "" or "-" characters, you can enter entire keywords. Ex: "redclothing" and the tag list will return the entire tag
      • You can toggle this on the button there in the Tag list Box where the comma button. ","
    • You can search for wildcards in the prompt and the tag list will return what is inside that wildcard
  • v4.01 2024-04-07

    I used the wrong event in the notepad lol, it was supposed to be `oninput` instead of `onchange`

  • v4.00 2024-04-07
    • The script now no longer saves the positive and negative prompt to tampermonkey's local storage. This feature is already on sexy.ai. The prompt is already saved in the page's local storage.
      • The models list selection still continues to be saved in the script's local storage
      • Damn, I see that the autosave button I added in the previous version wouldn't be very useful haha, but I'll leave it there.
    • Keep Images will have an improved interface
      • The image box will follow the same style as what is in the library, but without the click event that causes zooming, it just opens to a new page
      • there will be options at the top of the image boxes
        • Remove image button from the image generation page (This does not delete the image from the library)
        • Negative and positive prompt replace button
      • There will be a "Show Options" button next to "Clear All"
    • In Prompt Tools a Dynamic Prompts button was added
    • script now gets the positive and negative prompt from local storage, not from the value of <textarea>
    • Added Notepad, can be enabled/disabled in Prompt Tools
    • I changed the script description to have more information
  • v3.60 2024-04-04
    • I re-added the auto-save prompt that I had removed in version 0.2 of the script.
    • Added a menu command to Reset Script Settings
    • I added a function that when you generate an image, the script puts it in a pending images variable, to check if the image was generated even if the user refreshes the page or leaves the page, so it is added to the image generation page .
    • Added menu command to clear pending image array
    • The script now removes the "Generate Images" text element at the top
  • v3.50 2024-03-20
    • I simplified some part of the code
    • Fixed word move bug
    • I reversed the prompt loading, now the negative prompt will be loaded first and then the positive prompt so the page does not scroll down
    • The unlock pro feature has been patched, you can no longer use seed and subseed. Now the thing is inside the API and my script does not have access to it. Unfortunately for now we will have the option of 4 images
    • Fixed the error that it was not skipping image
    • Added a button to get a prompt for a random image from your library
    • Added Keep advanced settings always open button
    • Added function to save tags to favorite and also remove tags from favorite
      • When you save tags as a favorite, it will appear at the top of the tag list regardless of what you write, it will always be visible
    • Added menu command to edit favorite tags
    • I removed the opening animation from advanced settings
    • Added E621 and Danbooru Get Prompt Button, it takes a random post and turns the tag string into a prompt
      • You can see the chosen post in the console.
    • The options to enable/disable the script UI has been removed, you can do this in the "⚙️Manage Script Interface" option

    • I recommend you clear the local script storage in tampermonkey

  • v3.40 2024-03-15
    • Some code improvements made to the Build_Ui_PromptTools() and Build_Ui_MainConfig() functions, such as removing variables from the button and using event.target to change its class.
    • I decided that other boxes will have an open and close button, like the tag list box
    • New tools have been added for mobile users, which are the Undo and Redo button, and also a "Better Memento" button
      • the Better Memento button means that each new image you generate, the prompt information and the negative prompt will be stored in a variable. When you press ctrl+z, it will recover the previous settings. Unlike Memento Normal which only retrieves the last letter you typed
      • This is a feature that I am still testing, it can only be used in the positive and negative prompt, in the future I will be thinking about applying it to other image generator settings
    • Some improvements in fetch and generate interception
    • Some improvements to the minifier
    • Improvement in the Set_Text() function when returning the text selection position, now the selection position will always be at the end of the character when you insert a tag.
    • I renamed some functions and organized them by placing them inside an object, such as the Image and UIs variables.
    • "Move word" has been moved to the center of the interface and the minifier on the right
    • A fix in the navigate event
    • An update to sexyai stopped the Build_Ui_Viewer() function, I fixed this.
  • v3.32 2024-03-11

    Just a code correction in the menu command. I didn't change anything in the script overall

  • v3.31 2024-03-10
    • The code inside the Initialize_TagList() function has been moved to Build_Ui_TagListBox(), so the function has been removed.
    • I organized the code comments to make the code easier to understand, I will put them all in capital letters
    • Some improvements were made to my code
    • the "Error" label when the tag list fails to load, it can be clicked to be deleted
    • A pulse animation was added to the "Loading TagList..." label
    • Improvements to the CSS of the Build_Ui_PromptTools() function buttons
    • I added the menu button that opens and closes the tag list options
    • The minimum height of the tag list box has been decreased to 40px
  • v3.30 2024-03-09
    • Two new tag lists have been added, "Real Characters" and "Fictional Characters"
    • the randomize seed and subseed button was not being applied to the image, I fixed this
    • For PC users, you can see that the negative prompt UI is half done because of the check box next to it, I moved the check box to the bottom of the negative prompt
    • I changed the way it returns image information in the image viewer, function Build_Ui_Viewer(), I removed setTimeout
    • The weight value has been converted to button, when you click, there will be an imputbox for you to set the weight value of the keyword
    • Other fixes within the Load() function and in the menu command:
      • The problem where when you pressed cancel on one of the value options in the command menu, an alert appeared was fixed. This has been removed
      • When you disable or activate some of the Script's UI, it will no longer reload the page, it will make changes to the current page.
    • In the command menu, the "T" key shortcut was added to define the number of tags in the list
    • I renamed some variables to simplify the code.
    • I removed setInterval which activates the generate button, it was replaced by MutationObserver.
    • A label has been added that shows the number of images now generated.
  • v3.22 2024-03-06
    • A new method of bypassing the filtered word was added, which is the special character " " \b backspace
    • I changed the position of the images being generated, I will move the 'Generating...' element and place it where the image storage is positioned, just like sexy.ai.
    • I set the number of columns in the grid configured to always load at 4
  • v3.21 2024-02-23
    • I fixed the problem of not being able to save the negative prompt in the Save_Config() function
    • fixed the problem with the seed being "-1" when the image is generated
  • v3.20 2024-02-22
    • Added a button that unlocks pro features⭐
      • unlocks seed, subseed, subseed strength, option to generate 4 images
    • Fixed the problem with the library UI that appears in the folder tab
    • I fixed the error coming from the Build_Ui_Viewer function, it couldn't get the model code
      • Now I made it also transfer the seed, subseed and subseed strength to the configuration
    • I removed the modelsarray variable, I am using the switch function to obtain the model code and name
  • v3.11 2024-02-20

    Just a correction to one line of my code, it was not deleting the temporary prompt when it was applied🤷

  • v3.10 2024-02-20
    • Tooltip was added to the send button for generation settings.
    • I also made it so that in the sexyai viewer it also transferred the model information in the generation settings
    • An update to sexyai stopped the script's functionality from loading the selected model, I fixed this
    • The temporary prompt and the temporary negative prompt will get the text coming from the text box instead of sexyai's local storage, because sometimes it didn't update
    • I also added an alert that says that no images were found when the search for images in the library returns empty
    • I changed the position of the script's UI to be more practical, I needed to put the main settings at the bottom because on mobile the keyboard kept appearing in front of the list, and it got in the way when I wanted to complete a keyword
      • I added a new function that changes the order of the script's UI, it can be accessed in the command menu, I imagine this could be useful for some users

    I recommend users reset the storage of this script to empty "{}", so that it doesn't load the old storage.

  • v3.00 2024-02-19

    - I used the `Config` variable to also store the temporary prompt when you change pages
    - I changed the `SetInterval` function to the `navigate` navigation event to detect page changes
    - In the `load()` function: I used `startsWith` instead of the `==` operator as I intend to add new functionality to this in the future
    - NEW TOOL: Added add and remove weight tools in the prompt like () [] {}, with keyword strength values
    - The Minifier button will be a check box, because each time the prompt was changed it would reset the spacing. Now when you enable minifier, there will be no whitespace even if you change the prompt
    - on Mobile: I added `blur` when there are changes to the prompt made in the script, so as not to show the keyboard bar appearing on the screen suddenly
    - I changed the way it gets script settings from local storage
    - Command menu has been added to activate and deactivate script features with 3 options
    > Enable/Disable prompt toolbox
    > Activate/Deactivate tag list
    > Activate/Deactivate the keyword bypass box
    > Set script loading delay
    > Define the number of tags to be shown in the list
    - I removed "-----------" characters in the option to choose the list, I want to leave it clean
    - NEW TOOL: A button has been added to the SexyAI image viewer that transfers to the generated image prompt in the generation settings

  • v2.30 2024-02-18

    - I also fixed the link in the function that detects page changes
    - I removed the 'windows.load' function in the script, because I realized that you can start the script without it.
    - I made an improvement to the syntax filter function
    - The "(gore)" method filter was removed and no longer works
    - Fixed the error that makes the selection in the wrong position in the prompt
    - I organized my functions to keep them organized
    - I made some small improvements to my script to make fewer possible errors
    - Improved the function of loading and saving script settings
    - Added a button to clear stored images

  • v2.22 2024-02-17

    - I had to correct the page link so it could identify the page that generates the images. Now it's "https://sexy.ai/generate"
    - fixed a bug when selecting an empty item in the list.
    - The name and description of this script has been translated into 121 languages

  • v2.21 2024-02-13

    Just a bug fix

  • v2.20 2024-02-13

    I changed most of my code so...
    - I made the tag list, bypass word option and move word option also apply to the negative prompt, when you select the negative prompt, the script functions will be applied to the negative prompt
    - I changed the functions for bypassing the word filter, now the methods are '(gore)' and '()' parentheses
    - I improved the syntax filter when selecting the word
    - I fixed the error where it didn't find the tags when there was a white space at the end
    - I put the ' character to be ignored when searching for tags, these are the characters that are ignored when searching "_", "-", "'", "+"
    - Now when you activate the check box to keep images, it will hide the sexyai image grid elements and also that slider that changes the image size, everything will be shown below.
    - Image storage will be in grid format with the slider option to increase the grid columns
    - The "Keep images" option will no longer delete images from the current page, it will just hide them

  • v2.10 2024-02-11

    - I literally changed the code that stored the images on the current page. Now I added the function that detects the generation batch in the queue. When a batch is in the queue, a button called "Generate..." will appear below. When finished, the finished image will be shown on the current page. It is useful to generate 1 batch in each generation, your previous batch is not discarded.
    - The save button will no longer show that "Everything Saved" message, I improved the code, and now the button text will show that it has been saved.
    - Kaboom!!! Using fetch, I managed to create the code that searches the images in the library by index. A very useful tool for you to see your old works hehe.

  • v2.00 2024-02-09

    Wow, mega update
    - Firstly I had to remove the labels that show the length of the positive and negative prompt, sexyai himself already made this label
    - I added the interface class to my script, so it fits with the sexyai theme. In other words, the interfaces of my buttons will be the same as sexy.ai, it will be beautiful
    - I removed the randomize button from the prompt, because it goes very badly when there are parentheses
    - The Sort List buttons and the Change List View button have been changed to drop-down menus
    - Now you can choose the list of tags you want to display, you can also add a custom link to load the custom list
    - One interesting thing I added: Option to keep images when you click the Generate button. You would no longer need to go to the library to see your images
    - Yes, I removed the "New generate" button, now the main button will always be activated, so you can generate as many images as you want even if they are in the queue
    😎

  • v1.70 2024-01-17

    - I added the click event in the prompt text box to load the tags
    - I fixed some bugs... such as the list not being able to search for a specific tag
    - I removed the background color from the word filter box, because of sexy.ai's white theme
    - I added the button to load the positive and negative prompt saved in storage
    - I added a variable in the script to change the size of the list to show the tags
    - the method of cheating words has been changed, now it is the "Blood" method.

  • v1.60 2023-12-16

    - I stopped supporting the old sexy.ai, because it was becoming obsolete, the developers no longer updated it, and the image library is giving an error when zooming. Version 1.5 of the script is stable if you still want to use the old sexy.ai
    - I removed the 4 buttons to bypass the word because they were no longer working, the developers improved the filter... I found a way to bypass this which is the 'tone' and 'blood' method, basically it adds the "(tom)" in any character and "blood" where there are spaces, thus making it undetectable by the sexy.ai filter
    - I placed the cursor point where you point to the tag list to look like a button

  • v1.50 2023-12-04

    - Improved the way the script detects the page link to implement the script interface.
    - The button to change the tag list view has been added.
    - I changed some parts of the CSS to improve the visualization of the script interface, such as the cursor pointing to the buttons.
    - Now you can click on the phrase in the "Loaded Tag List" and it will disappear instantly
    - I added the "X" button to the word filter bypass box so you can close the box and never go back. (Unless you refresh the page)
    - Fixed the error where the tag was not being applied when the word was capitalized.
    - Fixed the interface error where the box was going beyond the buttons (Former SexyAI)

  • v1.40 2023-12-01

    - I placed variables that can configure the execution of the script
    - Added the button to sort the tag list
    - I removed the checkbox that freezes the seed, because the sexyai developer reverted the function.
    - I added a label that shows the total number of images you generated
    - I optimized some script functions a little

  • v1.30 2023-11-29

    - Added seed freeze button. (A recent update to sexyai was that the seed is always reset and set to random for each generation you make.)
    - I improved the button script to randomize the prompt order

  • v1.22 2023-11-28

    Ignore versions 1.21 and 1.20, there were small errors in my code that I forgot to correct.

  • v1.21 2023-11-28
  • v1.20 2023-11-28

    - I don't know what happened, but there was a bug recently that was adding the interface many times that ruined my code and its previous versions, I fixed it.
    - I added a new tool which is Prompt Minifier Button, it saves the prompt size so you can put more words
    - I also added the button to force new image generation. It just does that action of that "Generate" button.
    - I improved the detection on the links, the interface is just injected into the main link which is "sexy.ai", if you open sexy in the library or videos tab first, it would not execute the script, the script was made to inject the interface in the main link.
    - I fixed some bugs in the code.

  • v1.12 2023-11-23

    - A new model entered sexy.ai and messed up my variable that had model indexes, I corrected that.

  • v1.1 2023-11-22

    - fixed the negative prompt label that was 'undefined'
    - I added the label that showed that the autocomplete is loading, when it finished, the label notifies that it was loaded
    - A new model was added to sexy.ai, I had to add it to the model index list as well
    - I fixed some bugs.
    - A new level of word cheating has been added
    - I had to put the autocomplete interface closer to the prompt to make it quicker to see.

  • v1.0 2023-11-19

    - I made some changes to the script interface
    - I added the tool to move words left and right.
    - I added the tool to bypass filtered words. 3 levels in the new interface and 1 level in the old interface
    - I optimized my code a little
    - I improved the function that loads the settings, it does everything automatically now, closing the model window and the negative prompt is set automatically (You don't need to open the advanced box to load the negative prompt)
    - I improved autocomplete, now it detects if the word is equal to the tag, thus making that tag appear first in yellow (even if it is out of the list order)

  • v0.52 2023-11-18

    - I made a small correction to the code, which identified an element that can trigger the click event in the model list. Previously, it did not trigger the click event when loading the saved model from your local storage. I fixed this
    - I changed part of the final code a little... instead of using the '==' operator I used 'includes'.

  • v0.51 2023-11-17

    I had to correct a small error in the code... on the last line

  • v0.5 2023-11-17

    - I changed the structure of autocomplete, now you can select any word and modify it and it already suggests words to replace.
    - I also added the filter in autocompletion, for example, it preserves stable diffusion syntaxes, such as "()", "[]", "{}" and the weights ":x.x" when completing your word.
    - I added the "Show More" button to see more tags
    - In the old interface, I added an execution interval for the blur and image size, so when a new image appears, everything goes back to normal. I fixed this
    - I optimized my code, separating more functions and organizing
    - I fixed the error where when you changed pages, for example to the sexy.ai "library" and returned to the "Images" page, the autocomplete box disappeared

  • v0.3 2023-11-11

    - My code now supports the new sexy.ai interface
    - I added borders to the autocomplete tags to identify the button borders and not make the mistake of clicking two buttons at the same time
    - I moved the autocomplete inside the prompt size labels box.
    - I increased the autocomplete height to show more tags
    -

  • v0.2 2023-10-27

    - I had to remove the auto-save from the prompt because it was being annoying oWo. Then I put the button
    - Added button to randomize prompt order
    - Autocomplete tag list

  • v0.1 2023-10-15