Nodes/ComfyUI-TD/StringtoTD
ComfyUI Node

StringtoTD

Send prompts, seeds, and metadata from ComfyUI to TouchDesigner

By JiSenHua·Created 2 years ago·Updated 12 days ago· 164
StringtoTD
      broadcastfalse
      prefix
      text

      StringtoTD is the quiet utility of the ComfyUI-TD pack: it takes a text value from your graph and streams it into TouchDesigner over WebSocket, where the ComfyUI2TD.tox component parses it into a CHOP/DAT you can use however you like. It's the smallest node in the pack and also the easiest one to underestimate.

      Because it's just text, the use cases are wherever you want a piece of information from the generation side to show up live in the TD project. Show the active prompt on a screen in a live show. Send the seed so TD can log or replay it. Push a wildcard choice or a filename so TD's save logic matches what ComfyUI actually did. If you've ever built a generative performance where the on-screen text and the prompt were drifting out of sync, this is the node that fixes it.

      How it works

      Mechanically it's as simple as the pack gets: prefix and text are concatenated, the result is UTF-8 encoded, and the bytes go over ComfyUI's binary WebSocket via a custom message type the tox listens for. The tox turns the incoming string into data you can wire into text displays, DAT operations, or parameter logic in TD. There's no file, no queue, no compression - it's a raw text stream.

      The inputs

      It's an output node, so nothing wires onward - the text shows up on the TD side.

      • prefix - a required string that gets prepended to everything. Handy for tagging ("prompt: ", "seed: ") so TD can parse it later, or for routing.
      • text - optional. The payload itself; wire in any string output from your graph, like a prompt or seed.
      • broadcast - off by default (current client only); on for multi-client setups.

      Both strings can be empty, and the node handles that fine - it just sends whatever prefix + text evaluates to, including nothing at all. If you don't have a text source, you can type a literal string into the widget and it still sends.

      Install

      Same as the rest of the pack - ComfyUI Manager search ComfyUI-TD, or:

      cd ComfyUI/custom_nodes
      git clone https://github.com/JiSenHua/ComfyUI-TD.git
      

      Restart ComfyUI; Manager pulls in the dependencies (trimesh, imageio-ffmpeg, soundfile, plyfile). And as always with this pack, the ComfyUI2TD.tox component (repo's tox folder, v5.1.x+) is the other half of the bridge - without it the node runs, sends, and nothing happens in TD.

      Gotchas

      There's not much to trip over here, which is the point. One thing worth remembering: prefix and text are concatenated with no separator inserted, so you probably want a trailing space or colon in prefix - "seed:" plus "123456" gives you "seed:123456", but an empty prefix and a bare payload glue together into one blob. And since it's just text over a stream, there's no built-in rate limiting: if you hook a node that fires constantly into it, TD gets a flood of strings, so gate it or use it where it fires per-job.

      CategoryTouchDesigner

      Inputs (3)

      NameTypeDefaultDescription
      broadcastBOOLEANfalse
      prefixSTRING
      textoptSTRING

      Outputs (0)

      No outputs