Bridge Input (LATENT)
Hooking into workflows at the sampler
- value
- value
Latents are the compressed space where the diffusion actually happens - you VAE-encode pixels into a latent, sample, then VAE-decode back. Most beginners never touch a latent directly; ComfyUI hides it inside the Empty Latent → KSampler → VAE Decode chain. Bridge Input (LATENT) is for when you want that latent stage to be a named, controllable point in an agent-driven workflow.
Mechanically it's a passthrough with LATENT sockets: optional value input, single value output. Wire an Empty Latent (or any latent-producing node - an image-to-latent encode, a latent upscaler) into the input, take the output to the KSampler's latent input. The client treats it like the other complex types - it doesn't synthesize a latent dict on its own. The name widget (STRING, default "input_name") is the tag that extract_schema() reports, so the agent knows "a latent enters the sampler at this point."
What this buys you in practice is structure: the workflow author decides which latent source feeds the sampler, the bridge marks it, and an agent or script can reason about the workflow - swap the upstream latent generator, change its settings via sibling scalar bridges - without the latent tensor itself ever being serialized over the wire. Latents are also one of the few complex types the client can serialize on the way out (a latent dict becomes {"__type__": "latent", ...} metadata at a Bridge Output), which is handy for debugging what actually reached the sampler.
Install
cd ComfyUI/custom_nodes
git clone https://github.com/cbpark84/ComfyBridgeIO
Restart ComfyUI, or ComfyUI Manager → search ComfyBridgeIO → Install. No models, no heavy deps. The Python client (optional, pip install -e in the repo) uses aiohttp, websockets, Pillow. The README's clone URL points at nicekate/ComfyBridgeIO - that's stale, the repo is cbpark84 as above.
Common issues
The usual unwired-input trap: no latent connected means the sampler gets nothing, and the graph fails at the KSampler with a "got invalid input" style error rather than something helpful. Wire the latent source inside ComfyUI. And if you're chasing a mismatch where the image doesn't match your resolution expectations, remember the latent's shape is set upstream (Empty Latent's width/height), not by this node - it only passes through.
Inputs (2)
| Name | Type | Default | Description |
|---|---|---|---|
| name | STRING | input_name | — |
| valueopt | LATENT | — |
Outputs (1)
| Name | Type | Description |
|---|---|---|
| value | LATENT | — |