分段负载开始
The front half of ComfyUI's DIY load-balancer
- images
- SECTION
- IMAGE
SectionStart (分段负载开始, "section load start") is the opening bracket of the ComfyUI_Lam pack's distributed 分段负载 feature - the thing that lets you split a heavy generation job across multiple machines. And here's the honest part: on its default settings, it's a pass-through node. It takes an image in, hands you a SECTION token, and gives the image right back unchanged. The real machinery only wakes up when you point it at a non-default server.
How it works
The mechanism is Redis pub/sub plus base64 round-trips, coordinated through a channel the pack's WeChat-app layer listens on. When you pick a server other than "default":
- The node base64-encodes the incoming images and stashes them in Redis with a 15-second TTL.
- It publishes an
addTaskevent on that section server's channel. - It blocks, polling for a
sectionDonemessage, until the worker side reports back.
A companion node, SectionEnd, collects the processed result on the other side of the graph. The two bracket the section of the workflow that runs on the worker machine. The section token that SectionStart emits (type SECTION) carries a fileKey, the server name, and the section type - that's the handshake the return trip uses.
The inputs that matter:
server- a dropdown built from "default" plus everysectionheartbeat:*key the node finds live in Redis. So if you've got workers running, they show up in the list automatically, no config typing.images- optional IMAGE input, passed through unchanged when you're on "default".
Outputs are a SECTION token and the IMAGE. If you never touch the cluster feature, SectionStart just forwards your images and you can leave it in the graph without consequence.
The infrastructure tax
This is the part worth being blunt about. For the non-default path to do anything you need a fair amount of infrastructure: a Redis server, the pack's WeChat coordinator configured, and the 修改文件.bat / 修改文件.sh script from the README run - that script patches ComfyUI core (server.py and comfy/cli_args.py) to add --cluster, --isSection, --isMain, and --basePath command-line flags, and you then have to launch ComfyUI with those flags. That's a real compatibility cost: ComfyUI updates will happily overwrite the patch or trip on it, and the pack ships a 还原文件 restore script for a reason.
There's also essentially no community footprint for this feature - search the usual places and the only thread mentioning this pack at all is someone complaining about its leftover AppParams popup, not anyone showing off a working cluster. If you're running one ComfyUI machine and just want images, leave server on "default" and skip this whole world.
Installing it
The pack installs via ComfyUI Manager (search "ComfyUI_Lam") or:
cd ComfyUI/custom_nodes
git clone https://github.com/yanlang0123/ComfyUI_Lam
Then restart ComfyUI. Beyond the pack's heavy requirements.txt (it pulls redis among many other things), the cluster feature specifically needs Redis running and the core-patch script applied - neither of which Manager installs for you.
Troubleshooting
- "redis未配置" - you picked a non-default server but Redis isn't configured in the pack's config. Configure it first.
- The node waits forever - if no worker answers the
addTaskpublish, SectionStart keeps polling for asectionDonemessage. There's a cancel path that publishes a cancel to the worker, but you'll feel the wait. - Images mysteriously missing after a long job - the Redis stash has a 15-second TTL. If the worker takes longer than that to pick the data up, it's gone.
Inputs (2)
| Name | Type | Default | Description |
|---|---|---|---|
| server | COMBO | 1 options: default | |
| imagesopt | IMAGE | — |
Outputs (2)
| Name | Type | Description |
|---|---|---|
| SECTION | SECTION | — |
| IMAGE | IMAGE | — |