Nodes/DarkPrompts/Dark Any to String
ComfyUI Node

Dark Any to String

The 30-second fix when some node hands you a type ComfyUI won't show you

By darkpixel·Created 3 years ago·Updated about a year ago· 11
Dark Any to String
  • anything
  • STRING

DarkAnyToString is exactly as simple as its name: you feed it anything and it hands you a string. The entire implementation is str(anything). There is no hidden magic, no settings, no model to download - which is precisely the point.

The backstory is the honest reason this node exists. The author writes in the README that MTB (the mass-tools pack) had an "Any to String" node that broke for them, so they implemented their own. That's the culture of ComfyUI in a nutshell: a node you depend on breaks, and instead of waiting for a fix you ship a 3-line replacement in your own pack. It's a utility you'll be glad to have around even though you'll never think about it.

When you'd actually use it

ComfyUI's node graph is strict about types - a COLOR, a LORA_STACK, a checkpoint filename, a tuple of values - and sometimes you just want to know what's actually flowing through a wire, or you need to stuff a value into a text field. That's this node's job:

  • Debugging. Wire anything into it and run it into a Show Text / preview node and suddenly the mysterious output is readable.
  • Feeding non-string values into string consumers. Some nodes output numbers, lists, or custom types that a text box won't accept. str() coercion fixes the connection.

The anything input is declared with the classic AnyType("*") trick, so it accepts literally any wire - that's what makes it a universal adapter rather than a node with ten duplicate STRING/INT/FLOAT inputs.

The one input, the one output

  • anything (type *) - plug any output in.
  • STRING out - whatever Python's str() makes of it.

That's it. If you're expecting something human-readable out of a tensor or a latent, be warned: str() of a big numeric object is not a description, it's a repr. For debugging shapes and raw values it's perfect; for a friendly summary of what's in an image, you want a captioning node instead.

Install

Same as the rest of the pack - ComfyUI Manager, search "DarkPrompts", install and restart:

cd ComfyUI/custom_nodes
git clone https://github.com/darkpixel/darkprompts.git

Restart ComfyUI afterwards. No dependencies, no models, nothing that can really break. About the only troubleshooting this node ever needs is remembering that it's a converter, not an explainer: if the string looks ugly, that's Python being honest, not the node failing.

CategoryDarkPrompt

Inputs (1)

NameTypeDefaultDescription
anything*

Outputs (1)

NameTypeDescription
STRINGSTRING