I built the Bento Model locally so I could build and run it myself to test it out before deploying into onto an EC2 instance on AWS.The pre-requisites listed are a full-er list of what is required to deploy a Stable Diffusion model to EC2. The dependencies listed in the BentoML tutorial are not complete.I initially tried on Windows and ended up wasting a lot of issue with invalid paths and configuration. Some tips and gotchas in getting Stable Diffusion running on AWS. At a high level, the tutorial describes how to download a pre-built Stable Diffusion Model, or build your own build a Docker image of the Stable Diffusion Model and Web API and push to AWS ECS, and deploy the Docker image onto a chunky AWS Virtual Server with GPU firepower. Start with setting up Stable Diffusion on AWS. BentoML is a Python framework that makes it easy to create and deploy Machine Learning services at scale. The new technology in this list to me was BentoML. You will need admin access to an AWS subscription to spin up the required resources for the Stable Diffusion Bot. You will need admin access to a slack workspace to create a Bot for your workspace. A local installation of Docker, Python (latest stable version), Terraform, AWS CLI, BentoML.I recommend Mac OS or Linux for less debugging issues. A local environment running Windows, Mac OS, or Linux.This solution utilises the following technologies: Perhaps I’ll try do the same with Google Colab and do some cost comparisons. As with all technical solutions, there are many ways to skin a cat (riding a bicycle) and there are definitely more simply ways to do this using platforms such as Google Colab. This isn’t a forensically detailed set of instructions, but hopefully provides enough of a guide to help you get it going and steer you in the right direction. A picture of a ‘Cat riding a bike’ appears in slack.Lambda returns response payload to Slack, including URL to new image.Lambda saves the image to an s3 bucket, accessible over HTTPS.Lambda gets image by calling Stable Diffusion API passing in text prompt and image generation parameters.Stable Diffusion Image handler picks up new message in the queue and extracts the prompt.Slack command handler creates message in SQS for asynchronous processing, and returns a response to Slack that the image will appear when ready.Slack sends slash command payload to Lambda function.User types /stablediffusion a cat riding a bicycle.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |