Anything To String
When ComfyUI won't let you wire an INT into a text box
- input
- STRING
ComfyUI is annoyingly strict about types. An INT will not plug into a STRING port, a seed won't drop into a text field, and half the frustration of building a workflow is hunting down why one red connection won't snap. Anything To String is the bridge: one input, one STRING output, zero ceremony. It takes literally whatever you feed it and returns str(input).
That's the whole mechanism, by the way - a single Python str() call under the hood. Feed it an int, a float, a seed from a KSampler, a count from another node, and out the other side you get its text form ready for a filename, a prompt, or whatever else wants a string. The node's input accepts ComfyUI's ANY type, so nothing is rejected at the socket.
The catch - and it's worth knowing before it bites you - is that "anything" includes things whose string form is useless. str() on a float gives you full Python precision (0.10000000000000001, not 0.1). str() on a list gives you ['a', 'b'], brackets and quotes included. And if you wire in an actual IMAGE or LATENT, you get something like <comfy.some.Object object at 0x7f...> - a memory address that helps nobody. In practice you'll use this with primitives: ints, floats, seeds, and strings. For anything fancier you want a proper formatter, not this.
So when do you actually reach for it? The classic case is filename building. Say Count Files In Directory hands you an INT (how many mp4s already exist), you run it through Pad Zeroes to get 0042, and then you need to shove that into a Save Video filename field that only accepts STRING. Anything To String is what makes that last wire connect.
Install is about as painless as a custom node gets. In ComfyUI Manager, search "Arkl1te's Toolkit" and install; or clone it yourself:
cd ComfyUI/custom_nodes
git clone https://github.com/cybernaut4/comfyui_arkl1te_toolkit
Then restart ComfyUI. There's no requirements.txt and the pack declares zero Python dependencies - it only needs ComfyUI's own comfy.comfy_types module, which is already there. No model files, no pip install, nothing to break. That's rarer in this ecosystem than it should be; most packs drag in a dependency pile that can collide with your other nodes.
Troubleshooting is mostly just "look at what you actually fed it." If the output is a Python None string or a repr you don't want, the fix is upstream, not in this node. It does exactly what it says, and it says very little.
Inputs (1)
| Name | Type | Default | Description |
|---|---|---|---|
| input | * | — |
Outputs (1)
| Name | Type | Description |
|---|---|---|
| STRING | STRING | — |