Skip to content

Commit aed6c11

Browse files
committed
Update docs for load balance, logs, and Distributed Value
1 parent 7f16ad1 commit aed6c11

2 files changed

Lines changed: 81 additions & 31 deletions

File tree

README.md

Lines changed: 54 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515

1616
---
1717

18-
## Key Features
18+
## Key Features
1919

2020
#### Parallel Workflow Processing
2121
- Run your workflow on multiple GPUs simultaneously with varied seeds, collect results on the master
@@ -27,12 +27,22 @@
2727
- Intelligent distribution
2828
- Handles single images and videos
2929

30-
#### Ease of Use
31-
- Auto-setup local workers; easily add remote/cloud ones
32-
- Convert any workflow to distributed with 2 nodes
33-
- JSON configuration with UI controls
34-
35-
---
30+
#### Ease of Use
31+
- Auto-setup local workers; easily add remote/cloud ones
32+
- Convert any workflow to distributed with 2 nodes
33+
- JSON configuration with UI controls
34+
35+
---
36+
37+
## Current Architecture
38+
39+
- Workflow-level load balancing is controlled by **Distributed Collector** via the `load_balance` toggle.
40+
- There is **no Distributed Queue node** anymore.
41+
- With `load_balance=true`, orchestration selects one least-busy execution participant:
42+
- If master participation is enabled, master is included as a candidate.
43+
- If master is in orchestrator-only mode, only workers are considered.
44+
45+
---
3646

3747
## Worker Types
3848

@@ -82,18 +92,19 @@ Join Runpod with [this link](https://get.runpod.io/0bw29uf3ug0p) and unlock a sp
8292

8393
## Workflow Examples
8494

85-
### Basic Parallel Generation
86-
Generate multiple images in the time it takes to generate one. Each worker uses a different seed.
95+
### Basic Parallel Generation
96+
Generate multiple images in the time it takes to generate one. Each worker uses a different seed.
8797

8898
![Clipboard Image (6)](https://github.com/user-attachments/assets/9598c94c-d9b4-4ccf-ab16-a21398220aeb)
8999

90100
> [Download workflow](/workflows/distributed-txt2img.json)
91101
92102
1. Open your ComfyUI workflow
93-
2. Add **Distributed Seed** → connect to sampler's seed
94-
3. Add **Distributed Collector** → after VAE Decode
95-
4. Enable workers in the UI
96-
5. Run the workflow!
103+
2. Add **Distributed Seed** → connect to sampler's seed
104+
3. Add **Distributed Collector** → after VAE Decode
105+
4. Optional: enable `load_balance` on Distributed Collector to run on one least-busy participant
106+
5. Enable workers in the UI
107+
6. Run the workflow!
97108

98109
### Parallel WAN Generation
99110
Generate multiple videos in the time it takes to generate one. Each worker uses a different seed.
@@ -111,12 +122,12 @@ Generate multiple videos in the time it takes to generate one. Each worker uses
111122
7. Enable workers in the UI
112123
8. Run the workflow!
113124

114-
### Distributed Image Upscaling
115-
Accelerate Ultimate SD Upscaler by distributing tiles across multiple workers, with speed scaling as you add more GPUs.
125+
### Distributed Image Upscaling
126+
Accelerate Ultimate SD Upscaler by distributing tiles across multiple workers, with speed scaling as you add more GPUs.
116127

117128
![Clipboard Image (3)](https://github.com/user-attachments/assets/ffb57a0d-7b75-4497-96d2-875d60865a1a)
118129

119-
> [Download workflow](/workflows/distributed-txt2img.json)
130+
> [Download workflow](/workflows/distributed-upscale.json)
120131
121132
1. Load your image
122133
2. Upscale with ESRGAN or similar
@@ -142,28 +153,40 @@ Accelerate Ultimate SD Upscaler by distributing video tiles across multiple work
142153
143154
---
144155

145-
## Developer API
156+
## Developer API
146157

147158
Control your distributed cluster programmatically without opening the browser.
148159

149160
* **Endpoint:** `POST /distributed/queue`
150161
* **Functionality:** Accepts a standard ComfyUI workflow JSON, automatically distributes it to available workers, and returns the execution ID.
151162
* **Documentation:** [See API Examples & Scripts](https://github.com/robertvoy/ComfyUI-Distributed/blob/main/docs/comfyui-distributed-api.md)
152163

153-
> **⚠️ Security Warning:** Do not expose your ComfyUI port to the public internet. If you need remote access, run ComfyUI behind a secure proxy (like Cloudflare or a VPN).
154-
155-
---
156-
157-
## Nodes
158-
159-
| Node | Description |
160-
|------|-------------|
161-
| **Distributed Seed** | Generates unique seeds for each worker |
162-
| **Distributed Collector** | Collects results (image/video frames and optionally audio) from all workers back to the master |
163-
| **Distributed Queue** | Routes the entire workflow to the least-busy worker for load balancing (don't use Distributed Collector with this) |
164-
| **Ultimate SD Upscale Distributed** | Distributes upscale tiles across workers |
165-
| **Image Batch Divider** | Splits image batches for multi-GPU output |
166-
| **Audio Batch Divider** | Splits audio batches for multi-GPU output |
164+
> **⚠️ Security Warning:** Do not expose your ComfyUI port to the public internet. If you need remote access, run ComfyUI behind a secure proxy (like Cloudflare or a VPN).
165+
166+
---
167+
168+
## Distributed Value
169+
170+
Use **Distributed Value** when you want per-worker overrides (for example, different prompts/models/settings per worker).
171+
172+
- Output type adapts to the connected input where possible (`STRING`, `INT`, `FLOAT`, `COMBO`).
173+
- The node shows only currently enabled workers.
174+
- If worker enablement changes, worker fields update automatically.
175+
- When disconnected, it resets to default string mode and clears per-worker overrides.
176+
- On execution, master uses `default_value`; workers use their mapped override with typed coercion fallback to default.
177+
178+
---
179+
180+
## Nodes
181+
182+
| Node | Description |
183+
|------|-------------|
184+
| **Distributed Seed** | Generates unique seeds for each worker |
185+
| **Distributed Collector** | Collects results (image/video frames and optionally audio) from workers back to the master; `load_balance` can route the run to one least-busy participant |
186+
| **Distributed Value** | Outputs per-worker override values with fallback to default |
187+
| **Ultimate SD Upscale Distributed** | Distributes upscale tiles across workers |
188+
| **Image Batch Divider** | Splits image batches for multi-GPU output |
189+
| **Audio Batch Divider** | Splits audio batches for multi-GPU output |
167190
| **Distributed Model Name** | Passes model paths to workers, enabling workflows to use models not present on the master in orchestrator-only mode |
168191
| **Distributed Empty Image** | Produces an empty IMAGE batch used when the master delegates all work |
169192

docs/comfyui-distributed-api.md

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@ This document describes the **public HTTP API** added to ComfyUI-Distributed to
2222
- Pings workers (`GET /prompt`) to include only reachable ones.
2323
- Dispatches the workflow to workers (`POST /prompt`).
2424
- Queues the master workflow in ComfyUI’s prompt queue.
25+
- If any `DistributedCollector` has `load_balance=true`, selects one least-busy participant for this run.
2526

2627
### What it does *not* add
2728

@@ -172,6 +173,32 @@ If you call the API from a browser (not from a backend), ensure the master Comfy
172173

173174
---
174175

176+
## Log Endpoints
177+
178+
### `GET /distributed/worker_log/{worker_id}`
179+
180+
Read log files for workers launched locally by the master UI process manager.
181+
182+
- Intended for managed local workers.
183+
- Query param: `lines` (optional, default `1000`).
184+
185+
### `GET /distributed/local_log`
186+
187+
Read this ComfyUI instance's in-memory runtime log buffer.
188+
189+
- Available on any ComfyUI-Distributed instance (master or worker).
190+
- Query param: `lines` (optional, default `300`, max `3000`).
191+
192+
### `GET /distributed/remote_worker_log/{worker_id}`
193+
194+
Proxy endpoint on master that fetches logs from a configured remote/cloud worker's
195+
`/distributed/local_log`.
196+
197+
- Intended for remote/cloud workers in master config.
198+
- Query param: `lines` (optional, default `300`, max `3000`).
199+
200+
---
201+
175202
## Examples
176203

177204
### 1) Minimal `curl`

0 commit comments

Comments
 (0)