PWA Web App front end for Stable Diffusion, on React/NextJS with Material UI
Copyright (c) 2022 by Gadi Cohen dragon@wastelands.net. MIT Licensed.
Why? Make this fun stuff more accessible to web developers and friends :) See the live demo, run on your own PC for free, or deploy!
If you have a background in web dev / dev ops, and have wanted to experiment a bit with machine learning / latent diffusion (AI image generation), this is a great project to get involved in :)
Doing this in my very limited spare time, PRs more likely to get responses than issues, but try me :)
yarn install
.env.local
yarn dev
Note: you'll need at least one destination / target from the list below where Stable Diffusion will run.
Local docker image (recommended)
Local Exec
STABLE_DIFFUSION_HOME
(to e.g. /home/user/src/stable-diffusion
).Remote BananaDev docker container (serverless GPU)
NODE_ENV=="production"
BANANA_API_KEY
and BANANA_MODEL_KEY
env variables.BANANA_MODEL_KEY_SD_v1_5
by default.By default, registration (i.e. sign up, log in, use credits) is required in production only. You can turn it on in development (to test the auth flow), or turn it off in production (if you're deploying somewhere private).
REQUIRE_REGISTRATION=1
NEXT_PUBLIC_REQUIRE_REGISTRATION=1
Note: NEXT_PUBLIC_
vars are compiled at build time! So if you want to deploy to production without requiring registration, set it to 0
before building and deploying.
We use NextJS's built-in i18n routing and Lingui for translations.
Useful commands:
yarn i18n:extract
to extract strings.locales/*/messages.po
to translators, resave.yarn i18n:compile
before deploy.See also lingui.config.js and locales dir.