From f7efde4eb5836261e0059ed81f5fcc50c09e5ce4 Mon Sep 17 00:00:00 2001 From: Robert Wojciechowski Date: Tue, 29 Jul 2025 13:40:18 +1000 Subject: [PATCH 01/27] Update README.md --- README.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 70405d6..8e29039 100644 --- a/README.md +++ b/README.md @@ -9,7 +9,7 @@

-> **A powerful extension for ComfyUI that enables distributed and parallel processing across multiple GPUs and machines. Generate more images and videos and accelerate your upscaling workflows by leveraging all available GPU resources in your network.** +> **A powerful extension for ComfyUI that enables distributed and parallel processing across multiple GPUs and machines. Generate more images and videos and accelerate your upscaling workflows by leveraging all available GPU resources in your network and cloud.** ![Clipboard Image (7)](https://github.com/user-attachments/assets/66aaadef-f195-48a1-a368-17dd0dae477d) @@ -143,4 +143,4 @@ This software is provided "as is" without any warranties, express or implied, in --- ## Support the Project -If my custom nodes have added value to your workflow, consider fueling future development with a coffee! Your support helps keep this project thriving. Buy me a coffee at: https://buymeacoffee.com/robertvoy \ No newline at end of file +If my custom nodes have added value to your workflow, consider fueling future development with a coffee! Your support helps keep this project thriving. Buy me a coffee at: https://buymeacoffee.com/robertvoy From b7c7c033d5eb37e2fedd4f2249125525387d72e2 Mon Sep 17 00:00:00 2001 From: Robert Wojciechowski Date: Tue, 29 Jul 2025 13:40:53 +1000 Subject: [PATCH 02/27] Update pyproject.toml --- pyproject.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pyproject.toml b/pyproject.toml index 7449463..304d50d 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,7 +1,7 @@ [project] name = "ComfyUI-Distributed" description = "ComfyUI extension that enables multi-GPU processing locally and remotely " -version = "1.0.2" +version = "1.0.3" license = {file = "LICENSE"} dependencies = [] From ff02c88224fa36aca352152568dbe10445f226c1 Mon Sep 17 00:00:00 2001 From: Robert Wojciechowski Date: Tue, 29 Jul 2025 13:45:49 +1000 Subject: [PATCH 03/27] Update README.md --- README.md | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index 8e29039..d29f2bd 100644 --- a/README.md +++ b/README.md @@ -50,7 +50,8 @@ git clone https://github.com/robertvoy/ComfyUI-Distributed.git ``` -2. **Restart ComfyUI** - If you'll be using remote/cloud workers, add `--enable-cors-header` to your launch arguments on the master +2. **Restart ComfyUI** + - If you'll be using remote/cloud workers, add `--enable-cors-header` to your launch arguments on the master 3. Read the [setup guide](https://github.com/robertvoy/ComfyUI-Distributed/blob/feature/cloud-workers/docs/worker-setup-guides.md) for adding workers From f5a1e59d65735863e7e17501828911b6015747d1 Mon Sep 17 00:00:00 2001 From: Robert Wojciechowski Date: Tue, 29 Jul 2025 13:48:56 +1000 Subject: [PATCH 04/27] Update worker-setup-guides.md --- docs/worker-setup-guides.md | 29 ++++++++++++++++------------- 1 file changed, 16 insertions(+), 13 deletions(-) diff --git a/docs/worker-setup-guides.md b/docs/worker-setup-guides.md index 0b2f242..ae625f3 100644 --- a/docs/worker-setup-guides.md +++ b/docs/worker-setup-guides.md @@ -38,14 +38,15 @@ ComfyUI-Distributed allows you to distribute your workflows across multiple GPUs 3. **Open** the ComfyUI port (e.g., 8188) and any additional worker ports (e.g., 8189, 8190) in the firewall. **On the Main Machine:** -1. **Open** the Distributed GPU panel (sidebar on the left). -2. **Click** "Add Worker." -3. **Choose** "Remote". -4. **Configure** your remote worker: +1. **Launch** ComfyUI with `--enable-cors-header` launch argument. +2. **Open** the Distributed GPU panel (sidebar on the left). +3. **Click** "Add Worker." +4. **Choose** "Remote". +5. **Configure** your remote worker: - **Name**: A descriptive name for the worker (e.g., "Server Rack GPU 0") - **Host**: The remote worker's IP address. - **Port**: The port number used when launching ComfyUI on the remote master/worker (e.g., 8188). -5. **Save** the remote worker configuration. +6. **Save** the remote worker configuration. ## Cloud workers > ComfyUI instances running on a cloud service like [Runpod](https://get.runpod.io/0bw29uf3ug0p). @@ -71,8 +72,9 @@ ComfyUI-Distributed allows you to distribute your workflows across multiple GPUs - Then run, for example: `cloudflared-windows-amd64.exe tunnel --url http://localhost:8188` > Cloudflare tunnels create secure connections without exposing ports directly to the internet 2. Copy the Cloudflare address -3. **Open** the Distributed GPU panel (sidebar on the left). -4. **Edit** the Master's host address and replace it with the Cloudflare address. +3. **Launch** ComfyUI with `--enable-cors-header` launch argument. +4. **Open** the Distributed GPU panel (sidebar on the left). +5. **Edit** the Master's host address and replace it with the Cloudflare address. - **Click** "Add Worker." - **Choose** "Cloud". - **Configure** your cloud worker: @@ -98,11 +100,12 @@ ComfyUI-Distributed allows you to distribute your workflows across multiple GPUs - Download from here: [https://github.com/cloudflare/cloudflared/releases](https://github.com/cloudflare/cloudflared/releases) - Then run, for example: `cloudflared-windows-amd64.exe tunnel --url http://localhost:8188` 2. **Copy** the Cloudflare address -3. **Open** the Distributed GPU panel (sidebar on the left). -4. **Edit** the Master's host address and replace it with the Cloudflare address. -5. **Click** "Add Worker." -6. **Choose** "Cloud". -7. **Configure** your cloud worker: +3. **Launch** ComfyUI with `--enable-cors-header` launch argument. +4. **Open** the Distributed GPU panel (sidebar on the left). +5. **Edit** the Master's host address and replace it with the Cloudflare address. +6. **Click** "Add Worker." +7. **Choose** "Cloud". +8. **Configure** your cloud worker: - **Host**: The remote worker's IP address/domain - **Port**: 443 -8. **Save** the remote worker configuration. +9. **Save** the remote worker configuration. From a58ca1fc1d5e2821bf6b428e7413ce2afe847fd6 Mon Sep 17 00:00:00 2001 From: Robert Wojciechowski Date: Tue, 29 Jul 2025 13:50:22 +1000 Subject: [PATCH 05/27] Update worker-setup-guides.md --- docs/worker-setup-guides.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/worker-setup-guides.md b/docs/worker-setup-guides.md index ae625f3..f5206d8 100644 --- a/docs/worker-setup-guides.md +++ b/docs/worker-setup-guides.md @@ -63,7 +63,7 @@ ComfyUI-Distributed allows you to distribute your workflows across multiple GPUs 7. Access your pod using JupyterLabs. 8. Download models into /workspaces/ComfyUI/models/ (these will remain on your network drive even after you terminate the pod). > You can use [this guide](model-download-script.md) to make this process easy for you. It will generate a shell script that will automatically download the models you need for a given workflow. -8. If using your own template, make sure you launch ComfyUI with the `--enable-cors-header` argument and you git clone ComfyUI-Distributed into custom_nodes. ⚠️ **Required!** +8. If using your own template, make sure you launch ComfyUI with the `--enable-cors-header` argument and you `git clone ComfyUI-Distributed` into custom_nodes. ⚠️ **Required!** 9. Download any additional custom nodes using the ComfyUI Manager. **On the Main Machine:** From 285710bb28aa2c795b4bc2435dced37ede265a72 Mon Sep 17 00:00:00 2001 From: Robert Wojciechowski Date: Tue, 29 Jul 2025 13:51:31 +1000 Subject: [PATCH 06/27] Update README.md --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index d29f2bd..b682ced 100644 --- a/README.md +++ b/README.md @@ -53,7 +53,7 @@ 2. **Restart ComfyUI** - If you'll be using remote/cloud workers, add `--enable-cors-header` to your launch arguments on the master -3. Read the [setup guide](https://github.com/robertvoy/ComfyUI-Distributed/blob/feature/cloud-workers/docs/worker-setup-guides.md) for adding workers +3. Read the [setup guide](/docs/worker-setup-guides.md) for adding workers --- From 9926253c8beace702a40e8c87a3be8f9a02ae59b Mon Sep 17 00:00:00 2001 From: Robert Wojciechowski Date: Tue, 29 Jul 2025 13:52:12 +1000 Subject: [PATCH 07/27] Update model-download-script.md --- docs/model-download-script.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/docs/model-download-script.md b/docs/model-download-script.md index 0ec346f..aeb7d00 100644 --- a/docs/model-download-script.md +++ b/docs/model-download-script.md @@ -3,8 +3,8 @@ This guide will walk you through creating a shell script to automatically download the necessary models for your ComfyUI workflow, leveraging an advanced Large Language Model (LLM). 1. Launched the Pod with these Environment Variables: - - CIVITAI_API_TOKEN ([get your token here](https://civitai.com/user/account)) - - HF_API_TOKEN ([get your token here](https://huggingface.co/settings/tokens)) + - `CIVITAI_API_TOKEN` ([get your token here](https://civitai.com/user/account)) + - `HF_API_TOKEN` ([get your token here](https://huggingface.co/settings/tokens)) 2. In ComfyUI, export your workflow as an API workflow 3. Copy the below prompt and upload the API workflow to a LLM **that has access to the internet** ``` From 0acf557ba54a8a23a3f72cd0fb217cc8af873f6e Mon Sep 17 00:00:00 2001 From: Robert Wojciechowski Date: Tue, 29 Jul 2025 13:53:03 +1000 Subject: [PATCH 08/27] Update model-download-script.md --- docs/model-download-script.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/model-download-script.md b/docs/model-download-script.md index aeb7d00..ea07857 100644 --- a/docs/model-download-script.md +++ b/docs/model-download-script.md @@ -2,7 +2,7 @@ This guide will walk you through creating a shell script to automatically download the necessary models for your ComfyUI workflow, leveraging an advanced Large Language Model (LLM). -1. Launched the Pod with these Environment Variables: +1. Launch the [ComfyUI Distributed Pod](https://console.runpod.io/deploy?template=m21ynvo8yo&ref=ak218p52) with these Environment Variables: - `CIVITAI_API_TOKEN` ([get your token here](https://civitai.com/user/account)) - `HF_API_TOKEN` ([get your token here](https://huggingface.co/settings/tokens)) 2. In ComfyUI, export your workflow as an API workflow From ccb00a7142d8081faea3805f70f8c5628a86418c Mon Sep 17 00:00:00 2001 From: Robert Wojciechowski Date: Tue, 29 Jul 2025 14:01:52 +1000 Subject: [PATCH 09/27] Update README.md --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index b682ced..9b05c14 100644 --- a/README.md +++ b/README.md @@ -18,7 +18,7 @@ ## Key Features #### Parallel Workflow Processing -- Run workflows on multiple GPUs simultaneously with varied seeds +- Run your workflow on multiple GPUs simultaneously with varied seeds, collect results on the master - Scale output with more workers - Supports images and videos From 0fe8485c6cc0774b9e68372c015dd8e553e63451 Mon Sep 17 00:00:00 2001 From: Robert Wojciechowski Date: Tue, 29 Jul 2025 15:28:06 +1000 Subject: [PATCH 10/27] Update README.md --- README.md | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/README.md b/README.md index 9b05c14..976aa26 100644 --- a/README.md +++ b/README.md @@ -34,6 +34,18 @@ --- +## Worker Types + +ComfyUI Distributed supports three types of workers: + +- **Local Workers** - Additional GPUs on the same machine (auto-configured on first launch) +- **Remote Workers** - GPUs on other computers in your network +- **Cloud Workers** - GPUs hosted on services like [Runpod](https://get.runpod.io/0bw29uf3ug0p), accessible via secure tunnels + +> For detailed setup instructions, see the [setup guide](/docs/worker-setup-guides.md) + +--- + ## Requirements - ComfyUI From d247746e220f8c7e385aab12dd954bd2f0c47900 Mon Sep 17 00:00:00 2001 From: Robert Wojciechowski Date: Tue, 29 Jul 2025 15:58:26 +1000 Subject: [PATCH 11/27] Update worker-setup-guides.md --- docs/worker-setup-guides.md | 35 ++++++++++++++++++++--------------- 1 file changed, 20 insertions(+), 15 deletions(-) diff --git a/docs/worker-setup-guides.md b/docs/worker-setup-guides.md index f5206d8..cb0fec3 100644 --- a/docs/worker-setup-guides.md +++ b/docs/worker-setup-guides.md @@ -1,6 +1,6 @@ ## ComfyUI Distributed Worker Setup Guide -ComfyUI-Distributed allows you to distribute your workflows across multiple GPUs, whether they're in the same machine, on your local network, or in the cloud. +ComfyUI Distributed allows you to distribute your workflows across multiple GPUs, whether they're in the same machine, on your local network, or in the cloud. **Master**: The main ComfyUI instance that coordinates and distributes work. This is where you load workflows, manage the queue, and view results. @@ -54,28 +54,33 @@ ComfyUI-Distributed allows you to distribute your workflows across multiple GPUs ### Deploy Cloud Worker on Runpod **On Runpod:** +> If using your own template, make sure you launch ComfyUI with the `--enable-cors-header` argument and you `git clone ComfyUI-Distributed` into custom_nodes. ⚠️ **Required!** + 1. Register a [Runpod](https://get.runpod.io/0bw29uf3ug0p) account. 2. On Runpod, go to Storage > New Network Volume and create a volume that will store the models you need. Start with 40 GB, you can always add more later. -3. Now go to Pods and find a suitable GPU for your workflows. -4. Choose the [ComfyUI Distributed Pod](https://console.runpod.io/deploy?template=m21ynvo8yo&ref=ak218p52) template and make sure your network drive is mounted. -> To use the ComfyUI Distributed Pod template, you will need to filter instances by CUDA 12.8. -6. Launch your pod. -7. Access your pod using JupyterLabs. -8. Download models into /workspaces/ComfyUI/models/ (these will remain on your network drive even after you terminate the pod). -> You can use [this guide](model-download-script.md) to make this process easy for you. It will generate a shell script that will automatically download the models you need for a given workflow. -8. If using your own template, make sure you launch ComfyUI with the `--enable-cors-header` argument and you `git clone ComfyUI-Distributed` into custom_nodes. ⚠️ **Required!** -9. Download any additional custom nodes using the ComfyUI Manager. +3. Use the [ComfyUI Distributed Pod](https://console.runpod.io/deploy?template=m21ynvo8yo&ref=ak218p52) template and make sure your network drive is mounted. +> ⚠️ To use the ComfyUI Distributed Pod template, you will need to filter instances by CUDA 12.8. +4. Configure the Pod Environment Variables: + - CIVITAI_API_TOKEN: [get your token here](https://civitai.com/user/account) + - HF_API_TOKEN: [get your token here](https://huggingface.co/settings/tokens) + - SAGE_ATTENTION: optional optimisation (set to true/false) +5. Launch your pod. +6. Connect to your pod using JupyterLabs. This gives us access to the pod's file system. +7. Download models into /workspaces/ComfyUI/models/ (these will remain on your network drive even after you terminate the pod). +> ℹ️ Use [this guide](model-download-script.md) to make this process easy for you. It will generate a shell script that will automatically download the models you need for a given workflow. +9. Access ComfyUI through the Runpod proxy URL. +10. Download any additional custom nodes you need using the ComfyUI Manager. **On the Main Machine:** -1. Launch a Cloudflare tunnel +1. **Launch** a Cloudflare tunnel. - Download from here: [https://github.com/cloudflare/cloudflared/releases](https://github.com/cloudflare/cloudflared/releases) - Then run, for example: `cloudflared-windows-amd64.exe tunnel --url http://localhost:8188` -> Cloudflare tunnels create secure connections without exposing ports directly to the internet -2. Copy the Cloudflare address +> ℹ️ Cloudflare tunnels create secure connections without exposing ports directly to the internet and are required for Cloud Workers. +2. **Copy** the Cloudflare address 3. **Launch** ComfyUI with `--enable-cors-header` launch argument. 4. **Open** the Distributed GPU panel (sidebar on the left). -5. **Edit** the Master's host address and replace it with the Cloudflare address. - - **Click** "Add Worker." +5. **Edit** the Master's settings to change the host address to the Cloudflare address. +6. **Click** "Add Worker." - **Choose** "Cloud". - **Configure** your cloud worker: - **Host**: The Runpod address From f589a723feaec6a7a16832f793fb3206bf676398 Mon Sep 17 00:00:00 2001 From: Robert Wojciechowski Date: Tue, 29 Jul 2025 15:59:30 +1000 Subject: [PATCH 12/27] Update README.md --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 976aa26..afb5472 100644 --- a/README.md +++ b/README.md @@ -101,7 +101,7 @@ Generate multiple videos in the time it takes to generate one. Each worker uses 8. Run the workflow! ### Distributed Upscaling -Accelerate the process by distributing tiles across multiple workers, with speed scaling as you add more GPUs. +Accelerate Ultimate SD Upscaler by distributing tiles across multiple workers, with speed scaling as you add more GPUs. ![Clipboard Image (3)](https://github.com/user-attachments/assets/ffb57a0d-7b75-4497-96d2-875d60865a1a) From 784aa3a06bf9f18edd687919147f1857e4564843 Mon Sep 17 00:00:00 2001 From: Robert Wojciechowski Date: Tue, 29 Jul 2025 16:05:35 +1000 Subject: [PATCH 13/27] Update model-download-script.md --- docs/model-download-script.md | 17 +++++++++-------- 1 file changed, 9 insertions(+), 8 deletions(-) diff --git a/docs/model-download-script.md b/docs/model-download-script.md index ea07857..9a36fa0 100644 --- a/docs/model-download-script.md +++ b/docs/model-download-script.md @@ -1,12 +1,9 @@ ## Automating ComfyUI Model Downloads -This guide will walk you through creating a shell script to automatically download the necessary models for your ComfyUI workflow, leveraging an advanced Large Language Model (LLM). +> This guide will walk you through creating a shell script to automatically download the necessary models for your ComfyUI workflow, leveraging an advanced Large Language Model (LLM). -1. Launch the [ComfyUI Distributed Pod](https://console.runpod.io/deploy?template=m21ynvo8yo&ref=ak218p52) with these Environment Variables: - - `CIVITAI_API_TOKEN` ([get your token here](https://civitai.com/user/account)) - - `HF_API_TOKEN` ([get your token here](https://huggingface.co/settings/tokens)) -2. In ComfyUI, export your workflow as an API workflow -3. Copy the below prompt and upload the API workflow to a LLM **that has access to the internet** +1. In ComfyUI (on your local machine), export your workflow as an API workflow +2. Copy the below prompt and upload the API workflow to an LLM **that has access to the internet** ``` Create a sh script that will download the models from this workflow into the correct folders. For reference, these are the paths: @@ -49,8 +46,12 @@ comfy model download --url https://huggingface.co/black-forest-labs/FLUX.1-dev/r comfy model download --url https://civitai.com/api/download/models/1759168 --relative-path /workspace/ComfyUI/models/checkpoints/SDXL --set-civitai-api-token $CIVITAI_API_TOKEN ``` -4. Review the LLMs output to make sure all download links are correct and save it as a .sh file, for example `download_models.sh` -5. Upload it onto your Runpod instance, into `/workspace` +3. Review the LLMs output to make sure all download links are correct and save it as a .sh file, for example `download_models.sh` +4. Launch the [ComfyUI Distributed Pod](https://console.runpod.io/deploy?template=m21ynvo8yo&ref=ak218p52) with these Environment Variables: + - `CIVITAI_API_TOKEN`: [get your token here](https://civitai.com/user/account) + - `HF_API_TOKEN`: [get your token here](https://huggingface.co/settings/tokens) +5. Upload the .sh file to your Runpod instance, into `/workspace` 6. Then run these commands: - `chmod 755 /workspace/download_models.sh` - `/workspace/download_models.sh` +7. Confirm each model name (sometimes you might need to rename them to match the name on your local machine) From 0391605c80dea777dbe9b2238023cb284e2b9574 Mon Sep 17 00:00:00 2001 From: Robert Wojciechowski Date: Tue, 29 Jul 2025 16:09:33 +1000 Subject: [PATCH 14/27] Update model-download-script.md --- docs/model-download-script.md | 18 +++++++----------- 1 file changed, 7 insertions(+), 11 deletions(-) diff --git a/docs/model-download-script.md b/docs/model-download-script.md index 9a36fa0..de5ad2d 100644 --- a/docs/model-download-script.md +++ b/docs/model-download-script.md @@ -1,12 +1,14 @@ ## Automating ComfyUI Model Downloads - > This guide will walk you through creating a shell script to automatically download the necessary models for your ComfyUI workflow, leveraging an advanced Large Language Model (LLM). 1. In ComfyUI (on your local machine), export your workflow as an API workflow 2. Copy the below prompt and upload the API workflow to an LLM **that has access to the internet** + +
+📋 Click to expand the full prompt + ``` Create a sh script that will download the models from this workflow into the correct folders. For reference, these are the paths: - base_path: /workspace/ComfyUI checkpoints: models/checkpoints/ clip: models/clip/ @@ -22,30 +24,24 @@ text_encoders: models/text_encoders/ unet: models/unet/ upscale_models: models/upscale_models/ vae: models/vae/ - --- - Important: Make sure you find the correct URLs for the models online. Use comfy cli to download the models: `comfy model download --url [--relative-path ] [--set-civitai-api-token ] [--set-hf-api-token ]` Make sure you add `--set-civitai-api-token $CIVITAI_API_TOKEN` for CivitAI download and `--set-hf-api-token $HF_API_TOKEN` for Hugging Face downloads. - --- - Example: - #!/bin/bash - # Download from CivitAI comfy model download --url https://civitai.com/api/download/models/1759168 --relative-path /workspace/ComfyUI/models/checkpoints --set-civitai-api-token $CIVITAI_API_TOKEN - # Download model from Hugging Face comfy model download --url https://huggingface.co/black-forest-labs/FLUX.1-dev/resolve/main/flux1-dev.safetensors --relative-path /workspace/ComfyUI/models/unet --set-hf-api-token $HF_API_TOKEN - # If a model in the workflow was in a subfolder comfy model download --url https://civitai.com/api/download/models/1759168 --relative-path /workspace/ComfyUI/models/checkpoints/SDXL --set-civitai-api-token $CIVITAI_API_TOKEN - ``` + +
+ 3. Review the LLMs output to make sure all download links are correct and save it as a .sh file, for example `download_models.sh` 4. Launch the [ComfyUI Distributed Pod](https://console.runpod.io/deploy?template=m21ynvo8yo&ref=ak218p52) with these Environment Variables: - `CIVITAI_API_TOKEN`: [get your token here](https://civitai.com/user/account) From 8c029e5702574eac0d03c57c9e83797182c1a323 Mon Sep 17 00:00:00 2001 From: Robert Wojciechowski Date: Tue, 29 Jul 2025 16:12:43 +1000 Subject: [PATCH 15/27] Update worker-setup-guides.md --- docs/worker-setup-guides.md | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/docs/worker-setup-guides.md b/docs/worker-setup-guides.md index cb0fec3..f877aa5 100644 --- a/docs/worker-setup-guides.md +++ b/docs/worker-setup-guides.md @@ -81,11 +81,11 @@ ComfyUI Distributed allows you to distribute your workflows across multiple GPUs 4. **Open** the Distributed GPU panel (sidebar on the left). 5. **Edit** the Master's settings to change the host address to the Cloudflare address. 6. **Click** "Add Worker." - - **Choose** "Cloud". - - **Configure** your cloud worker: - - **Host**: The Runpod address - - **Port**: 443 - - **Save** the remote worker configuration. +7. **Choose** "Cloud". +8. **Configure** your cloud worker: + - **Host**: The Runpod address + - **Port**: 443 +9. **Save** the remote worker configuration. --- From 520393b150bcc24e08d3de1f1d8649c78e5ec760 Mon Sep 17 00:00:00 2001 From: Robert Wojciechowski Date: Tue, 29 Jul 2025 16:20:17 +1000 Subject: [PATCH 16/27] Update worker-setup-guides.md --- docs/worker-setup-guides.md | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/docs/worker-setup-guides.md b/docs/worker-setup-guides.md index f877aa5..7058823 100644 --- a/docs/worker-setup-guides.md +++ b/docs/worker-setup-guides.md @@ -58,17 +58,18 @@ ComfyUI Distributed allows you to distribute your workflows across multiple GPUs 1. Register a [Runpod](https://get.runpod.io/0bw29uf3ug0p) account. 2. On Runpod, go to Storage > New Network Volume and create a volume that will store the models you need. Start with 40 GB, you can always add more later. -3. Use the [ComfyUI Distributed Pod](https://console.runpod.io/deploy?template=m21ynvo8yo&ref=ak218p52) template and make sure your network drive is mounted. -> ⚠️ To use the ComfyUI Distributed Pod template, you will need to filter instances by CUDA 12.8. -4. Configure the Pod Environment Variables: +3. Use the [ComfyUI Distributed Pod](https://console.runpod.io/deploy?template=m21ynvo8yo&ref=ak218p52) template. +4. Make sure your Network Volume is mounted and choose a suitable GPU. +> ⚠️ To use the ComfyUI Distributed Pod template, you will need to filter instances by CUDA 12.8 +6. Press Edit Template to configure the pod's Environment Variables: - CIVITAI_API_TOKEN: [get your token here](https://civitai.com/user/account) - HF_API_TOKEN: [get your token here](https://huggingface.co/settings/tokens) - SAGE_ATTENTION: optional optimisation (set to true/false) -5. Launch your pod. +5. Deploy your pod. 6. Connect to your pod using JupyterLabs. This gives us access to the pod's file system. 7. Download models into /workspaces/ComfyUI/models/ (these will remain on your network drive even after you terminate the pod). > ℹ️ Use [this guide](model-download-script.md) to make this process easy for you. It will generate a shell script that will automatically download the models you need for a given workflow. -9. Access ComfyUI through the Runpod proxy URL. +9. Access ComfyUI through the Runpod URL. 10. Download any additional custom nodes you need using the ComfyUI Manager. **On the Main Machine:** From b13c78ad71f3293c1eafd2d34ff350a0b560c3f0 Mon Sep 17 00:00:00 2001 From: Robert Wojciechowski Date: Tue, 29 Jul 2025 16:31:16 +1000 Subject: [PATCH 17/27] Update README.md --- README.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/README.md b/README.md index afb5472..7fe9d4f 100644 --- a/README.md +++ b/README.md @@ -51,6 +51,7 @@ ComfyUI Distributed supports three types of workers: - ComfyUI > Note: Desktop app not currently supported - Multiple GPUs +> No additional GPUs? Use [Cloud Workers](https://github.com/robertvoy/ComfyUI-Distributed/blob/main/docs/worker-setup-guides.md#cloud-workers) - That's it --- @@ -111,6 +112,7 @@ Accelerate Ultimate SD Upscaler by distributing tiles across multiple workers, w 2. Upscale with ESRGAN or similar 3. Connect to **Ultimate SD Upscale Distributed** 4. Configure tile settings +> If your GPUs are similar, set `static_distribution` to true; otherwise, false 5. Enable workers for faster processing --- From 81e644e66193ae94e859ba2579e78d61f0cd3082 Mon Sep 17 00:00:00 2001 From: Robert Wojciechowski Date: Tue, 29 Jul 2025 16:35:42 +1000 Subject: [PATCH 18/27] Update ui.js --- web/ui.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/web/ui.js b/web/ui.js index e3681ea..46fbe73 100644 --- a/web/ui.js +++ b/web/ui.js @@ -697,7 +697,7 @@ export class DistributedUI { // Create powered by Runpod text (initially hidden) const runpodText = document.createElement("a"); runpodText.id = `runpod-text-${worker.id}`; - runpodText.href = "https://get.runpod.io/0bw29uf3ug0p"; + runpodText.href = "https://github.com/robertvoy/ComfyUI-Distributed/blob/main/docs/worker-setup-guides.md#cloud-workers"; runpodText.target = "_blank"; runpodText.textContent = "Deploy Cloud Worker with Runpod"; runpodText.style.cssText = "font-size: 12px; color: #4a90e2; text-decoration: none; margin-top: 4px; display: none; cursor: pointer;"; @@ -1233,4 +1233,4 @@ export class DistributedUI { return card; } -} \ No newline at end of file +} From e13ea47a93d96f08337f871c0d4daadcd488fc3e Mon Sep 17 00:00:00 2001 From: Robert Wojciechowski Date: Tue, 29 Jul 2025 16:41:11 +1000 Subject: [PATCH 19/27] Update worker-setup-guides.md --- docs/worker-setup-guides.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/worker-setup-guides.md b/docs/worker-setup-guides.md index 7058823..56bf2c7 100644 --- a/docs/worker-setup-guides.md +++ b/docs/worker-setup-guides.md @@ -60,7 +60,7 @@ ComfyUI Distributed allows you to distribute your workflows across multiple GPUs 2. On Runpod, go to Storage > New Network Volume and create a volume that will store the models you need. Start with 40 GB, you can always add more later. 3. Use the [ComfyUI Distributed Pod](https://console.runpod.io/deploy?template=m21ynvo8yo&ref=ak218p52) template. 4. Make sure your Network Volume is mounted and choose a suitable GPU. -> ⚠️ To use the ComfyUI Distributed Pod template, you will need to filter instances by CUDA 12.8 +> ⚠️ To use the ComfyUI Distributed Pod template, you will need to filter instances by CUDA 12.8 (add filter in Additional Filters). 6. Press Edit Template to configure the pod's Environment Variables: - CIVITAI_API_TOKEN: [get your token here](https://civitai.com/user/account) - HF_API_TOKEN: [get your token here](https://huggingface.co/settings/tokens) From 394a2d8a9a46b2e56688a9059bb7cd930fbf11cd Mon Sep 17 00:00:00 2001 From: Robert Wojciechowski Date: Tue, 29 Jul 2025 16:48:58 +1000 Subject: [PATCH 20/27] Update worker-setup-guides.md --- docs/worker-setup-guides.md | 2 -- 1 file changed, 2 deletions(-) diff --git a/docs/worker-setup-guides.md b/docs/worker-setup-guides.md index 56bf2c7..740d9fe 100644 --- a/docs/worker-setup-guides.md +++ b/docs/worker-setup-guides.md @@ -1,7 +1,5 @@ ## ComfyUI Distributed Worker Setup Guide -ComfyUI Distributed allows you to distribute your workflows across multiple GPUs, whether they're in the same machine, on your local network, or in the cloud. - **Master**: The main ComfyUI instance that coordinates and distributes work. This is where you load workflows, manage the queue, and view results. **Worker**: A ComfyUI instance that receives and processes tasks from the master. Workers handle just the GPU computation and send results back to the master. You can have multiple workers connected to a single master, each utilizing their own GPU. From 8c41749ea6182e83a765ce7b6b2ff42decc161c2 Mon Sep 17 00:00:00 2001 From: Robert Wojciechowski Date: Wed, 30 Jul 2025 07:29:02 +1000 Subject: [PATCH 21/27] Update worker-setup-guides.md --- docs/worker-setup-guides.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/worker-setup-guides.md b/docs/worker-setup-guides.md index 740d9fe..195b65e 100644 --- a/docs/worker-setup-guides.md +++ b/docs/worker-setup-guides.md @@ -1,4 +1,4 @@ -## ComfyUI Distributed Worker Setup Guide +## Worker Setup Guide **Master**: The main ComfyUI instance that coordinates and distributes work. This is where you load workflows, manage the queue, and view results. From a49c7a8ed5c05b5414c63cf68153808682dd648a Mon Sep 17 00:00:00 2001 From: Robert Wojciechowski Date: Wed, 30 Jul 2025 07:30:25 +1000 Subject: [PATCH 22/27] Update worker-setup-guides.md --- docs/worker-setup-guides.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/worker-setup-guides.md b/docs/worker-setup-guides.md index 195b65e..84bf0c6 100644 --- a/docs/worker-setup-guides.md +++ b/docs/worker-setup-guides.md @@ -66,7 +66,7 @@ 5. Deploy your pod. 6. Connect to your pod using JupyterLabs. This gives us access to the pod's file system. 7. Download models into /workspaces/ComfyUI/models/ (these will remain on your network drive even after you terminate the pod). -> ℹ️ Use [this guide](model-download-script.md) to make this process easy for you. It will generate a shell script that will automatically download the models you need for a given workflow. +> ℹ️ Use [this guide](model-download-script.md) to make this process easy. It will generate a shell script that automatically downloads the models for a given workflow. 9. Access ComfyUI through the Runpod URL. 10. Download any additional custom nodes you need using the ComfyUI Manager. From 500a5b38b27ba948639400163af7906ba973dc43 Mon Sep 17 00:00:00 2001 From: Robert Wojciechowski Date: Wed, 30 Jul 2025 09:40:31 +1000 Subject: [PATCH 23/27] Update worker-setup-guides.md --- docs/worker-setup-guides.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/worker-setup-guides.md b/docs/worker-setup-guides.md index 84bf0c6..dfdd920 100644 --- a/docs/worker-setup-guides.md +++ b/docs/worker-setup-guides.md @@ -55,7 +55,7 @@ > If using your own template, make sure you launch ComfyUI with the `--enable-cors-header` argument and you `git clone ComfyUI-Distributed` into custom_nodes. ⚠️ **Required!** 1. Register a [Runpod](https://get.runpod.io/0bw29uf3ug0p) account. -2. On Runpod, go to Storage > New Network Volume and create a volume that will store the models you need. Start with 40 GB, you can always add more later. +2. On Runpod, go to Storage > New Network Volume and create a volume that will store the models you need. Start with 40 GB, you can always add more later. Learn more [about Network Volumes](https://docs.runpod.io/pods/storage/create-network-volumes). 3. Use the [ComfyUI Distributed Pod](https://console.runpod.io/deploy?template=m21ynvo8yo&ref=ak218p52) template. 4. Make sure your Network Volume is mounted and choose a suitable GPU. > ⚠️ To use the ComfyUI Distributed Pod template, you will need to filter instances by CUDA 12.8 (add filter in Additional Filters). From 3c988daad1e750229f9362313a3ef9ae4c005945 Mon Sep 17 00:00:00 2001 From: Robert Wojciechowski Date: Wed, 30 Jul 2025 10:05:39 +1000 Subject: [PATCH 24/27] Update worker-setup-guides.md --- docs/worker-setup-guides.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/worker-setup-guides.md b/docs/worker-setup-guides.md index dfdd920..33dc24f 100644 --- a/docs/worker-setup-guides.md +++ b/docs/worker-setup-guides.md @@ -95,7 +95,7 @@ - If your cloud platform doesn't provide a secure connection, use Cloudflare to create a tunnel for the worker. Each GPU needs their own tunnel for their respective port. - For example: `./cloudflared tunnel --url http://localhost:8188` 1. **Launch** ComfyUI with the `--listen --enable-cors-header` arguments. ⚠️ **Required!** -2. **Add** workers in the UI panel if the remote machine has more than one GPU. +2. **Add** workers in the UI panel if the cloud machine has more than one GPU. - Make sure that they also have `--listen` set in `Extra Args`. - Then launch them. From b646f0b41c007f5c779047f373d20497257885ea Mon Sep 17 00:00:00 2001 From: Robert Wojciechowski Date: Wed, 30 Jul 2025 10:38:32 +1000 Subject: [PATCH 25/27] Update worker-setup-guides.md --- docs/worker-setup-guides.md | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/docs/worker-setup-guides.md b/docs/worker-setup-guides.md index 33dc24f..d75454f 100644 --- a/docs/worker-setup-guides.md +++ b/docs/worker-setup-guides.md @@ -65,7 +65,13 @@ - SAGE_ATTENTION: optional optimisation (set to true/false) 5. Deploy your pod. 6. Connect to your pod using JupyterLabs. This gives us access to the pod's file system. -7. Download models into /workspaces/ComfyUI/models/ (these will remain on your network drive even after you terminate the pod). +7. Download models into /workspaces/ComfyUI/models/ (these will remain on your network drive even after you terminate the pod). Example commands below: +``` +# Download from CivitAI +comfy model download --url https://civitai.com/api/download/models/1759168 --relative-path /workspace/ComfyUI/models/checkpoints --set-civitai-api-token $CIVITAI_API_TOKEN +# Download model from Hugging Face +comfy model download --url https://huggingface.co/black-forest-labs/FLUX.1-dev/resolve/main/flux1-dev.safetensors --relative-path /workspace/ComfyUI/models/unet --set-hf-api-token $HF_API_TOKEN +``` > ℹ️ Use [this guide](model-download-script.md) to make this process easy. It will generate a shell script that automatically downloads the models for a given workflow. 9. Access ComfyUI through the Runpod URL. 10. Download any additional custom nodes you need using the ComfyUI Manager. From 5882a1064e02985070dae4e8c9cf92fd5afb0faf Mon Sep 17 00:00:00 2001 From: Robert Wojciechowski Date: Wed, 30 Jul 2025 11:31:06 +1000 Subject: [PATCH 26/27] Update worker-setup-guides.md --- docs/worker-setup-guides.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/worker-setup-guides.md b/docs/worker-setup-guides.md index d75454f..a940b53 100644 --- a/docs/worker-setup-guides.md +++ b/docs/worker-setup-guides.md @@ -88,7 +88,7 @@ comfy model download --url https://huggingface.co/black-forest-labs/FLUX.1-dev/r 6. **Click** "Add Worker." 7. **Choose** "Cloud". 8. **Configure** your cloud worker: - - **Host**: The Runpod address + - **Host**: The ComfyUI Runpod address. For example: `wcegfo9tbbml9l-8188.proxy.runpod.net` - **Port**: 443 9. **Save** the remote worker configuration. From 33fbe4cb621762af7c5a4accaeb4155b49c3faa6 Mon Sep 17 00:00:00 2001 From: Robert Wojciechowski Date: Wed, 30 Jul 2025 12:58:57 +1000 Subject: [PATCH 27/27] Update README.md --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 7fe9d4f..c8230d6 100644 --- a/README.md +++ b/README.md @@ -50,7 +50,7 @@ ComfyUI Distributed supports three types of workers: - ComfyUI > Note: Desktop app not currently supported -- Multiple GPUs +- Multiple NVIDIA GPUs > No additional GPUs? Use [Cloud Workers](https://github.com/robertvoy/ComfyUI-Distributed/blob/main/docs/worker-setup-guides.md#cloud-workers) - That's it