xingren23/ComfyFlowApp

Build your workflow app on RunPod

Closed this issue · 0 comments

Creating a workflow application website can be challenging for ComfyUI developers.
Developing the workflow is demanding, and getting others to use it is even more so, due to environment setup issues, custom ComfyUI node issues, model downloading problems, among others. With ComfyFlowApp and ComfyUI, creators can easily build their own workflow application websites.

Taking RunPod as an example, this explains how to use ComfyFlowApp and ComfyUI to construct your own workflow application website.

1. Deploy RunPod GPU instance

Choose an RTX 3080 Ti with 12GB VRAM as an example. The cost is $0.19 per hour. If we opt for Spot mode, the price drops to $0.15 per hour.
image

After the instance is launched, you can connect to the RunPod instance using SSH, or access the instance through Jupyter Notebook. The following is an explanation using SSH as an example.
Configure port mapping and modify ports 8888, 8188, 8501.
Changing the mapped ports will cause the server to restart. Content outside the /workspace directory will be lost, so we map the port first.
image

2. Deploy and start ComfyUI

# enter workspace
cd /workspace

# git clone comfyui
root@bee82bea846d:/workspace# git clone https://github.com/comfyanonymous/ComfyUI
Cloning into 'ComfyUI'...
remote: Enumerating objects: 9222, done.
remote: Counting objects: 100% (2875/2875), done.
remote: Compressing objects: 100% (309/309), done.
remote: Total 9222 (delta 2668), reused 2573 (delta 2565), pack-reused 6347
Receiving objects: 100% (9222/9222), 3.75 MiB | 16.08 MiB/s, done.
Resolving deltas: 100% (6232/6232), done.

# download runway-sd-1.5 from huggingface to models/checkpoints
cd ComfyUI
wget https://huggingface.co/runwayml/stable-diffusion-v1-5/resolve/main/v1-5-pruned-emaonly.safetensors?download=true -O models/checkpoints/v1-5-pruned-emaonly.safetensors

# install comfyui
 pip install -r requirements.txt
 
 # start comfyui
root@ec4c6cf781e2:/workspace/ComfyUI# python main.py --listen=0.0.0.0
Total VRAM 12045 MB, total RAM 257901 MB
Set vram state to: NORMAL_VRAM
Device: cuda:0 NVIDIA GeForce RTX 3080 Ti : cudaMallocAsync
VAE dtype: torch.bfloat16
Using pytorch cross attention
Starting server

To see the GUI go to: http://0.0.0.0:8188

3. Deploy and start ComfyFlowApp

cd /workspace

# clone comfyflowapp
git clone https://github.com/xingren23/ComfyFlowApp

# install comfyflowapp
cd ComfyFlowApp
pip install -r requirement

# start comfyflowapp
root@ec4c6cf781e2:/workspace/ComfyFlowApp# sh bin/creator_run.sh
/workspace/ComfyFlowApp

Collecting usage statistics. To deactivate, set browser.gatherUsageStats to False.


  You can now view your Streamlit app in your browser.

  Network URL: http://172.24.0.2:8501
  External URL: http://194.26.196.133:8501

4. Access

Check ComfyUI and ComfyFlowApp is alive, click the button to access in public
image

Gen a image from ComfyUI default workflow, and download image local
image

Create app from comfyui workflow,
image

Run, preview/install and then run app in My Apps
image