ComfyUI Node Runs on cloud

String to Int

StringToInt — convert a text value into an integer ComfyUI can use

By sipherxyz·Created 3 years ago·Updated 4 months ago· 352
String to Int
    • INT
    string0

    Type-glue. ComfyUI is strict about types - a slot that wants an INT won't accept a STRING, even if the string is literally "512". StringToInt is the little adapter that bridges that gap: text in, integer out. Unremarkable on its own, genuinely necessary the moment you're moving values around as text.

    Where it comes up: you pulled a number out of a JSON blob with GetTextFromJson (which hands you a string), or you're reading a value from a text widget, or an API sends dimensions as text - and now you need to feed that into a node expecting an INT, like a width, a step count, or a seed. Drop this in between and the types line up. It's the partner node to Art Venture's JSON and text nodes, which is exactly why it exists in a pack built around URLs and JSON.

    How it works

    It parses the input string into an integer and outputs it. Straightforward - the value has to be a whole number in text form for a clean conversion.

    The inputs and outputs that matter

    • string - the text to convert, default "0". Wire it from whatever produced the string (a JSON get-node, a text field, an API parameter), or type a literal.

    Output is a single INT. Wire it into any integer slot - width, height, steps, seed, batch size, and so on.

    How to install it

    Part of the Art Venture pack. ComfyUI Manager → search comfyui-art-venture → Install → restart. Manually:

    cd ComfyUI/custom_nodes
    git clone https://github.com/sipherxyz/comfyui-art-venture
    

    then pip install -r comfyui-art-venture/requirements.txt and restart. No model download.

    Common issues & troubleshooting

    It errors or gives 0 on decimal text. StringToInt wants a whole number. If your string is "3.5", that's a float in text form and integer parsing will choke or truncate. Convert to a float first (or round it) before this node, or use a float-conversion path if you actually need the fractional part.

    Non-numeric text breaks it. "512px", "1,024", or " 512 " with stray characters aren't clean integers. Strip units, commas, and whitespace upstream so you're handing this node bare digits.

    Why not just type the number? If it's a constant, do - you don't need this. The node earns its place only when the value arrives as a string from somewhere else (JSON, API, text node) and has to become an INT to plug into a numeric input. It's a bridge, not a keypad.

    Node missing after a workflow import. The pack isn't installed - Manager → Install Missing Custom Nodes pulls the whole Art Venture set.

    CategoryArtVenture/Utils

    Inputs (1)

    NameTypeDefaultDescription
    stringSTRING0

    Outputs (1)

    NameTypeDescription
    INTINT