Prototype an app using Automatic1111 API mode
Learn from Thierry Moreau, Co-Founder at OctoML, how to prototype a web app using SDXL with Automatic1111 web UI. Key things to note are setting your SDXL resolution to 1024 x 1024, and using style presets in order to achieve artistic consistency for your app.
Building Aquarelle with Automatic1111
Our app Aquarelle, the french word for watercolor painting, uses a watercolor style to let you generate beautiful images using nothing but a text prompt. Automatic1111 is good for experimenting and iterating fast for app ideas using Stable Diffusion because it is open source and free to use. If you do not have access to a powerful GPU, to run SDXL, you can sign up and use OctoAI. OctoAI also allows you to launch a Docker container with Automatic1111 preinstalled in it.
Create a cloud endpoint to run Automatic1111 WebUI
Sign up for OctoAI account and get $10 of free credit
Go to Compute Service -> My endpoints
Create a custom endpoint
Name your endpoint
Use the following container image:
258175030240.dkr.ecr.us-east-1.amazonaws.com/template-images:sdwebui-tools-v0.1.2
Enable public access
Select the medium hardware tier or higher
Under “configure autoscaling” set min and max replicas to 1
Leave all other fields as default values
“Create” your endpoint
To not run out of OctoAI credits you can pause the endpoint to stop billing and the usage of your endpoint. Simply select the endpoint you launched and click “Pause Endpoint”.
Using Automatic1111 to generate desired images
Start testing out your endpoint in Automatic1111’s (A1111) webUI with any prompt you want, we decided on “a dog trick or treating”. To improve the image quality and consistency we will need to make some adjustments to the parameters:
Set the image resolution to 1024 x 1024 for best SDXL image quality
Update the batch count to 4, to get a handful of images
Select a style from A1111 drop down menu for artistic consistency
We used watercolor for our desired app outcome
The style adds specific manipulations to your prompts to achieve the selected style
See below the generated image the prompt parameters used, and how they differ from default, or with no style selected
Conclusion and next steps
A prototype app using SDXL in Automatic1111 was created in under 5 minutes. Using style presets showcased simple prompt engineering to achieve consistency. Stay tuned because next we will build a NextJS app that calls Automatic1111 in API mode to use SDXL.
Your choice of models on our SaaS or in your environment
Run any model or checkpoint on our efficient, reliable, and customizable API endpoints. Sign up and start building in minutes.