Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add ComfyUI example #66

Merged
merged 2 commits into from
Dec 15, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
36 changes: 36 additions & 0 deletions advanced/comfyui/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
# ComfyUI

[ComfyUI](https://github.com/comfyanonymous/ComfyUI.git) is a powerful and modular stable diffusion GUI and backend that let you design and execute advanced stable diffusion pipelines using a graph/nodes/flowchart based interface.

## Install Lepton sdk
```shell
pip install leptonai
```

## Launch Stable Diffusion web UI in the cloud

Similar to other examples, you can run ComfyUI on Lepton Cloud Platform easily, e.g.:

```shell
lep photon create -n comfyui -m photon.py
lep photon push -n comfyui
lep photon run \
-n comfyui \
--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 comfyui
```

## Client

Once the ComfyUI 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. e.g. running the sdxl + svd models to do text to video:

<img src="assets/browser.png" width=1024>
Binary file added advanced/comfyui/assets/browser.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added advanced/comfyui/assets/deployment.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
18 changes: 18 additions & 0 deletions advanced/comfyui/photon.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
from leptonai.photon import Photon


class ComfyUI(Photon):
comfyui_version = "329c571"
cmd = [
"bash",
"-c",
(
"pip install aiohttp einops torchsde &&"
"git clone --recursive https://github.com/comfyanonymous/ComfyUI.git && cd"
f" ComfyUI && git checkout {comfyui_version} && python main.py --listen"
" 0.0.0.0 --port 8080"
),
]
deployment_template = {
"resource_shape": "gpu.a10",
}