### Introduction
[Distillery](https://distillery.dev/) is a [Discord](https://discord.com/) based service that allows users to generate images using the Distillery system. It handles user interactions, manages subscriptions and credits, and coordinates with other components of the system.
*This is a technical documentation for the code that runs [Distillery](https://distillery.dev/). For user documentation and how to use the service, check out [User Documentation](https://distillery-dev.github.io/site/)*
### About this Documentation
The intent of this documentation is to allow anyone interested in the system (human or llm) to get a full, documented understanding on how things work here and how to contribute. You can continue from here to the following links
###### 1 - Getting Started
1. [[Prerequisites]]
2. [[Installation]] (coming soon)
3. [[Configuration]] (coming soon)
4. [[Distillery Codebase Style Guide]]
###### 2 - System Overview
To get a high-level understanding of how the [[Distillery]] system works, explore the following sections:
1. [[Architecture Overview]]: Get an overview of the main components, their roles, and how they interact with each other.
2. [[Distillery Main Workflow]]: Learn about the typical workflow of the Distillery system, from user input to image generation and delivery.
###### 3 - Components
Dive deeper into each component of the Distillery system:
1. [[Distillery Bot]]: Understand how the main Discord bot interacts with users, handles commands, and manages requests.
2. [[Distillery Master]]: Learn about the master component that coordinates image generation and communicates with the worker.
3. [[Distillery Commands]]: Explore the available commands and how they are implemented.
4. [[Distillery Worker]]: Discover how the worker component generates images using the Runpod platform and ComfyUI.
###### 4 - Additional Components
1. [[distillery_aws]] - responsible for managing interactions with various AWS services and handling database operations
2. [[distillery_outputparser]] - responsible for parsing and validating user input, applying parsing rules, and preparing the parsed output for further processing.
3. [[distillery_payloadbuilder]] - responsible for constructing and preparing payloads for image generation requests. It plays a crucial role in transforming user inputs and configuration settings into a format that can be processed by the image generation backend.
4. [[distillery_rawinputparser]] - responsible for parsing and processing user input before it's passed to other components for further processing and image generation. It provides functionality to convert raw user input into a structured format, handle parameter parsing, and consolidate parsed data.
5. [[distillery_outputloader]] - responsible for processing and uploading files, handling image metadata, and creating command strings.
6. [[distillery_maskmaker]] - a specialized component responsible for creating and manipulating image masks. It provides functionality to generate grid overlays, render masks on images, and prepare masked images for sending to users via Discord.
###### Other Topics
Explore additional topics related to the Distillery system:
1. [[Configuration Files]]: Learn about the various configuration files used in the system and how to customize them.
2. [[Deployment]]: Instructions on how to deploy the Distillery system using Docker and set up the required AWS services.
3. [[Testing]]: Guidelines on writing and running tests for the Distillery system.
4. [[Logging]]: Learn how the system handles logging using AWS CloudWatch.
5. [[Caching]]: Understand how AWS Memcached is used for caching and handling concurrent requests.
6. [[Database]]: Explore the MySQL database schema and how it stores request data, user information, and queues.
###### Contributing
If you're interested in contributing to the Distillery project, check out the [[Contributing Guidelines (coming soon)]] to learn about the development process, coding conventions, and how to submit pull requests. Until everything is properly setup, reach out to us
[email protected]
###### Support and Feedback
If you have any questions, issues, or suggestions regarding the Distillery system or this documentation, please reach out to the Distillery team or open an issue on the [Distillery GitHub repository (soon tm)]().
We hope this documentation helps you understand and work with the Distillery system effectively. Happy exploring!