日本語はこちらへ
An extension for Stable Diffusion Web UI that upsamples prompts by generating or completing danbooru tags using lightweight LLM.
It's useful for people who don't want think about long prompt or want to see diverse, natural and high quality images without any thinking.
- 2024/2/29: v0.2.0 has been released. New features; generation options, variety level and range ban tags.
- 2024/2/25: v0.1.1 has been released. Handling of seeds, escaping processing of brackets and many bugs are fixed.
- 2024/2/23: First version v0.1.0 has been released.
Open the Danbooru Tags Upsampler
accordion and check the Enabled
checkbox to enable this extension.
Explanation of parameters:
Parameter name | Description | Example value |
---|---|---|
Total tag length | This parameter can specify the amount of total tags after completing the positive prompt. Not the amount of completing tags. very short means "less than 10 tags", short means "less than 20 tags", long means "less than 40 tags" and very long is more than that. |
long is recommended |
Ban tags | All tags in this field will never appear in completion tags. It's useful when you don't want to contain some specific tags. Using * maches to any character. (e.g. * background matches to simple background , white background , ...) |
official alternate costume, english text, * background, ... |
Seed for upsampling tags | If this number and the positive prompt are fixed, the completion tags are also fixed. -1 means "generates tags using random seed every time" |
If you want to generate images with different final prompts every time, set to -1 . |
Upsampling timing | When to upsample, before or after other prompt processing (e.g. sd-dynamic-prompts or webui's styles feature) are applied. | After applying other prompt processings |
Variety level | These parameters are presets of the Generation config . This can change the variety of upsampled tags. |
varied |
Generation config | LLM parameters of generating tags. It's recommended not to touch if you are not familiar with language model's generation parameters, and use Variety level option instead. |
Generation settings:
- Model: AnimagineXL 3.0
- Negative prompt (same as the recommended settings of animaginexl 3.0):
nsfw, lowres, bad anatomy, bad hands, text, error, missing fingers, extra digit, fewer digits, cropped, worst quality, low quality, normal quality, jpeg artifacts, signature, watermark, username, blurry, artist name
Upsampling settings:
- Total tag length:
long
- Ban tags: none
- Seed:
-1
- When to perform the process:
Before applying styles
(The seeds are not the same.)
Input prompt | Very unvaried | Unvaried | Normal | Varied | Very varied |
1girl, solo, from side | |||||
1girl, frieren, sousou no frieren, | |||||
no humans, scenery |
Very unvaried
and Unvaried
mean less variety, but at the same time, faithful to the input prompt and generate relatively acceptable tags. Also, Very varied
and Varied
mean more variety, but tend to ignore the input prompt and often generate weird tags.
This extension uses the following model:
p1atdev/dart-v1-sft
: 🤗 HuggingFace
A demo on 🤗 Space is avaiable, so you can try upsampling tags without installing this extension:
Demo: https://huggingface.co/spaces/p1atdev/danbooru-tags-transformer
Open [webui's root directory]/ui-config.json
, then find parameters staring with customscript/dart_upsampler.py/
and edit them.
If you feel that the default values are broken, you can delete parameters staring with customscript/dart_upsampler.py/txt2img/
to reset the default values.
This project has been influenced by the following projects and researches. We express our respect and gratitude to the developers and contributors of these projects:
- succinctly/text2image-prompt-generator: https://huggingface.co/succinctly/text2image-prompt-generator
- Gustavosta/MagicPrompt-Stable-Diffusion: https://huggingface.co/Gustavosta/MagicPrompt-Stable-Diffusion
- FredZhang7/anime-anything-promptgen-v2: https://huggingface.co/FredZhang7/anime-anything-promptgen-v2
- sd-dynamic-prompts: https://github.com/adieyal/sd-dynamic-prompts
- DALL-E 3: https://cdn.openai.com/papers/dall-e-3.pdf
- caption-upsampling: https://github.com/sayakpaul/caption-upsampling
- StableDiffusionWebUI: https://github.com/AUTOMATIC1111/stable-diffusion-webui and its derivatives