diff --git a/advanced/stable-diffusion-webui/README.md b/advanced/stable-diffusion-webui/README.md new file mode 100644 index 0000000..4ebda74 --- /dev/null +++ b/advanced/stable-diffusion-webui/README.md @@ -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) + + + +and visit it in the web browser + + diff --git a/advanced/stable-diffusion-webui/assets/browser.png b/advanced/stable-diffusion-webui/assets/browser.png new file mode 100644 index 0000000..4c711bc Binary files /dev/null and b/advanced/stable-diffusion-webui/assets/browser.png differ diff --git a/advanced/stable-diffusion-webui/assets/deployment.png b/advanced/stable-diffusion-webui/assets/deployment.png new file mode 100644 index 0000000..6d49f27 Binary files /dev/null and b/advanced/stable-diffusion-webui/assets/deployment.png differ diff --git a/advanced/stable-diffusion-webui/photon.py b/advanced/stable-diffusion-webui/photon.py new file mode 100644 index 0000000..3ad6b26 --- /dev/null +++ b/advanced/stable-diffusion-webui/photon.py @@ -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", + }