ImagetoTD_Tagged
Send labeled image streams to TouchDesigner for layered compositing
- images
ImagetoTD_Tagged is the advanced sibling of ImagetoTD in the ComfyUI-TD pack, built for one scenario: you're sending multiple image streams into TouchDesigner and you need TD to tell them apart. Plain ImagetoTD just dumps TOPs in; this one attaches a layer_tag to each image, so the ComfyUI2TD.tox component can route streams into separate layers instead of a pile.
Reach for it when one output isn't enough. Think multi-pass rendering: a depth map on one branch, an RGB render on another, a mask on a third. Give each branch its own tag - "depth", "color", "mask" - and TD can assemble them into a composite or feed them to a shader stack, with each stream landing where you expect it. It's the node that turns a single ComfyUI graph into a multi-texture source for TD's compositing.
How it works
The mechanism is a custom packet rather than ComfyUI's stock preview event. Each image is encoded (PNG or JPEG per your format choice), wrapped in a small binary header - magic bytes, a version, a format code, the tag, and the image bytes - and pushed over the WebSocket via a dedicated message type. The tox reads the tag out of that header and uses it to place the image in the right layer. Note that, unlike the other image nodes, there's no broadcast toggle here: tagged packets are always sent to all connected clients.
The inputs
An output node - the result lives in TD's layers, not on a socket.
- images - the
IMAGEsocket. - format -
pngorjpeg, defaultpng. PNG for fidelity; JPEG when payload size matters, withqualitybelow. - layer_tag - the string that labels this stream, default
"depth". Give every branch you want separated a distinct tag. - quality - 1–100, default 95; only applies to the JPEG format.
Install
ComfyUI Manager search ComfyUI-TD, or:
cd ComfyUI/custom_nodes
git clone https://github.com/JiSenHua/ComfyUI-TD.git
Restart, and install the ComfyUI2TD.tox component from the repo's tox folder (v5.1.x+). Dependencies (trimesh, imageio-ffmpeg, soundfile, plyfile) come along automatically.
Gotchas
Two things trip people up. First, the tag is only useful if TD knows what to do with it - you need a tox/preset set up to consume tagged layers, or the tags are just metadata. Second, because there's no broadcast switch, this node is always broadcasting to every connected client; on a shared setup that's surprising, on a single-client setup it's a non-issue. Keep tag strings short and consistent - the header stores them as UTF-8 bytes and the tag length is capped, so long or per-run-random tags will bite you eventually.
Inputs (4)
| Name | Type | Default | Description |
|---|---|---|---|
| images | IMAGE | — | |
| format | COMBO | png | 2 options: png, jpeg |
| layer_tag | STRING | depth | — |
| quality | INT | 951–100 | — |
Outputs (0)
No outputs