publish to 2lab 发布到2lab服务器
Ship your ComfyUI workflow to the 2lab server as an API
- trigger
- publish
- id
This is the node that gives the whole pack its reason to exist. AI2lab's pitch for comfyUI-tool-2lab is "tool set for developing workflow and publish to web api server," and PublishWorkflow (2lab) is the publish button. Build your graph, finish tuning it, then drop this node on the end and tell the 2lab platform "this workflow is now an API." Everything else in the pack - the save-by-URL nodes, the text hubs, the video param box - exists to make workflows that are meant to be published and called programmatically. If you never touch the 2lab platform, you can ignore this node entirely.
How it works
ComfyUI workflows are just JSON graphs, and the 2lab server is a Chinese cloud platform that runs those graphs for you and exposes them as callable web APIs. This node marks the workflow as publishable and hands the server the metadata it needs to advertise it. When the publish flag is true, the workflow gets registered on your 2lab account under the id and name you give it, and you can call it like any HTTP endpoint from your own code.
The inputs are all simple:
trigger- any type, any wire. This is the "fire" connection that makes the node run at the end of your graph. Wire your final output here so the publish happens after the generation finishes.id- the workflow id on the 2lab server (defaultworkflowId). This is your API id, so make it something you'll recognize in your dashboard.name- the display name (default is the Chinese for "text to image", 文生图). This is what shows up in your 2lab list of published APIs.desc- a description shown on the server.publish- the boolean that actually does the deed. Keep it false while you're still iterating; flip it true when you're ready to ship.
It outputs the publish boolean and the id string, so you can chain the result into logging or a follow-up node if you want to confirm the publish actually fired.
Installing it
The pack installs like any custom node. In ComfyUI Manager, search for "comfyUI-tool-2lab" and hit install, or do it by hand:
cd ComfyUI/custom_nodes
git clone https://github.com/AI2lab/comfyUI-tool-2lab
Then restart ComfyUI. No model downloads, no requirements.txt drama - it's plain Python, and this node in particular just needs your 2lab account credentials configured on the platform side.
Gotchas
Where people get burned: publish defaults to false, and nothing publishes until you flip it. You can run your whole workflow, watch everything complete, and get zero API endpoints because the flag was still off. Make it a habit to check the node's red-flag status before you queue.
One honest warning: as of this writing the GitHub repo page returns 404, which usually means the author made it private or moved it. If Manager can't find the pack or the clone fails, that's why - not something you did wrong. The nodes still appear in workflows and in the 2lab docs, so it may just be a visibility change.
And a security note from the ecosystem at large: publishing workflows and running your ComfyUI reachable by a server means you should keep your ComfyUI instance behind auth if it's ever exposed. The workflow-to-API pipeline is a great power-up, but it's also a new surface area, so don't point it at an unauthenticated instance.
Inputs (5)
| Name | Type | Default | Description |
|---|---|---|---|
| trigger | * | — | |
| id | STRING | workflowId | — |
| name | STRING | 文生图 | — |
| desc | STRING | — | |
| publish | BOOLEAN | false | — |
Outputs (2)
| Name | Type | Description |
|---|---|---|
| publish | BOOL | — |
| id | STRING | — |