ComfyUI Node Runs on cloud

String debug print

Log a string to the console with a label

By Derfuu·Created 3 years ago·Updated 2 years ago· 455
String debug print
      Prefix
      Text

      Text in ComfyUI goes wrong in quiet ways - a concat that dropped a delimiter, a wildcard that resolved to something unexpected, a prompt that isn't what you think it is. String debug print is the node that makes it visible: hand it a string and a label, and it prints prefix: text to the console when the graph runs. It's a terminal sink - nothing exits the other side - so you tap the text you're unsure about and read the log.

      How it works

      It takes a text value plus a prefix label and writes them to standard output during execution. The prefix lets you tell multiple prints apart in the log. As an output node it executes independently, without needing a downstream connection, so you can hang it off any string in the graph purely to inspect it.

      The inputs and outputs that matter

      • Prefix (STRING) - a label printed before the text, e.g. resolved prompt so you know which print is which.
      • Text (STRING) - the string to print.
      • No outputs - it's a debug sink, not a pass-through.

      Where it fits

      Reach for it whenever you're building or transforming prompts and the result matters. After a concat, a replace, or a {a|b|c} wildcard expansion, print the string here to confirm it came out right before it hits the text encoder and you spend a generation finding out. Because it logs to the console, it pairs well with watching the terminal during batch runs. If you'd rather see the value on the node itself and keep the wire flowing, Derfuu's To text (Debug) shows any type in a widget and passes it through - often the more convenient tool.

      How to install it

      ComfyUI Manager: search Derfuu_ComfyUI_ModdedNodes, install, restart. Manual:

      cd ComfyUI/custom_nodes
      git clone https://github.com/Derfuu/Derfuu_ComfyUI_ModdedNodes
      

      then restart. No dependencies, no models - plain Python.

      Common issues & troubleshooting

      Nothing shows up. The text prints to the console where ComfyUI runs, not to the browser. If you're on a desktop launcher or a hosted setup, open the terminal/log to see it. It also only fires when the node executes - a pruned branch prints nothing.

      Wrong type going in. The input is STRING. To print a number, convert it first or use Int debug print for integers.

      It's a dead end. By design there's no output. If you need to inspect and keep the string moving, use To text (Debug), which passes its input through.

      Node red after a pack update. Derfuu has a history of deleting deprecated nodes on updates instead of leaving them labeled, so old workflows can reference names that no longer exist - reconnect a current copy. A ModuleNotFoundError about Derfuu_ComfyUI_ModdedNodes_legacy means a duplicated folder; keep exactly one, named Derfuu_ComfyUI_ModdedNodes.

      CategoryDerfuu_Nodes/Debug

      Inputs (2)

      NameTypeDefaultDescription
      PrefixSTRING
      TextSTRING

      Outputs (0)

      No outputs