An app (and template for apps) that use stable diffusion and can be deployed as a XetHub Capsule!
README.md
Stable Diffusion Text To Image Demo
Local Setup Instructions
This app demo app was developed with python 3.9 as the target version, however newer version are likely to work as well. It is recommended to use virtual environment locally.
Here are the quick setup commands (for linux or macOS):
# create and activate virtual environment (called venv)
python -m venv venv
source venv/bin/activate
# install dependencies
pip install -r requirements.txt
Environment Variables and Configuration
In the current version of the app we use OctoML's OctoAI service for image generation.
The app expect to find 2 environment variables, either set through the command line e.g. export OCTOAI_TOKEN=<token>
, or in a .env
file.
OCTOAI_TOKEN
needs to have your OctoAI token that you need to have to use the service- Instructions to set it up can be found at https://docs.octoai.cloud/docs/how-to-create-an-octoai-access-token
OCTOAI_PUBLIC_ENDPOINT
needs to be set to an OctoAI demo inference point, either a template or one that you owned.- This initial model app assumes this endpoint follows the "Stable Diffusion 1.5" template (https://octoai.cloud/templates/stable-diffusion-demo)
- Particularly using the
text2img
path on that template endpoint
- Particularly using the
- This initial model app assumes this endpoint follows the "Stable Diffusion 1.5" template (https://octoai.cloud/templates/stable-diffusion-demo)
Example .env file
OCTOAI_TOKEN=<token>
OCTOAI_PUBLIC_ENDPOINT=<endpoint>
This app also requires XetHub environment variables to support writing back to the project. Make sure to export the following:
XET_USER_NAME=
XET_USER_TOKEN=
XET_USER_EMAIL=
File List | Total items: 8 | ||
---|---|---|---|
Name | Last Commit | Size | Last Modified |
images | |||
.gitattributes | |||
.gitignore | |||
README.md | |||
app.py | |||
config.py | |||
placeholder.png | |||
requirements.txt |
About
An app (and template for apps) that use stable diffusion and can be deployed as a XetHub Capsule!