This project encompasses the "client" for the TRON WebSocket hub.
This codebase is capable of:
This client code requires the TRON master node to be configured and running properly, before it is useful. See that project page for details.
This project is undergoing active development. It has no API for extensions, and currently, extending it for new functionality is an involved process.
Expect to have things break on update sometimes, especially through the more experimental features. Older stuff is unlikely to break, and newer things are more likely to have frequent changes.
This is developed on a laptop with 8GB of VRAM but that requires disabling much of the project's abilities. You can use either Bark, or Stable Diffusion, but trying to run both in the bot on 8GB of VRAM, is not currently possible.
Most modern image models will just simply not run on 8GB VRAM anymore.
It's an "easy fix", but just not something that has been a focus.
For better luck, you want to have 24GB of VRAM. This allows use of native 1080p render outputs without VAE tiling, which greatly improves the coherence of the resulting images.
For using this bot to run large language models, 24GB can work, but 48GB is recommended. Again, it's an "easy fix" (the same one mentioned three sentences ago) that just has yet to be implemented.
For the truly gluttenous and wasteful, an 80GB A100 is capable of loading every aspect of this bot at once, and running all of those pipes concurrently.
python -m venv .venv/
. .venv/bin/activate
pip install poetry
poetry install
Create an initial OAuth token and SSL key & cert via your master node.
Copy the resulting OAuth token output to discord_tron_client/config/auth.json
Copy the resulting SSL key and certificate files to discord_tron_client/config
Copy discord_tron_client/config/example.json to discord_tron_client/config/config.json
Update the values in config.json to point to your WebSocket server host and port:
"websocket_hub": {
"host": "example.net",
"port": 6789,
"tls": true,
"protocol": "wss"
}
. .venv/bin/activate # Always ensure you're in the virtual environment first.
# If it says "poetry: command not found", you might need to rebuild your venv.
poetry run client > worker.log 2>&1
classes/: A somewhat-structured folder for many useful classes.
These classes handle the backend work for LLMs, image diffusion, etc.config/: You will have to set up the client, SSL keys & auth ticket here.message/: WebSocket message templates for sending requests to the master.modules/: Some of the WebSocket command handlers are located here.ws_client/: The WebSocket client code which handles auth and connection.LICENSE: The Silly Use License (SUL-1.0), because why not have some fun
while coding? πTo add a new !command to the bot:
worker_processor class, indicating
your handler for an incoming payload in your module.modules/ directory, following
existing patterns implemented by other modules. Any improvement to this
pattern is welcomed, as we're always looking to improve extensibility.Although this project is extensively tested on a laptop with 8GB of VRAM, currently, GPU memory can be easily exhausted if you're doing "lots of things".
Furthermore, 8GB simply isn't enough for most of this bot to work correctly. The TTS engine, language models, and image models, currently cannot signal to each other that they need to evacuate GPU memory space back to the CPU.
Workaround: Restart the worker.
Due to the asynchronous nature of WebSockets, sending a message to the master node does not return a response. There's not any good infrastructure yet in the project to handle waiting for and receiving a given response to a given message. This means that "linear" programming style is hard to pull off in this project, and a routine that needs a lot of coordinated back-and-forth between subsystems is currently very difficult to do.
Example: Using this project to tie the image generation, TTS, and LLMs
into a replacement for the bghira/chatgpt-video-generator project would
require implementing this infrastructure, opening modules up to this
new workflow.
1,248 commits
Python
100.0%
This project encompasses the "client" for the TRON WebSocket hub.
This codebase is capable of:
This client code requires the TRON master node to be configured and running properly, before it is useful. See that project page for details.
This project is undergoing active development. It has no API for extensions, and currently, extending it for new functionality is an involved process.
Expect to have things break on update sometimes, especially through the more experimental features. Older stuff is unlikely to break, and newer things are more likely to have frequent changes.
This is developed on a laptop with 8GB of VRAM but that requires disabling much of the project's abilities. You can use either Bark, or Stable Diffusion, but trying to run both in the bot on 8GB of VRAM, is not currently possible.
Most modern image models will just simply not run on 8GB VRAM anymore.
It's an "easy fix", but just not something that has been a focus.
For better luck, you want to have 24GB of VRAM. This allows use of native 1080p render outputs without VAE tiling, which greatly improves the coherence of the resulting images.
For using this bot to run large language models, 24GB can work, but 48GB is recommended. Again, it's an "easy fix" (the same one mentioned three sentences ago) that just has yet to be implemented.
For the truly gluttenous and wasteful, an 80GB A100 is capable of loading every aspect of this bot at once, and running all of those pipes concurrently.
python -m venv .venv/
. .venv/bin/activate
pip install poetry
poetry install
Create an initial OAuth token and SSL key & cert via your master node.
Copy the resulting OAuth token output to discord_tron_client/config/auth.json
Copy the resulting SSL key and certificate files to discord_tron_client/config
Copy discord_tron_client/config/example.json to discord_tron_client/config/config.json
Update the values in config.json to point to your WebSocket server host and port:
"websocket_hub": {
"host": "example.net",
"port": 6789,
"tls": true,
"protocol": "wss"
}
. .venv/bin/activate # Always ensure you're in the virtual environment first.
# If it says "poetry: command not found", you might need to rebuild your venv.
poetry run client > worker.log 2>&1
classes/: A somewhat-structured folder for many useful classes.
These classes handle the backend work for LLMs, image diffusion, etc.config/: You will have to set up the client, SSL keys & auth ticket here.message/: WebSocket message templates for sending requests to the master.modules/: Some of the WebSocket command handlers are located here.ws_client/: The WebSocket client code which handles auth and connection.LICENSE: The Silly Use License (SUL-1.0), because why not have some fun
while coding? πTo add a new !command to the bot:
worker_processor class, indicating
your handler for an incoming payload in your module.modules/ directory, following
existing patterns implemented by other modules. Any improvement to this
pattern is welcomed, as we're always looking to improve extensibility.Although this project is extensively tested on a laptop with 8GB of VRAM, currently, GPU memory can be easily exhausted if you're doing "lots of things".
Furthermore, 8GB simply isn't enough for most of this bot to work correctly. The TTS engine, language models, and image models, currently cannot signal to each other that they need to evacuate GPU memory space back to the CPU.
Workaround: Restart the worker.
Due to the asynchronous nature of WebSockets, sending a message to the master node does not return a response. There's not any good infrastructure yet in the project to handle waiting for and receiving a given response to a given message. This means that "linear" programming style is hard to pull off in this project, and a routine that needs a lot of coordinated back-and-forth between subsystems is currently very difficult to do.
Example: Using this project to tie the image generation, TTS, and LLMs
into a replacement for the bghira/chatgpt-video-generator project would
require implementing this infrastructure, opening modules up to this
new workflow.
1,248 commits
Python
100.0%