-
Notifications
You must be signed in to change notification settings - Fork 18
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add Stable Diffusion web UI example (#63)
* Add stable-diffusion-webui example * Add Stable Diffusion web UI example * fix lint
- Loading branch information
Showing
4 changed files
with
56 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
# Stable Diffusion web UI | ||
|
||
[Stable Diffusion web UI](https://github.com/AUTOMATIC1111/stable-diffusion-webui.git) is a browser interface based on Gradio library for Stable Diffusion. | ||
|
||
## Install Lepton sdk | ||
```shell | ||
pip install leptonai | ||
``` | ||
|
||
## Launch Stable Diffusion web UI in the cloud | ||
|
||
Similar to other examples, you can run Stable Diffusion web UI on Lepton Cloud Platform easily, e.g.: | ||
|
||
```shell | ||
lep photon create -n stable-diffusion-webui -m photon.py | ||
lep photon push -n stable-diffusion-webui | ||
lep photon run \ | ||
-n stable-diffusion-webui \ | ||
--resource-shape gpu.a10 | ||
--public | ||
``` | ||
|
||
You can visit [dashboard.lepton.ai](https://dashboard.lepton.ai/) to use the web Dashboard, or use `lep` cli to manage the launched deployment: | ||
```shell | ||
lep deployment status -n stable-diffusion-webui | ||
``` | ||
|
||
## Client | ||
|
||
Once the Stable Diffusion web UI server is up, you can copy the deployment url shown on the Lepton Dashboard (or in the `lep` cli output) | ||
|
||
<img src="assets/deployment.png" width=1024> | ||
|
||
and visit it in the web browser | ||
|
||
<img src="assets/browser.png" width=1024> |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
import os | ||
|
||
from leptonai.photon import Photon | ||
|
||
|
||
class WebUI(Photon): | ||
webui_version = "1.6.0" | ||
cmd = [ | ||
"bash", | ||
"-c", | ||
( | ||
"apt-get update && apt-get install -y wget libgoogle-perftools-dev && wget" | ||
f" -q https://raw.githubusercontent.com/AUTOMATIC1111/stable-diffusion-webui/{webui_version}/webui.sh" | ||
" && chmod +x ./webui.sh && ACCELERATE=True ./webui.sh -f --listen --port" | ||
" 8080" | ||
), | ||
] | ||
deployment_template = { | ||
"resource_shape": "gpu.a10", | ||
} |