Danbooru Prompt Formatter

Details

Download Files

Model description

This is a simple code that you run locally on your computer.

When I get tired of using the same prompt over and over again, I sometimes like copying the prompts from Danbooru images and always found it a pain in the ass to format the prompt correctly by deleting the '?' and the numbers next to the words such ass '86k' or '1.3M'. Just formatting a couple of prompts takes a lot of time I would prefer to use somewhere else.

So I decided to ask ChatGPT to make me a little simple tool that I could run locally in my computer without the need to host it on the web. That way whenever I need to format a prompt correctly I simply double click on the file and I get to use it on my web browser.

And this is the result. It works. It does what it's supposed to do. Now I can format my prompts faster by simply clicking on the 'Format Text' button.

How does it work?

  1. Double click on the file.

  2. Open Danbooru or any of their variants.

  3. Select an image you would like to copy the prompts from.

  4. Select and copy the prompts under the 'General' section - Ex. ? 1girl 1.1M

  5. Paste your selection on the first box in the 'Danbooru formatter' tab.

  6. Click 'Format Text'.

  7. This automatically format the text by following some parameters. See below for more,

  8. Simply click the 'Copy to Clipboard' button and paste that on your preferred AI generator.

  9. Enjoy.

Parameters:

  1. A simple blacklist was added to the code containing the words: 'artist name', 'artist logo', 'watermark', etc.

  2. A simple whitelist was added to the code containing the words: '1girl', 1boy', '1other' and their variants. The code removes all numbers by default. If this whitelist is not included then the generated text would lack the number at the beginning of the tag - Ex. 'girl' instead of '1girl'.

  3. It has been coded to remove the '?' at the beginning and the numbers with letters at the end of each tag '859k' or '3.1M'.

  4. It has been coded to generate the prompt inside a quotation marks such as "this is the prompt formatted correctly". This has been done to help me add it to the X/Y/Z/ plot script on Stable Diffusion. I use this to test prompts and Loras.

  5. The tags '3d', 'realistic' and 'tag (medium)' has not been blacklisted in case you want those tags in your prompts.

  6. There is a tag '?' in Danbooru that adds question marks to images. This could not be added to the blacklist. The reason is that when the program formats the text you input, it gets rid of it because it thinks that '?' is part of the original '?' at the beginning of the tag. When the program removes it, it does not remove the numbers next to it - Ex. '? ? 54k' The first '?' is found at the beginning of each tag and the second '?' is the question mark found in the image. The program removes both but does not remove the number '54k'. Simply delete the number after you get the formatted prompt.

  7. Feel free to add/remove tags to the blacklist and whitelist.

Disclaimer:

  1. Simply does not publish this tool as yours.

  2. Do not remove/modify the footprint 'Made by NyaanChanAI'.

  3. Do not host this on the web to make money from it.

Images made by this model

No Images Found.