
Unknown Tags
Suggested Tags
Top Artists
Questions:
What is the purpose of this tool?
Since Stable Diffusion's initial release in 2022, users have developed a myriad of fine-tuned text to image models, each with unique "linguistic" preferences depending on the data from which it was fine-tuned. Some models react best when prompted with verbose scene descriptions akin to DALL-E, while others fine-tuned on images scraped from popular image boards understand those boards' tag sets. This tool serves as a linguistic bridge to the e621 image board tag lexicon, on which many popular models such as Fluffyrock, Fluffusion, and Pony Diffusion v6 were trained.
When you enter a txt2img prompt and press the "submit" button, Prompt Squirrel parses your prompt and checks that all your tags are valid e621 tags. If it finds any that are not, it recommends some valid e621 tags you can use to replace them in the "Unknown Tags" section. Additionally, in the "Top Artists" text box, it lists the artists who would most likely draw an image having the set of tags you provided. This is useful to align your prompt with the expected input to an e621-trained model.
Does input order matter?
No
Should I use underscores or spaces in the input tags?
As a rule, e621-trained models replace underscores in tags with spaces, so spaces are preferred.
Can I use parentheses or weights as in the Stable Diffusion Automatic1111 WebUI?
Yes, but only '(' and ')' and numerical weights, and all of these things are ignored in all calculations. The main benefit of this is that you can copy/paste prompts from one program to another with minimal editing.
An example that illustrates acceptable parentheses and weight formatting is:
((sunset over the mountains)), (clear sky:1.5), ((eagle flying high:2.0)), river, (fish swimming in the river:1.2), (campfire, (marshmallows:2.1):1.3), stars in the sky, ((full moon:1.8)), (wolf howling:1.7)
Why are some valid tags marked as "unknown", and why don't some artists ever get returned?
Some data is excluded from consideration if it did not occur frequently enough in the sample from which the application makes its calculations. If an artist or tag is too infrequent, we might not think we have enough data to make predictions about it. Additionally, Prompt Squirrel gathers information from several sources, and the sources are not always consistent about things like exact tag names or counts, which vary over time.
Why do some suggested tags not have summaries or wiki links, and of those that do, why do some look truncated?
Both of these features are extracted from the tag wiki pages, but some valid e621 tags do not have wiki pages. Additionally, the summaries are heuristically extracted from the beginning of the wiki pages, and this extraction process is prone to some amount of error.
Are there any special tags?
Yes. We normalized the favorite counts of each image to a range of 0-9, with 0 being the lowest favcount, and 9 being the highest. You can include any of these special tags: "score:0", "score:1", "score:2", "score:3", "score:4", "score:5", "score:6", "score:7", "score:8", "score:9" in your list to bias the output toward artists with higher or lower scoring images.
Are there any other special tricks?
Yes. If you want to more strongly bias the artist output toward a specific tag, you can just list it multiple times.
So for example, the query "red fox, red fox, red fox, score:7" will yield a list of artists who are more strongly associated with the tag "red fox"
than the query "red fox, score:7".
Why is this space tagged "not-for-all-audience"
The "not-for-all-audience" tag informs users that this tool's text output is derived from e621.net data for tag prediction and completion. The app will try not to display nsfw tags unless the "Allow NSFW Tags" is checked, but the filter is not perfect.
How is the artist list calculated?
Each artist is represented by a "pseudo-document" composed of all the tags from their uploaded images, treating these tags similarly to words in a text document.
Similarly, when you input a set of tags, the system creates a pseudo-document for your query out of all the tags.
It then compares your tags against each artist's collection, essentially finding which artist's tags are most "similar" to yours.
This method helps identify artists whose work is closely aligned with the themes or elements you're interested in.
For those curious about the underlying mechanics of comparing text-like data, we employ the TF-IDF (Term Frequency-Inverse Document Frequency) method, a standard approach in information retrieval, and reduce the TF-IDF matrix to a reasonable size using Singular Value Decomposition.
You can read more about TF-IDF on its Wikipedia page and Singular Value Decomposition on its Wikipedia page.
How does the tag corrector work?
We collect the tag sets from over 4 million e621 posts, treating the tag set from each image as an individual document. We then randomly replace about 10% of the tags in each document with a randomly selected alias from e621's list of aliases for the tag (e.g. "canine" gets replaced with one of {k9,canines,mongrel,cannine,cnaine,feral_canine,anthro_canine}). We then train a FastText (https://fasttext.cc/) model on the documents. The result of this training is a function that maps arbitrary words to vectors such that the vector for a tag and the vectors for its aliases are all close together (because the model has seen them in similar contexts). Since the lists of aliases contain misspellings and rephrasings of tags, the model should be robust to these kinds of problems as long as they are not too dissimilar from the alias lists.
To enhance the tag corrector further, we employ the same TF-IDF method we used for artist tags to calculate a separate, context-sensitive similarity score for each of the top 100 tags selected via the FastText method.
By considering the context in which tags are used, we can now not only correct misspellings and rephrasings but also make more contextually relevant suggestions.
The "similarity weight" slider controls how much weight these TF-IDF scores are given vs how much weight the FastText similarity model is given when suggesting replacements for invalid tags.
A similarity weight slider value of 0 means that only the FastText model's predictions will be used to calculate similarity scores, and a value of 1 means only the TF-IDF scores are used (although the FastText model is still used to trim the list of candidates).
How do the sample images work?
In the first row of galleries, for each artist in the dataset, we generated a sample image with the model Fluffyrock Unleashed using the prompt "by artist, soyjak, anthro, male, bust portrait, meme, grin" where "artist" is the name of an artist. The simplicity of the prompt, the the simplicty of the default style, and the recognizability of the character make it easier to understand how artist names affect generated image styles. The image on the left captioned "No Artist" was generated with the same prompt, but with no artist name. You should compare all the images to the first to see how the artist names affect the output. Each subsequent row of images was generated using the same process, but with a different prompt. See SamplePrompts.csv for the list of prompts used and their descriptions.