Getting Started - altoiddealer/ad_discordbot GitHub Wiki
Great! You installed the bot... now what?
- You will be prompted to enter your "Bot Token" - you must enter this! This is mentioned in Installation.
- All Settings files will automatically be copied into the
/user/settings/directory on first run. You are welcome to manually copy those settings files if you want to get a head start on customization. - You may see an outdated greeting message listing a few of the bot's features!
Applicable even if you are not using Text Generation WebUI! These go in /user/characters/ (and/or TGWUI's /user_data/characters/)
Change characters via /character command.
Character files give "character-specific" control for the following:
- Affect the bot's name and avatar
- Can include Tags definitions
- Can override settings for Behaviors
- Can override settings for Text Generation WebUI parameters, and even TGWUI Extensions!
- Can toggle the visibility of the character in
/charactermenu command (ei: the character can be just a "swap character" - see Tags - Can make the bot join voice channels on startup (can also be done manually via right-click bot name in Discord:
Apps -> Bot Join VC)
In the /examples directory are a number of helpful examples.
You should consider copying most/all of these to your user directory
-
Characters
- M1nty - Includes example usage for all character-specific features
- Prompt_Enhancer_15 / ..XL - Examples of "swap characters" that can be triggered via Tags for image prompt enhancement.
-
Imgmodel_Selector - an example to demonstrate the usage of the
flowTag ("flow" creates a multi-pass event, such as prompting the LLM with one character, then using the result in the next pass)
-
Comfy Workflows
Some example payloads if using ComfyUI which can be loaded/executed via Custom Commands as well as API Calls and Workflows. I suggest organizing these separately from "payloads".
-
Payloads
- You will need to add payloads to your
/user/payloads/for use with APIs. - These are intended to be used in your API Endpoint configurations - You may want to tweak some values but, otherwise, most of this is drop-in ready!
- You will need to add payloads to your
-
Wildcards
You can add
.txtfiles to youruser/wildcards/dir to be used with the Dynamic Prompting feature -
Images
Just some examples of the sort of additional content you can add to your user directory, as input for various bot features.
It is strongly recommended to install Visual Studio Code as this is very good text editor for adjusting the Bot settings (Sorry no fancy Gradio interface!)
You do not have to worry about Updates ruining/discarding your settings - the /user/ directory is ignored by git.
If new main settings are added to config.yaml, you will see a message on script init to alert you of the missing settings, which you can then migrate from /settings_templates whenever you get tired of seeing the cmd warning.
-
Adjust indentation levels for multiple lines:
- Select the lines
- Press
Ctrl + [(decrease) orCtrl + ](increase)
-
Toggle
# commentsfor multiple lines:A quick and easy way to disable/enable data!
- Select the lines
- Press
Ctrl + /
Ensure you understand these basic value types:
- strings (text)
- integers/floats (numbers)
- lists (collection of values)
- dictionaries (collection of key-value pairs)
Expand the window below for a quick rundown!
Explanation of Each Value Type
-
String:
A piece of text. Write it as-is, or put it in quotes if it has special characters or spaces.
Example:
name: Alice
-
Integer / Float:
A number. Integers have no decimals, floats do.
Example:
age: 30 # integer weight: 65.5 # float
-
List:
A collection of values. Lists can be written in two ways:
-
Hyphen style (block format) – each value starts with a
-fruits: - apple - banana - orange -
Brackets (inline format) – all items in one line
fruits: [apple, banana, orange]
-
-
Dictionary:
A collection of key-value pairs (think of a mini list of labels and their values).
Example:
person: name: Bob age: 40
YAML uses indentation (spaces) to show what belongs to what. Think of it like outlining ideas. Items that are "inside" something else are indented under it. Try out the hotkeys in VS Code, making this a breeze!
-
dict_base_settings.yaml mirror the bot's internal defaults - customize these for your base-level settings.
-
Character-specific settings (in character files), ImgModel Settings, and any overrides from Tags will have higher priority.
Not to be confused with internal bot settings - there are many options at your fingertips on the Discord side.
Take some time to explore Permissions in your server that are associated with the bot.
- Adjust which channels the bot may join
- Limit commands to certain roles/etc
Applicable if you installed the bot with TGWUI Integration
-
Model-specific settings are handled in same fashion as in the Web UI (are read from
/text-generation-webui/user_data/models/config-user.yaml).It's recommended to load each model with your desired settings (in the Web UI) and click "Save Settings".
Screenshot
-
Any TGWUI command line flags can be used in the bot's CMD_FLAGS.txt
-
Startup with a specific model (do not need to include model param flags if you saved model params via the WebUI as described above)
-
Launching TGWUI extensions (most should be compatible, but not all!)
-
-
The bot acknowledges all TGWUI user data (characters, presets, grammar, instruction templates, etc).
-
The bot has it's own internal history management system. By default, the bot will export chat histories to the TGWUI
/user_data/logs. This can be disabled in config.yaml -
You can change LLM models (or unload!) at any time via
/llmmodelcommand.
This bot is designed to use virtually any API-enabled image generation software.
There is additional convenience and features for "Known" ImgGen APIs: ComfyUI, SD Forge, SD ReForge, SwarmUI, and Automatic1111
- Enable
imggenin config.yaml - Ensure that you have payloads for txt2img / img2img in your
/user/payloadsdirectory - recommended to just copy them from Examples as described here. - In your
api_settings.yamlconfig file, ensure that:
- Your Imggen API is named in the
main_bot_functionssection - Your Imggen API(s) are "enabled"
- The
payload_base(the payload file) is correctly linked in the**txt2img / img2img**endpoints.
- If you are NOT using one of the "Known APIs", you'll need to Carefully follow the instructions from this section down
The bot has sophisticated methods in place to correctly apply LoRAs for ALL known APIs (mentioned above) when used in prompts / injected via Tags system.
Expected format: <lora:Name-Of-The-Lora:1.0>
YOU DO NOT NEED TO INCLUDE SUBDIRECTORY IN THE LORA NAME
(Example: YOU DO NOT NEED SDXL HERE: <lora:SDXL/My-XL-Lora:1.0>)
The bot has sophisticated methods in place to correct MOST invalid sampler names / schedulers - if you are switching between APIs.
These APIs have the best build-in support for ControlNet, ReActor (face swapping), as well as some other extension support.
The bot uses a sophisticated Payload Injection System for complicated payloads such as the ones used by ComfyUI.
To make management even easier, there are Utility scripts
-
inject_placeholders.bat- Adds a default "overrides" to your workflow, and attempts to plug in"{{variable_syntax}}"wherever keys are matched (you will likely still have to go in and link a few values manually) -
resolve_placeholders.bat- Use this to essentially revert the changes of the utility above (injects the override values, then deletes the overrides dictionary)
The Custom Commands feature was designed with ComfyUI in mind! This is an amazing way to execute any workflows - quickly and easily create as many as you wish! Very flexible and powerful!!
I'm not personally very experienced with using SwamUI, but I went through great lengths to ensure compatibility.
SwarmUI users will be pleased to see how everything works!