STRING To Any 🔽
Cast a string to ANY so it stops fighting ComfyUI's type checker
- any
ComfyUI is picky about types, and sometimes you have a perfectly good STRING that needs to go into a socket that accepts ANY - a trigger input, a third-party node's generic port, a utility that takes anything. This node does exactly one thing: takes a string in and passes it through unchanged, but typed as * (any). That's it. No parsing, no transformation, no magic.
It's one of a family of generated converters in the ComfyUI Telegram Suite pack - the pack ships XToAny nodes for INT, FLOAT, STRING, DICT, MODEL, CLIP, VAE, IMAGE, AUDIO, and LATENT, plus the reverse AnyToX nodes. They exist because the author needed a way to push typed values through the suite's trigger inputs and strict socket typing made that painful.
Why it exists
The honest story: the pack's README explains the trigger mechanism - inputs/outputs that enforce execution order in a workflow. Originally you had to convert a signal to ANY before feeding it into a trigger input, and convert it back afterward. That's precisely why this converter category is so full.
Then version 1.0.4 made the conversion step optional - you can now feed a typed signal straight into a trigger input. The changelog says the XToAny nodes are kept for backward compatibility. So a fresh workflow probably doesn't need them. Where they still earn their keep: any third-party node with a true * input that rejects your typed output. ComfyUI won't auto-coerce types, so a one-node cast is the fix.
How it works
Under the hood it's a trivial pass-through:
def convert(self, STRING):
return (STRING,)
The input is STRING (as a forceInput socket, so you wire a text value in rather than typing a widget), and the output is any of type *. Value in, same value out, type label changed.
Inputs and outputs
STRING(required) - the string to pass through.any(output, type*) - the same string, now typed as any.
Installation
Pack-wide:
cd ComfyUI/custom_nodes
git clone https://github.com/SwissCore92/comfyui-telegram-suite.git
cd comfyui-telegram-suite
pip install -r requirements.txt
or install "ComfyUI Telegram Suite" via ComfyUI Manager and restart. Config file at ComfyUI/user/default/telegram-suite/config.json isn't strictly required for a converter, but the pack's install docs have you set it up anyway if you plan to use the Telegram nodes.
Notes
If you're starting fresh and only needed this for a trigger, skip it - the suite accepts typed triggers directly now. Reach for it when a node with a wildcard input won't take your string. It's a bridge for the type system, not a workflow feature on its own.
Inputs (1)
| Name | Type | Default | Description |
|---|---|---|---|
| STRING | STRING | — |
Outputs (1)
| Name | Type | Description |
|---|---|---|
| any | * | — |