comfy-peer-host
A headless host for Comfy UI Web collaboration sessions. Run it on the computer that has ComfyUI, and people can join from their browser with an invite link. They build the graph together and run it on this computer's ComfyUI, even when nobody has the web app open here.
It speaks the same peer-to-peer protocol as the web app's own Collaborate host (WebRTC over PeerJS), so guests can't tell the difference:
- Guests get this server's node list and the shared graph, and their edits sync live between everyone.
- Anyone can press Queue. The prompt runs on this machine's ComfyUI, and progress, live previews, errors and result images stream back to every guest.
- The shared graph is saved to disk, and the session ID (so the invite link) stays the same across restarts.
Install and run
Requires Python 3.11+.
pipx install comfy-peer-host # or: uv tool install comfy-peer-host
comfy-peer-host # ComfyUI at http://127.0.0.1:8188
comfy-peer-host --comfy-url http://127.0.0.1:8189 --name "Studio PC"
Or run it once without installing: uvx comfy-peer-host. From a source checkout: uv run comfy-peer-host.
It prints the invite link:
Comfy UI Web host is running.
Invite link: https://mastashake08.github.io/comfy-ui-web/#join=cuw-txvwcd8gectw
Share the link, or have people paste the code into Collaborate → Join in the web app.
| Option | Default | |
|---|---|---|
--comfy-url |
http://127.0.0.1:8188 (or $COMFY_URL) |
ComfyUI server to run prompts on |
--name |
Host |
Name shown to guests |
--workflow FILE |
Start the shared graph from a workflow saved in the web app (Workflow → Save) | |
--state-dir |
~/.comfy-peer-host |
Where the session ID and shared graph (graph.json) are kept |
--new-id |
Make a new session ID; old invite links stop working | |
--session-id cuw-… |
Use a specific session ID | |
--app-url |
the hosted web app | Web app used in the invite link |
--turn |
off | Also offer PeerJS's public TURN relay, for guests behind very strict networks |
--peerjs-host/-port/-path/-key, --insecure-signalling |
PeerJS cloud | Use your own PeerJS server |
ComfyUI needs no special flags: the host talks to it from the same machine.
Keep it running (macOS)
Save this as ~/Library/LaunchAgents/com.comfy-peer-host.plist, adjusting the paths, then run
launchctl load ~/Library/LaunchAgents/com.comfy-peer-host.plist:
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0"><dict>
<key>Label</key><string>com.comfy-peer-host</string>
<key>ProgramArguments</key><array>
<string>/path/to/comfy-peer-host</string> <!-- output of: which comfy-peer-host -->
<string>--name</string><string>Studio PC</string>
</array>
<key>RunAtLoad</key><true/>
<key>KeepAlive</key><true/>
<key>StandardOutPath</key><string>/tmp/comfy-peer-host.log</string>
<key>StandardErrorPath</key><string>/tmp/comfy-peer-host.log</string>
</dict></plist>
Security
Anyone who has the invite link can edit the shared graph and run prompts on your GPU. Treat the link like a password.
Use --new-id to revoke it. Guests can't read your files: they only see the node list and the shared graph, and they can only queue prompts.
How it works
peerjs.py: a small PeerJS-compatible peer built on aiortc. It registers with the PeerJS signalling server, answers guests' WebRTC offers, and uses PeerJS's "binary" data-channel format (BinaryPack, with messages over 16,300 bytes split into chunks).binarypack.py: a byte-for-byte port ofpeerjs-js-binarypack, tested against vectors produced by the JavaScript library.comfy.py: async ComfyUI HTTP and websocket client.host.py: the session protocol (welcome, graph ops, cursors, queueing, forwarding progress, previews and images), matching the web app'ssrc/lib/collab.js.
Development
uv run --group dev pytest
Releasing
- Bump
versioninpyproject.tomland commit. - Tag and push:
git tag v0.2.0 && git push origin v0.2.0.
The Release workflow tests, checks the tag matches the version, builds the wheel and sdist, publishes them to PyPI (trusted publishing, no token stored) and creates a GitHub Release with both files attached.
To regenerate the BinaryPack test vectors, run tests/make_vectors.mjs with Node from a comfy-ui-web checkout (it imports peerjs-js-binarypack).
Metadata
Release files for comfy-peer-host 0.1.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| comfy_peer_host-0.1.0.tar.gz | 21.0 kB | With provenance | Details for comfy_peer_host-0.1.0.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| comfy_peer_host-0.1.0-py3-none-any.whl | Python 3 | none | any | Details for comfy_peer_host-0.1.0-py3-none-any.whl |
Total release size: 40.2 kB
Release files / comfy_peer_host-0.1.0.tar.gz
| Download URL | comfy_peer_host-0.1.0.tar.gz |
|---|---|
| Size | 21.0 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
e208aa5d1e3ebbbc8db7d3a590fde125b678f00bf7d44839f7e5b6d8a4f12bfe
|
|
BLAKE2b-256 checksum How to use checksums |
16e4835fb35d26c82b5899bed63f3dd943fa9c436b45b7b41903700eb3358e3b
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.16
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Nov 28, 2026.
Transparency logRelease files / comfy_peer_host-0.1.0-py3-none-any.whl
| Download URL | comfy_peer_host-0.1.0-py3-none-any.whl |
|---|---|
| Size | 19.2 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
f6e58bd1b7cfdf846f870f14cebb1a1777c629add0aa2ab8b87fbfba19758bc5
|
|
BLAKE2b-256 checksum How to use checksums |
b069c720b15a2ab1c931349b4836810a155080e630dfa2368635de6e4eb5dd1c
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.16
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Nov 28, 2026.
Transparency logSecurity for comfy-peer-host 0.1.0
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
Full provenance
Both files in this release have been uploaded with provenance metadata.
Attestation for comfy_peer_host-0.1.0.tar.gz
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Nov 28, 2026.
Transparency logA note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.