Agent Emit (→ agent)
Hand your image, prompt, and seed to a coding agent mid-workflow
- image
- text
- image
- seed
The arrow in the display name - Agent Emit (→ agent) - is the whole node. This is the outbound half of a two-node bridge: it takes whatever your graph has produced and hands it to a coding agent (Claude Code or Codex) that's running outside ComfyUI. It does no generation, no thinking. It's a mailbox, and it's the piece that lets an external agent see your workflow's work mid-pipeline, not after you export a file.
The "why" matters more than the node. The usual LLM-in-ComfyUI approach runs a language model inside the graph as a node - great for prompt rewriting, but the model is a fixed tool doing one job. This pack flips the direction: the agent is a person (or at least an agent) with its own toolset, and Emit is how the graph says "here's what I just made - you deal with it." That's the pattern for an agentic loop where an agent inspects your render, edits it, and pushes a revised prompt back into a second run.
Mechanically it's simple under the hood. The pack keeps a thread-safe singleton ChannelStore (shared between the nodes and the MCP server by stashing it on builtins, so two import paths can't accidentally get two stores). Each named channel has an inbox - graph → agent - with a turn counter. AgentEmit writes your text, image, and seed into that inbox; the agent reads it with the comfy_pull tool. Text crosses inline; an image gets saved to a PNG in a temp dir (ComfyUI's output/agent_bridge/ by default) and the path is what travels. That path-indirection is the one thing that bites people in Docker, more on that below.
Only three inputs exist and only one is required:
- channel (STRING, default
main) - the mailbox name. Whatever the agent pulls on must match this exactly. - text (multiline STRING) - anything you want the agent to see alongside the image.
- image (IMAGE) - wire any image source in; it's saved and its path is sent.
- seed (INT) - an input socket, so wire a KSampler's seed here. The agent gets it and can feed it back into the next run.
Then the nice part: it returns (text, image, seed) straight through, unchanged. Drop it inline in a chain and it's a no-op tap - nothing downstream breaks, you've just told the agent what passed through. That pass-through design is why it slots into existing workflows without surgery.
Install. Same story as its sibling, both ship in the same pack: cd ComfyUI/custom_nodes && git clone https://github.com/ethanfel/ComfyUI-Agent-Bridge, then pip install -r ComfyUI-Agent-Bridge/requirements.txt (just mcp>=1.2.0) and restart. ComfyUI Manager can do it if you search "comfyui-nodes-agents" - but this is a young pack, so if Manager doesn't list it yet, clone by hand. On startup it logs the bridge URL, e.g. MCP bridge on http://127.0.0.1:9188/mcp. The nodes work even without mcp installed; you just won't get the bridge until you pip install 'mcp>=1.2.0'.
Where people get burned. First, channel names - typo the channel and the agent pulls an empty inbox with zero errors, just a turn: 0. Second, that image is a path to the agent, not pixels: in Docker where ComfyUI and the agent see different mount paths, the agent can't open it. Fix is COMFY_BRIDGE_TMP_PUBLIC - the path the agent should see - plus the same-path mount. And a word of caution: the bridge serves comfy_run_workflow and file reads with no auth, so don't set COMFY_BRIDGE_MCP_HOST=0.0.0.0 anywhere but a trusted LAN.
Inputs (4)
| Name | Type | Default | Description |
|---|---|---|---|
| channel | STRING | main | — |
| textopt | STRING | — | |
| imageopt | IMAGE | — | |
| seedopt | INT | 00–18446744073709550000 | — |
Outputs (3)
| Name | Type | Description |
|---|---|---|
| text | STRING | — |
| image | IMAGE | — |
| seed | INT | — |