|
1 | | -A semi-random prompt generator for danbooru tags, designed to work with your character prompts. (Illustrious/Pony) |
| 1 | +# Raffle |
2 | 2 |
|
3 | | -Definitions |
| 3 | +A semi-random prompt generator for danbooru tags that works alongside your character prompts, allowing you to put your waifu in many situations. Made for Illustrious/Pony and any models supporting danbooru prompting. |
4 | 4 |
|
5 | | -`taglist`: If you open an image on the danbooru website you will see a list of tags on the left-hand side that have been applied to that specific image, this is what we're calling the taglist - a grouping of multiple tags. |
| 5 | +## Quick Start |
6 | 6 |
|
7 | | -`pool of taglists`: Inside the `/lists/` directory you will find files called `general.txt`, `questionable.txt`, `sensitive.txt`, `explicit.txt`. Each one of these files contains 100,000 lines, and each line contains a list of tags. This 100,000 number is the entire pool of taglists and this pool is filtered by: `taglists_must_include` and `exclude_taglists_containing`. |
| 7 | +1. Add the Raffle node to your workflow |
| 8 | +2. Connect your Negative Prompt to the "negative_prompt" input (you may need to convert it to a `text` node first) |
| 9 | +3. Use the "Filtered tags" output in your Positive Prompt (merge it with a `text concat` or `string concat` node) |
8 | 10 |
|
9 | | -The way this prompt generator works is it filters the pool of taglists and then filters the taglist itself. |
10 | | -Here's some instructions on how the fields work. |
| 11 | +See the included workflow examples for detailed implementation. |
11 | 12 |
|
12 | | -`taglists_must_include`: this will reduce the pool of taglists, as each word written here must be in the taglist. So if you write a bunch of tags here, the pool will become very small very quickly. You should leave this blank unless you're wanting a specific output. |
| 13 | +## How It Works |
13 | 14 |
|
14 | | -`negative_prompt`: wire in your usual negative prompt here, so that we can be sure to that none of the tags in your negative prompt appear in the "Filtered Tags" output. |
| 15 | +Danbooru is an image booru site where images are tagged with descriptive terms. For offline use, 400,000 of these taglists have been scraped into files: `general.txt`, `questionable.txt`, `sensitive.txt`, `explicit.txt`. Raffle randomly selects from these taglists, filters them according to your preferences, and provides the resulting tags for your prompt. |
15 | 16 |
|
16 | | -`negative_prompt_2`: This field is just for convenience and will be combined with your negative_prompt. You can filter out more tags here, instead of needing to fill up your main negative_prompt with hundreds of tags. |
| 17 | +### Selection Process |
| 18 | +1. Raffle first filters the pool of available taglists based on: |
| 19 | + - `use_general`, `use_questionable`, `use_sensitive`, `use_explicit` |
| 20 | + - `exclude_taglists_containing` |
| 21 | + - `taglists_must_include` |
| 22 | + - `exclude_tag_categories` |
| 23 | +2. It randomly selects one taglist from this filtered pool using your provided seed |
| 24 | +3. That selected taglist is then filtered by: |
| 25 | + - `negative_prompt` |
| 26 | + - `filter_out_tags` |
| 27 | + - if the tag isn't even in `categorized_tags.txt` then it's also filtered |
| 28 | +4. The final result is the `Filtered tags` output. You can use this in your Positive Prompt. |
17 | 29 |
|
18 | | -`exclude_taglists_containing`: The reason you would write tags here instead of negative_prompt_2 is because filtering the individual tag may not be enough, you may want to throw out the entire taglist instead, if you believe the presence of the tag ruins the whole taglist. |
| 30 | +## Node Options |
| 31 | +- **use_general**: Enable selection from general.txt which contains 100,000 general taglists |
| 32 | +- **use_questionable**: Enable selection from questionable.txt which contains 100,000 questionable taglists |
| 33 | +- **use_sensitive**: Enable selection from sensitive.txt which contains 100,000 sensitive taglists |
| 34 | +- **use_explicit**: Enable selection from explicit.txt which contains 100,000 explicit taglists |
| 35 | +- **seed**: Controls which taglist is randomly selected from the filtered pool |
| 36 | +- **taglists_must_include**: Only selects taglists that contain ALL of these tags. Use sparingly as each tag added severely reduces the available pool of taglists. |
| 37 | +- **negative_prompt**: Connect your existing negative prompt here to ensure none of those tags appear in the output |
| 38 | +- **filter_out_tags**: Additional tags to filter out from the final output without modifying your main negative prompt |
| 39 | +- **exclude_taglists_containing**: If ANY of these tags appear in a taglist, the entire taglist is removed from consideration. Use with caution as this can significantly reduce options. |
| 40 | +- **exclude_tag_categories**: Exclude entire categories of tags (e.g., "clothes_and_accessories", "standard_physical_descriptors") from the final output |
19 | 41 |
|
20 | | -Note: this custom node's biggest limitation right now is it has only categorized 6568 tags, you can find this file in `/lists/categorized_tags.txt` and only tags in this list will appear in your output. More obscure tags will not appear in your outputs. |
| 42 | +## Node Outputs |
| 43 | +- **Filtered tags**: The final list of tags ready to use in your prompt |
| 44 | +- **Unfiltered tags**: The complete original taglist before filtering (for debugging) |
| 45 | +- **Debug info**: Information about the selection process, including available taglist count |
| 46 | + |
| 47 | +## Categories |
| 48 | + |
| 49 | +I've used AI to help categorize 20,000 tags in `categorized_tags.txt`, this includes any tag with more than 100 entries on danbooru. The categorization method isn't perfect, but it's what I've ended up with: |
| 50 | + |
| 51 | +- `abstract_symbols` |
| 52 | +- `actions` |
| 53 | +- `artstyle_technique` |
| 54 | +- `background_objects` |
| 55 | +- `bodily_fluids` |
| 56 | +- `camera_angle_perspective` |
| 57 | +- `camera_focus_subject` |
| 58 | +- `camera_framing_composition` |
| 59 | +- `character_count` |
| 60 | +- `clothes_and_accessories` |
| 61 | +- `color_scheme` |
| 62 | +- `content_censorship_methods` |
| 63 | +- `expressions_and_mental_state` |
| 64 | +- `female_intimate_anatomy` |
| 65 | +- `female_physical_descriptors` |
| 66 | +- `format_and_presentation` |
| 67 | +- `gaze_direction_and_eye_contact` |
| 68 | +- `general_clothing_exposure` |
| 69 | +- `generic_clothing_interactions` |
| 70 | +- `holding_large_items` |
| 71 | +- `holding_small_items` |
| 72 | +- `intentional_design_exposure` |
| 73 | +- `lighting_and_vfx` |
| 74 | +- `male_intimate_anatomy` |
| 75 | +- `male_physical_descriptors` |
| 76 | +- `metadata_and_attribution` |
| 77 | +- `named_garment_exposure` |
| 78 | +- `nudity_and_absence_of_clothing` |
| 79 | +- `one_handed_character_items` |
| 80 | +- `physical_locations` |
| 81 | +- `poses` |
| 82 | +- `publicly_visible_anatomy` |
| 83 | +- `relationships` |
| 84 | +- `sex_acts` |
| 85 | +- `sfw_clothed_anatomy` |
| 86 | +- `special_backgrounds` |
| 87 | +- `specific_garment_interactions` |
| 88 | +- `speech_and_text` |
| 89 | +- `standard_physical_descriptors` |
| 90 | +- `thematic_settings` |
| 91 | +- `two_handed_character_items` |
0 commit comments