TO STRING
Str() for your ComfyUI graph
- value
- STRING
The simplest of the pack's conversion nodes: feed it anything, get text back. Useful for the obvious cases - turning a number or boolean into something you can concatenate into a filename, a save prefix, or a log line - and, being generically typed, it'll technically accept anything at all, even if the result isn't always something you'd want to look at.
It's part of JNComfy (jn-jairo/jn_comfyui), a one-person pack that spans audio, face restoration, and this family of small conversion primitives. There's essentially no community discussion of the pack anywhere, so the README and this node's own schema are the entire reference - nothing to fall back on beyond that.
How it works
value accepts anything, and the node converts it to a STRING representation. For the obvious inputs this is where it earns its keep - a FLOAT of 3.14, an INT of 42, a BOOLEAN of true, all become clean, readable text. Where it's genuinely worth a caveat: the schema doesn't specify special handling for more complex objects - a JNComfy ARRAY, an IMAGE tensor - so feeding it something like that will most likely give you a plain, not-especially-readable text representation rather than a meaningful summary. For anything past a simple scalar, JN_Dump (built specifically for inspection) is the better tool; this node is for building strings, not for debugging complex values.
The other place it's useful, beyond just formatting for display, is bridging a strictly-typed output (say, an INT out of JN_PrimitiveArrayInfo) into something downstream that specifically wants STRING and won't accept a raw number on that socket - the pack's JN_TextConcatenation, named in the README, being the obvious example of a node that only takes text.
The inputs and outputs that matter
value(required, any type) - what you're converting.- Output: STRING.
Installing it
ComfyUI Manager: search "JNComfy". Manual:
cd ComfyUI/custom_nodes
git clone https://github.com/jn-jairo/jn_comfyui
Restart ComfyUI. No models, no dependencies - it's a text cast.
Common issues & troubleshooting
Converting a number gives you more or fewer decimal places than expected. This node does a plain conversion, not formatted output - if you need a specific number of decimal places or a rounded value before it becomes text, run it through JN_PrimitiveToFloat (with its decimal_places/round_method controls) first, then convert that result to a string.
Converting a complex object produces unreadable text. As above - this node isn't built for pretty-printing structured data. Use JN_Dump to actually inspect an array, an image, or anything non-scalar; save this node for simple values headed into a filename or a concatenated string.
Feeding the output into something that expects a specific text format (a date string, a JSON fragment). This node does a generic conversion only - it has no awareness of any particular target format, so match your expectations to what a plain str()-style cast actually produces before assuming it'll match a format some other node wants.
Inputs (1)
| Name | Type | Default | Description |
|---|---|---|---|
| value | * | — |
Outputs (1)
| Name | Type | Description |
|---|---|---|
| STRING | STRING | — |