User Installable Discord Sticker Bot using Diffusion Models.
Navigate to the Discord Developer Portal and create an application, (remember to save the API key/token generated during setup).
Configuring the discord application is covered in detail in the tutorial.
Click on the Installation page in your app's settings and go to the Default Install Settings section.
For user install:
applications.commands
For guild install:
applications.commands
bot
(with Send Messages enabled)
The installation link for the app can be found in the Discord Developer Portal at Installation > Installation Link
- Copy the
.env.public
file at the root of the project and rename it to.env
. - Add your token generated during setup to
DISCORD_TOKEN
and under navigate to General Information > Application ID in the Discord developer portalDISCORD_CLIENT_ID
An inference endpoint is an entrypoint into an ML model that allows users to input a query and receive a response. We're using Hugging Face's Inference Endpoints to easily deploy and manage the model.
-
Deploy your endpoint using the STUDs/sdxl-ddiff model that we've created under
Model Repository
. -
Retrieve the Endpoint URL from the dashboard and set it to
HF_ENDPOINT
. Then naviagate to Settings > Access Tokens and generate a UAT (User Access Token) and setting it to theHF_TOKEN
Once you've pulled the code and populated the .env
file with the associated variables, you can now install the app and run the server to handle user requests!
When first running the server or modifying commands run the code below to register/refresh the commands with your Discord app
npm run register
> Started refreshing 1 application (/) commands.
> Successfully reloaded 1 application (/) commands.
To run the server use the command below. If successful it will respond with a message saying that you're logged in!
bash run.sh dev
> Ready! Logged in as Sticker Gen#1575
You're now ready to start generating stickers to use in Discord DMs or servers
Follow the quickstart to setup Fly.io and then run
fly launch
to build, configure, and deploy the discord bot! You can manually deploy with fly deploy
.
If you want to deploy using a docker image, you can simply call
bash run.sh prod
which will build the appropriate image for deployment.
- Setup inference endpoint for SDXL-base-1.0 lightning
- Integrate discord bot with inference endpoint
- Deployment with fly.io
- Regenerate sticker functionality
- Experiment with segmentation (SAM) to remove sticker backgrounds
- Experiment with other LCM models to reduce latency and increase quality
- Finetuning diffusion models with KohyaSS