{"id":20498046,"url":"https://github.com/vr-voyage/degu-diffusion","last_synced_at":"2025-04-13T18:41:40.629Z","repository":{"id":62009496,"uuid":"548118961","full_name":"vr-voyage/degu-diffusion","owner":"vr-voyage","description":"A bot software to run your own AI Image Generator Discord bot with a local StableDiffusion installation.","archived":false,"fork":false,"pushed_at":"2023-08-15T05:07:22.000Z","size":4546,"stargazers_count":7,"open_issues_count":0,"forks_count":2,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-03-27T09:22:49.932Z","etag":null,"topics":["discord","discord-bot","python","python3","stable-diffusion","stablediffusion","waifu-diffusion"],"latest_commit_sha":null,"homepage":"","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/vr-voyage.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE.md","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2022-10-09T00:34:45.000Z","updated_at":"2023-06-06T13:46:41.000Z","dependencies_parsed_at":"2022-10-25T04:00:41.528Z","dependency_job_id":null,"html_url":"https://github.com/vr-voyage/degu-diffusion","commit_stats":null,"previous_names":[],"tags_count":1,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/vr-voyage%2Fdegu-diffusion","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/vr-voyage%2Fdegu-diffusion/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/vr-voyage%2Fdegu-diffusion/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/vr-voyage%2Fdegu-diffusion/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/vr-voyage","download_url":"https://codeload.github.com/vr-voyage/degu-diffusion/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248764376,"owners_count":21158074,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["discord","discord-bot","python","python3","stable-diffusion","stablediffusion","waifu-diffusion"],"created_at":"2024-11-15T18:12:56.384Z","updated_at":"2025-04-13T18:41:40.597Z","avatar_url":"https://github.com/vr-voyage.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"- [Quick installation](#quick-installation)\n- [Provided commands](#provided-commands)\n  - [DeguDiffusion](#degudiffusion)\n  - [Repeat Diffusion](#repeat-diffusion)\n  - [Check Degu PNG Metadata](#check-degu-png-metadata)\n- [Using the bot software](#using-the-bot-software)\n  - [Requirements](#requirements)\n  - [First configuration](#first-configuration)\n  - [Running](#running)\n    - [On Windows](#on-windows)\n    - [On Linux](#on-linux)\n    - [Through Docker-compose](#through-docker-compose)\n    - [On other platforms](#on-other-platforms)\n      - [Install the dependencies](#install-the-dependencies)\n      - [Run the bot](#run-the-bot)\n  - [Testing StableDiffusion alone](#testing-stablediffusion-alone)\n  - [How do I get the required informations ?](#how-do-i-get-the-required-informations-)\n    - [Huggingface Token](#huggingface-token)\n    - [Discord Bots, how do they work ?](#discord-bots-how-do-they-work-)\n      - [Creating a bot and bot account](#creating-a-bot-and-bot-account)\n        - [Screenshots of the authorizations](#screenshots-of-the-authorizations)\n          - [Oauth2 General](#oauth2-general)\n          - [Bot intentions](#bot-intentions)\n          - [Oauth2 URL Generator](#oauth2-url-generator)\n      - [Discord Bot Token](#discord-bot-token)\n- [Additional configuration](#additional-configuration)\n  - [Lower VRAM usage](#lower-vram-usage)\n  - [Using Waifu Diffusion instead](#using-waifu-diffusion-instead)\n  - [Environment variables list](#environment-variables-list)\n  - [Special tags](#special-tags)\n  - [Denying prompts](#denying-prompts)\n    - [Examples](#examples)\n    - [Example 1](#example-1)\n    - [Example 2](#example-2)\n    - [Technical notes](#technical-notes)\n  - [Compact mode](#compact-mode)\n- [Special notes](#special-notes)\n- [Known bugs](#known-bugs)\n\n# About \u003c!-- omit in toc --\u003e\n\nThis is the code of the first version of my Discord bot software named \"DeguDiffusion\",\nthat allows you to run your own AI-powered images generation bot on Discord\nusing a local installation of StableDiffusion.\n\nThe software is available under MIT license.\n\nThe concept behind it is simple :\n\n* You create a bot account, and add its token to the `.env` file as `DISCORD_TOKEN`.\n* The software will use the bot account to connect to Discord and register image\n  generation commands (`/degudiffusion` notably) on the servers it has been invited\n  to.\n* Users on the servers use these commands to send image generation requests to your server.\n* Your server generate the images, using a local installation of\n  [HuggingFaces StableDiffusion](https://huggingface.co/CompVis/stable-diffusion-v1-4),\n  and send back the result through Discord.\n\n![Main view](./screenshots/GenerateForm-Result.png)\n\nThe software is meant to run on a machine equipped with an NVIDIA GPU.  \nThis has not been tested at all with AMD or Intel GPU.\n\nA Job Queue system is provided, allowing you to queue generations\nrequests and treat them once previous ones finished.\n\nEach request job generates a specific thread, unless its size is lower than\na certain amount, in which cases messages are sent directly on the same channel.\n\n![Messages sent directly](./screenshots/GenerateForm-Result-Direct.png)\n\nThis software won't receive major updates, I'm just uploading this version since it's\nworking, and want to keep the working version somewhere before I break it\nand remake a more versatile one.\n\n![Running bot](./screenshots/RunningBot.png)\n\n# Quick installation\n\nSetup a `.env` file with at least two entries :\n\n```env\n# Make sure your bot has sufficient rights and privileges.\n# Write your Discord bot token after the '='. No quotes needed.\nDISCORD_TOKEN=\n\n# Make sure you accepted the license on\n# https://huggingface.co/CompVis/stable-diffusion-v1-4\n# Write your Huggingfaces token after the '='. No quotes needed.\nHUGGINGFACES_TOKEN=\n```\n\nThen run `STARTBOT.bat` (or `STARTBOT.sh` on Linux).\n\n# Provided commands\n\n## DeguDiffusion\n\n`/degudiffusion`\nSummons a form, where you can setup the generation\n\n![Degu Diffusion](./screenshots/GenerateForm.png)\n\n## Repeat Diffusion\n\nRight-click on a Bot message \u003e Apps \u003e Repeat Diffusion\n\nSummons a form, reusing the settings provided in the message.  \nFails if the message right-clicked contained no diffusion information.\n\n![Apps \u003e Repeat Diffusion](./screenshots/Apps-Repeat-Diffusion.png)\n![Generate form](./screenshots/Apps-Repeat-Diffusion-Form.png)\n\n## Check Degu PNG Metadata\n\nRight-click on a generated image message \u003e Apps \u003e Check Degu PNG Metadata\n\nSends back the metadata of a generated PNG, if it still exist on the server.\n\n![Apps \u003e Check PNG](./screenshots/Apps-CheckPNG.png)\n![PNG Metadata](./screenshots/Apps-CheckPNG-Result.png)\n\n\u003e Note : This doesn't try to download the PNG !  \n\u003e This only reads it from the server harddrive, if it's still present.\n\u003e\n\u003e Also, this uses ephemeral messages (\"Only you can see this message\" messages).  \n\u003e Sometimes these messages cannot be seen by the client, when sent inside\n\u003e threads, due to some obscure Discord client bug.  \n\u003e In this case, just try again.\n\n# Using the bot software\n\nThis is mainly designed to run on a simple Windows PC,\nbut it also been tested on Linux.\n\n## Requirements\n\n* Python 3 (Tested with Python 3.10)\n* A NVIDIA Graphics Card (CUDA)\n* A [Discord bot account](https://discord.com/developers/applications) for a `DISCORD_TOKEN`\n* A [HuggingFaces account](https://huggingface.co/) for a `HUGGINGFACES_TOKEN`\n\n## First configuration\n\n\u003e If you're using Docker, check https://hub.docker.com/r/vrvoyage/degudiffusion\n\nSetup a `.env` file with at least two entries :\n\n```env\n# Make sure your bot has sufficient rights and privileges.\n# Write your Discord bot token after the '='. No quotes needed.\nDISCORD_TOKEN=\n\n# Make sure you accepted the license on\n# https://huggingface.co/CompVis/stable-diffusion-v1-4\n# Write your Huggingfaces token after the '='. No quotes needed.\nHUGGINGFACES_TOKEN=\n```\n\n\u003e Check `.env.sample` for more configuration directives.  \n\u003e Read below if you want to know how to get these tokens.\n\n## Running\n### On Windows\n\nDouble-click on **STARTBOT.bat** and wait for \"StableDiffusion ready to go\".\n\n### On Linux\n\nRun **STARTBOT.sh** (`./STARTBOT.sh`) and wait for \"StableDiffusion ready to go\"\n\n### Through Docker-compose\n\nUse the following setup :\n\n```yaml\nversion: \"3.9\"\nservices:\n  degu:\n    image: vrvoyage/degudiffusion:1.1\n    build: .\n    env_file: .env\n    environment:\n      - STABLEDIFFUSION_CACHE_DIR=stablediffusion_cache\n      - IMAGES_OUTPUT_DIRECTORY=generated # Can be commented if SAVE_IMAGES_TO_DISK is set to false\n      # - SAVE_IMAGES_TO_DISK=false # If you uncomment this, you can comment the first volume\n    volumes:\n      - ./generated:/app/generated # Only required if SAVE_IMAGES_TO_DISK=false isn't set\n      - ./cache:/app/stablediffusion_cache # Related to STABLEDIFFUSION_CACHE_DIR\n      - ./config:/app/config # Can be mounted in Read-Only if a 'replacers.json' file is already present\n    deploy:\n      resources:\n        reservations:\n          devices:\n            - driver: nvidia\n              count: all\n              capabilities: [gpu]\n```\n\nThe Docker-image is available here :  https://hub.docker.com/r/vrvoyage/degudiffusion\n\nThe build image is available here : https://github.com/vr-voyage/degu-diffusion-docker\n\n\u003e On Windows, make sure your docker installation supports CUDA.\n\n\u003e On Linux, make sure you have [`nvidia-container-runtime`](https://github.com/NVIDIA/nvidia-container-runtime) installed\n\u003e and setup in your `docker/daemon.json` configuration file (Generally in `/etc`).\n\n### On other platforms\n#### Install the dependencies\n\n```bash\npip install -r requirements.txt\n```\n\n#### Run the bot\n\n```bash\npython degu_diffusion_v0.py\n```\n\n## Testing StableDiffusion alone\n\nIf you want to test StableDiffusion itself alone,\nrun `TEST_STABLEDIFFUSION.bat` or `TEST_STABLEDIFFUSION.sh`.\n\nUsing default settings, this should output 8 images in the output\nfolder (`generated/` by default).  \n\nIf the test fails, check the `HUGGINGFACES_TOKEN` you put in the `.env` file.  \nAlso pay attention to every line output on the terminal, some of them might\nprovide clear explanations about what's going on.\n\n## How do I get the required informations ?\n\n### Huggingface Token\n\nYou need to be registered on HuggingFaces.\n\nThen go to \"Access Token\" from your User Profile and generate or copy your token\nin the `.env` file after `HUGGINGFACES_TOKEN=` (No need to add quotes).\n\n![Get an Access Token](./screenshots/Howto-HuggingFaces-Token.png)\n\n\u003e By default, you also need to accept the licence of\n\u003e [CompVis/stable-diffusion-v1-4](https://huggingface.co/CompVis/stable-diffusion-v1-4)\n\n### Discord Bots, how do they work ?\n\nA bot is just a special Discord account, who needs a TOKEN to login to Discord,\ninstead of a login/password.\n\nSo, the `DISCORD_TOKEN` is used by this software to actually login to Discord\nas the Bot.\n\n\u003e You can run a bot while being also being connected to Discord with another account,\n\u003e on the same machine, and the bot was actually only tested in that kind of environment.\n\n#### Creating a bot and bot account\n\n* Go to the [Discord Developer portal](https://discord.com/developers/applications).\n* Create a \"New application\", by clicking the upper right button near your Profile icon.\n* Setup the name then make sure you're currently editing your new application.\n* In Bot (Left panel), in \"Build-A-Bot\", click on \"Add Bot\" and Confirm.\n* On Oauth2 General (Left panel), select :\n  * **AUTHORIZATION METHOD**  \n  In-app Authorization\n  * **SCOPES**\n    * `bot`\n    * `application.commands`\n  * **BOT PERMISSIONS**\n    * Read Messages / View Channels\n    * Send Messages\n    * Create Public Threads\n    * Send Messages in Threads\n    * Attach Files\n * On OAuth2 URL Generator (Left panel) : \n   * Select the same **SCOPES** (`bot` and `application.commands`) and **PERMISSIONS**.\n   * Copy the generated URL at the bottom.\n* Enter this URL in your browser to add the generated bot to one of your server.  \n\u003e You can also send this link to people who'd like to invite the bot to their server.\n* In Bot, again, click on 'Reset Token' and copy it after `DISCORD_TOKEN=` in the `.env` file\n  (No need to use quotes).\n\n\u003e If the permissions were wrong :  \n\u003e   Set the permissions again on both panels  \n\u003e   Open the new URL in your browser and invite the Bot again on the same server.\n\n##### Screenshots of the authorizations\n\n###### Oauth2 General\n\n![Screenshot of authorizations checkboxes required in Oauth2 General](screenshots/Discord-App-Oauth2-General.png)\n\n###### Bot intentions\n\n![Screenshot of the Bot setup](screenshots/Discord-Bot-Intentions.png)\n\n###### Oauth2 URL Generator\n\n![Screensoht of authorizations checkboxes required in Oauth2 URL Generator](screenshots/Discord-App-Oauth2-URL-Generator.png)\n\n#### Discord Bot Token\n\nIf you don't know it, click on \"Reset Token\" in the \"Bot\" section of your\napplication.\nYou can view your application settings on the [Discord Developer Portal](https://discord.com/developers/applications).\n\n![Reset Discord bot token](./screenshots/Discord-Bot-Token.png)\n\nOnce generated, copy the token as `DISCORD_TOKEN` in the `.env` file.\n\n# Additional configuration\n\n## Lower VRAM usage\n\nAdd the following line to your `.env` file to switch to Float16 mode\nand reduce the VRAM usage by half (roughly) :\n\n```\nSTABLEDIFFUSION_MODE=fp16\n```\n\n## Using Waifu Diffusion instead\n\nAdd the following lines to your `.env` file, to use the\n[Waifu Diffusion model](https://huggingface.co/hakurei/waifu-diffusion) instead :\n\n```\nSTABLEDIFFUSION_MODEL_NAME=hakurei/waifu-diffusion\n```\n\n## Environment variables list\n\nHere's the list of **optional** environment variables you\ncan define to configure the bot.  \nWhen not defined, their **Default** value will be used.\n\n* `IMAGES_OUTPUT_DIRECTORY`  \n  Define where you want to store the generated pictures.  \n  **Default** : `generated`  \n  Spaces are allowed. No need to use quotes.  \n  The directory will be created if it doesn't exist.  \n  Example : `IMAGES_OUTPUT_DIRECTORY=another folder`  \n  \u003e When running the bot, this setting is ignored when\n  \u003e `SAVE_IMAGES_TO_DISK` is set to `false`.\n\n* `SAVE_IMAGES_TO_DISK`  \n  Define whether generated files are saved on the disk or not.  \n  **Default** : `true`  \n  Example : `SAVE_IMAGES_TO_DISK=false`  \n  \u003e This setting is ignored when testing Stable Diffusion alone.\n\n* `STABLEDIFFUSION_MODEL_NAME`  \n  Determine the HuggingFaces model used by `StableDiffusionPipeline`.  \n  **Default** : `CompVis/stable-diffusion-v1-4`  \n  Example : `STABLEDIFFUSION_MODEL_NAME=hakurei/waifu-diffusion`\n\n* `STABLEDIFFUSION_MODE`  \n  Allows you to select between different StableDiffusion modes.  \n  **Default** : `fp32`  \n  Currently only fp16 and fp32 are supported.  \n  VRAM usage is lower in fp16, so if you're low on VRAM,\n  set this to `fp16`.  \n  Example : `STABLEDIFFUSION_MODE=fp16`\n\n* `MAX_IMAGES_PER_JOB`  \n  Maximum number of images to output per job request.  \n  **Default** : `64`  \n  That means that the **NUMBER OF IMAGES** typed in `/degudiffusion`\n  form will be clamped to that maximum value.  \n  Example : `MAX_IMAGES_PER_JOB=8`\n\n* `MAX_INFERENCES_PER_IMAGE`  \n  Maximum number of inferences steps per image.  \n  **Default** : `120`  \n  This clamps the **INFERENCES** number typed in `/degudiffusion`\n  form to that maximum value.  \n  Example : `MAX_INFERENCES_PER_IMAGE=30`\n\n* `MAX_GUIDANCE_SCALE_PER_IMAGE`  \n  Maximal guidance scale allowed.  \n  **Default** : `20`  \n  This clamps the **GUIDANCE SCALE** number typed in `/degudiffusion`\n  form will be clamped to that maximum value.  \n  Example : `MAX_GUIDANCE_SCALE_PER_IMAGE=7.5`\n\n* `IMAGES_WIDTH` and `IMAGES_HEIGHT`  \n  The width and height of generated images.  \n  **Default** : `512`  \n  Be ***EXTREMELY*** careful with this one, VRAM usage grows dramatically\n  when using higher values.  \n  I highly recommend to switch to fp16 when using more than 512x512.  \n  Going below 512 in any direction will generally lead to garbage results.  \n  Example :  \n  `IMAGES_WIDTH=768`  \n  `IMAGES_HEIGHT=768`\n\n* `MAX_IMAGES_BEFORE_THREAD`  \n  The number of images after which the bot will automatically create a thread.  \n  **Default** : `2`  \n  That means that if you set it to 5 :  \n  When requesting up to 5 images per job, the bot will output everything\n  on the channel from where the job request was done.  \n  When requesting 6 images or more, the bot will create a thread and\n  send the results inside this thread.  \n  Example : `MAX_IMAGES_BEFORE_THREAD=5`\n\n* `COMPACT_RESPONSES`  \n  When set to `True` or `true`, the job response will only include the pictures,\n  without any further details (like the Seed, Actual Prompt.).  \n  **Default** : `false`  \n  Example : `COMPACT_RESPONSES=True`  \n  \u003e You can still use \"Check Degu PNG Metadata\" when using compact responses.\n\n* `DEFAULT_IMAGES_PER_JOB`  \n  The default **NUMBER OF IMAGES** used in `/degudiffusion` form.  \n  **Default** : `8`  \n  Example : `DEFAULT_IMAGES_PER_JOB=3`\n\n* `DEFAULT_PROMPT`  \n  The default **PROMPT** used in `/degudiffusion` form.  \n  **Default** : `Degu enjoys its morning coffee by {random_artists}, {random_tags}`  \n  Example : `DEFAULT_PROMPT=A Nendoroid of a Chipmunk by {random_artists}, {lyuma_cheatcodes}`\n\n* `DEFAULT_SEED`  \n  The default **SEED** used in `/degudiffusion` form.  \n  **Default** to an empty value.  \n  Note that you don't have to type a SEED value, in Degu Diffusion.  \n  When no seed is provided, a random seed is generated for you.  \n  Example : `DEFAULT_SEED=-1`\n\n* `DEFAULT_INFERENCES_STEPS`  \n  The default number of **INFERENCES** used in `/degudiffusion` form.  \n  **Default** : `60`  \n  Example : `DEFAULT_INFERENCES_STEPS=30`\n\n* `DEFAULT_GUIDANCE_SCALE`  \n  The default **GUIDANCE SCALE** used in `/degudiffusion` form.  \n  **Default** : `7.5`  \n  Example : `DEFAULT_GUIDANCE_SCALE=15`\n\n* `SEED_MINUS_ONE_IS_RANDOM`  \n  Determine if -1 should be interpreted as a random seed or an actual seed value.  \n  **Default** : True  \n  By default, now, `-1` is treated as a random value, since many users\n  are used to type `-1` to get a random seed.  \n  Note that you don't have to type a SEED value, in Degu Diffusion.  \n  When no seed is provided, a random seed is generated for you.  \n  Example : `SEED_MINUS_ONE_IS_RANDOM=false`\n\n* `STABLEDIFFUSION_LOCAL_ONLY`  \n  Force `StableDiffusionPipeline` to use predownloaded local files only, and avoid\n  connecting to the internet.  \n  **Default** : `false`  \n  Example : `STABLEDIFFUSION_LOCAL_ONLY=true`  \n  \u003e When set to true, `HUGGINGFACES_TOKEN` is not required anymore.\n\n* `STABLEDIFFUSION_CACHE_DIR`  \n  Determine where `StableDiffusionPipeline` download its files to.  \n  **Empty by Default**  \n  This is mainly used for Docker setups.  \n  When not set, or set to an empty string, `StableDiffusionPipeline` will\n  determine where to download its files.  \n  Example : `STABLEDIFFUSION_CACHE_DIR=sd_cache`  \n  \u003e The directory will be created if it doesn't exist.\n\n* `TORCH_DEVICE`  \n  Determine the PyTorch device used. Default to \"cuda\".  \n  **Default** : `cuda`  \n  Any value other that `cuda` is untested.  \n  Example : `TORCH_DEVICE=rocm`\n\n* `FORM_NUMBER_OF_IMAGES_INPUT_MAX`  \n  Maximum number of characters allowed for **NUMBER OF IMAGES** in\n  /degudiffusion form.  \n  **Default** : `4`  \n  Example : `FORM_NUMBER_OF_IMAGES_INPUT_MAX=3`\n\n* `FORM_PROMPT_INPUT_MAX`  \n  Maximum number of characters allowed for **PROMPT** in\n  /degudiffusion form.  \n  **Default** : `500`  \n  Example : `FORM_PROMPT_INPUT_MAX=100`  \n  \u003e Note that with the default setup, StableDiffusion will\n  \u003e parse up to 77 tokens and ignore the rest.  \n\n* `FORM_SEED_INPUT_MAX`  \n  Maximum number of characters allowed for **SEED** in\n  /degudiffusion form.  \n  **Default** : `38`  \n  Example : `FORM_SEED_INPUT_MAX=200`\n\n* `FORM_INFERENCES_INPUT_MAX`\n  Maximum number of characters allowed for **INFERENCES** in\n  /degudiffusion form.  \n  **Default** : `3`  \n  Example : `FORM_INFERENCES_INPUT_MAX=2`\n\n* `FORM_GUIDANCE_SCALE_INPUT_MAX`  \n  Maximum number of characters allowed for GUIDANCE SCALE in\n  /degudiffusion form.  \n  **Default** : `6`  \n  Example : `FORM_GUIDANCE_SCALE_INPUT_MAX=3`  \n  \u003e Be careful, conversion from float to string adds at least one decimal.  \n  This conversion might lead to errors when using the `DEFAULT_GUIDANCE_SCALE`,\n  while preparing the form.  \n  For example, if `DEFAULT_GUIDANCE_SCALE=7` then the displayed value\n  will be `7.0`, and will take 3 characters.  \n  If `FORM_GUIDANCE_SCALE_INPUT_MAX` is set to `2` characters, the form\n  will become unuseable.  \n  \n## Special tags\n\n* `{random_artists}`  \nAdds 1 to 5 random artists names\n* `{random_tags}`  \nAdds 0 to 4 random tags\n* `{lyuma_cheatcodes}`  \nTry it !\n\nYou can add more by editing [replacers.json](replacers.json)\n\n## Denying prompts\n\nIf the file **config/denied_expressions.txt** exists, each line of these files\nis interpreted as a Regular Expression.  \nWhen a user request an image generation, if the prompt matches any of these\nregular expressions, the generation request is denied.\n\nThis file is **optional** and is not created by default.\n\nThere are various online tools to build Regular Expressions, like, for example,\nhttps://regex101.com/ .\n\n### Examples\n\n### Example 1\n\nUsing the following **config/denied_expressions.txt**\n\n```\nTable\n```\n\nIf the prompt contains the characters \"table\", the generation request\nwill be denied.\n\nMeaning that the prompt :\n\n* \"Hamsters playing roulette around a **tABlE**\" will be denied.  \n* \"Horses in their S**table**s\" will be denied.\n\n![Demonstration of the first example](screenshots/DeniedExpressions_Ex1.png)\n\n### Example 2\n\nUsing the following **config/denied_expressions.txt**\n\n```\n\\bTable\nSofa\\b\nchair\n```\n\nPrompt will be denied if any of thees conditions is true :\n* The prompt contains any word starting with \"table\"\n* The prompt contains any word ending with \"sofa\"\n* The prompt contains the characters \"chair\"\n\nMeaning that the promt :\n* \"A pic-nic **table**\" will be denied.\n* \"People playing **Table**top RPG\" will be denied.\n* \"An Unstable portal\" will be accepted.\n* \"A photo of a bed-**sofa**\" will be denied.\n* \"A world Sofar\" will be accepted.\n* \"Reunion of Arm**chair** general\" will be denied.\n\n![Demonstration of the second example](screenshots/DeniedExpressions_Ex2.png)\n\n### Technical notes\n\nThe regular expressions are compiled with the `re` Python\nstandard library, using only one flag : `re.IGNORECASE`.\n\n## Compact mode\n\nHere are two screenshots with :\n\n* Compact mode disabled (default)  \n  ![Compact mode disabled](./screenshots/Option-Compact-False.png)\n\n* Compact mode enabled (`COMPACT_RESPONSES=True`)  \n  ![Compact mode enabled](./screenshots/Option-Compact-True.png)\n\n# Special notes\n\nIf you're not too familiar with StableDiffusion, remember that this\nwill eat your VRAM for breakfast.\n\nAdd `STABLEDIFFUSION_MODE=fp16` to your `.env` if you want to run in\nFP16 mode, reducing the amount of VRAM used.  \nWhile this can reduce the amount of VRAM used by 1.5 ~ 2 times,\nremember that it's still GPU intensive and VRAM heavy.\n\n# Known bugs\n\n* The 'Job done' message is sent just before the last result, due to\ntiming issues.\n* Invoking `/degudiffusion` from a Discord thread by cause errors,\nsince the software will try to create a thread inside a thread, which\nis not supported by Discord.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fvr-voyage%2Fdegu-diffusion","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fvr-voyage%2Fdegu-diffusion","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fvr-voyage%2Fdegu-diffusion/lists"}