added docs, updated workflow, updated url for Runpod in UI

This commit is contained in:
robertvoy
2025-07-28 12:50:25 +10:00
parent a461c79531
commit 209fe5388b
8 changed files with 5473 additions and 286 deletions
+43
View File
@@ -0,0 +1,43 @@
## Prompt for LLM - 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. Export your workflow as an API workflow
2. Copy the below prompt and upload the API workflow to a LLM that has access to the internet (like Gemini Flash)
3. Review (make sure all downloads are correct) and save the output from the LLM as a .sh file
4. Upload it onto your Runpod instance
5. Run the file. For example: `./download_comfyui_models.sh`
```
Create a sh script that will download the models from this workflow into the correct folders. For reference, these are the paths:
comfyui:
base_path: /workspace/ComfyUI
BiRefNet: models/BiRefNet/
checkpoints: models/checkpoints/
clip: models/clip/
clip_vision: models/clip_vision/
configs: models/configs/
controlnet: models/controlnet/
diffusers: models/diffusers/
diffusion_models: models/diffusion_models/
embeddings: models/embeddings/
florence2: models/florence2/
facerestore_models: models/facerestore_models/
gligen: models/gligen/
grounding-dino: models/grounding-dino/
hypernetworks: models/hypernetworks/
ipadapter: models/ipadapter/
lama: models/lama/
loras: models/loras/
onnx: models/onnx/
photomaker: models/photomaker/
RMBG: models/RMBG/
sams: models/sams/
style_models: models/style_models/
text_encoders: models/text_encoders/
unet: models/unet/
upscale_models: models/upscale_models/
vae: models/vae/
vae_approx: models/vae_approx/
vitmatte: models/vitmatte/
```
+88
View File
@@ -0,0 +1,88 @@
## Local workers
> Local Workers: These are added automatically on first launch, but you can add them manually if you need.
1. **Open** the Distributed GPU panel.
2. **Click** "Add Worker" in the UI.
3. **Configure** your local worker:
- **Name**: A descriptive name for the worker (e.g., "Studio PC 1")
- **Port**: A unique port number for this worker (e.g., 8189, 8190...).
- **CUDA Device**: The GPU index from `nvidia-smi` (e.g., 0, 1).
- **Extra Args**: Optional ComfyUI arguments for this specific worker.
4. **Save** and launch the local worker.
## Remote workers
> Remote Workers: ComfyUI instances running on completely different computers on your network. These allow you to harness GPU power from other machines. Remote workers must be manually started on their respective computers and are connected via IP address.
**On the Remote Worker Machine:**
1. **Launch** the master (main ComfyUI instance) with the `--listen --enable-cors-header` arguments. ⚠️ **Required!**
2. **Add** workers in the UI panel if the remote machine has more than one GPU.
- Make sure that they also have `--listen` set in `Extra Args`.
- Then launch them.
3. **Open** the configured worker port(s) (e.g., 8189, 8190) in the remote worker's 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:
- **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 worker (e.g., 8189).
5. **Save** the remote worker configuration.
## Cloud workers
> Cloud Workers: ComfyUI instances running on a cloud service like [Runpod](https://get.runpod.io/0bw29uf3ug0p).
### Deploy Cloud Worker on Runpod
**On Runpod:**
1. Register a [Runpod](https://get.runpod.io/0bw29uf3ug0p) account.
2. On Runpod, go to Storage > New Network Volume and create a volume which will store the models you need.
3. Now go to Pods and find a suitable GPU for your workflows.
> To use the ComfyUI-Distributed-Pod, you will need to filter instances by CUDA 12.8.
4. Choose the `ComfyUI-Distributed-Pod` template and make sure your network drive is mounted.
5. Launch your pod.
6. Access your pod using JupyterLab.
7. 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 ComfyUI manager
**On the Main Machine:**
1. Launch a Cloudflare tunnel
- Download from here `https://github.com/cloudflare/cloudflared/releases/tag/2025.7.0`
- 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.
- **Click** "Add Worker."
- **Choose** "Cloud".
- **Configure** your cloud worker:
- **Host**: The Runpod address
- **Port**: 443
- **Save** the remote worker configuration.
### Deploy Cloud Worker on Other Platforms
**On the Cloud Worker machine:**
- Your cloud worker container needs to have the same models and custom nodes as the workflow you want to run on your local machine.
- 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.
- Make sure that they also have `--listen` set in `Extra Args`.
- Then launch them.
**On the Main Machine:**
1. **Launch** a Cloudflare tunnel on your local machine.
- Download from here `https://github.com/cloudflare/cloudflared/releases/tag/2025.7.0`
- 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:
- **Host**: The remote worker's IP address/domain
- **Port**: 443
8. **Save** the remote worker configuration.
+10
View File
@@ -945,6 +945,16 @@ class DistributedExtension {
this.log(`Auto-populated ${newWorkers.length} workers and saved config`, "info");
// Show success notification
if (app.extensionManager?.toast) {
app.extensionManager.toast.add({
severity: "success",
summary: "Workers Auto-populated",
detail: `Automatically created ${newWorkers.length} workers based on detected CUDA devices`,
life: 5000
});
}
// Reload the config to include the new workers
await this.loadConfig();
} else {
+2 -2
View File
@@ -697,9 +697,9 @@ export class DistributedUI {
// Create powered by Runpod text (initially hidden)
const runpodText = document.createElement("a");
runpodText.id = `runpod-text-${worker.id}`;
runpodText.href = "https://www.runpod.io";
runpodText.href = "https://get.runpod.io/0bw29uf3ug0p";
runpodText.target = "_blank";
runpodText.textContent = "Deploy cloud worker with Runpod";
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;";
// Store the onchange function to be assigned later
File diff suppressed because it is too large Load Diff
File diff suppressed because it is too large Load Diff
File diff suppressed because it is too large Load Diff
File diff suppressed because it is too large Load Diff