ComfyUI  >  Nodes  >  Bmad Nodes >  Input/String to Int Array

ComfyUI Node: Input/String to Int Array

Class Name

Input_String to Int Array

Category
Bmad/api/parseInput
Author
bmad4ever (Account age: 3591 days)
Extension
Bmad Nodes
Latest Updated
8/2/2024
Github Stars
0.1K

How to Install Bmad Nodes

Install this extension via the ComfyUI Manager by searching for  Bmad Nodes
  • 1. Click the Manager button in the main menu
  • 2. Select Custom Nodes Manager button
  • 3. Enter Bmad Nodes in the search bar
After installation, click the  Restart button to restart ComfyUI. Then, manually refresh your browser to clear the cache and access the updated list of nodes.

Visit ComfyUI Online for ready-to-use ComfyUI environment

  • Free trial available
  • High-speed GPU machines
  • 200+ preloaded models/nodes
  • Freedom to upload custom models/nodes
  • 50+ ready-to-run workflows
  • 100% private workspace with up to 200GB storage
  • Dedicated Support

Run ComfyUI Online

Input/String to Int Array Description

Converts comma-separated integers string to integer array for structured data processing.

Input/String to Int Array:

The Input_String to Int Array node is designed to convert a string of comma-separated integers into an array of integers. This node is particularly useful when dealing with input data that may come in different formats, such as JSON requests or web UI inputs. By accepting both string and array types as inputs, it provides flexibility and ensures compatibility with various data sources. The primary function of this node is to parse the input string, split it by commas, and convert each segment into an integer, resulting in an array of integers. This capability is essential for scenarios where numerical data needs to be processed or analyzed in a structured format.

Input/String to Int Array Input Parameters:

inStr

The inStr parameter is the input string that contains the integers to be converted into an array. This string should have integers separated by commas. For example, "1,2,3,4" will be converted into the array [1, 2, 3, 4]. If the input is already an array of integers, the node will recognize it and return it as is. This parameter ensures that the node can handle both string and array inputs, making it versatile for different use cases. The default value for this parameter is an empty string ("").

Input/String to Int Array Output Parameters:

INT_ARRAY

The INT_ARRAY output parameter is the resulting array of integers after the input string has been processed. This array is generated by splitting the input string by commas and converting each segment into an integer. If the input was already an array of integers, it will be returned directly. This output is crucial for further processing or analysis of numerical data in a structured format.

Input/String to Int Array Usage Tips:

  • Ensure that the input string is correctly formatted with integers separated by commas to avoid conversion errors.
  • Use this node to preprocess numerical data from JSON requests or web UI inputs before performing any calculations or analyses.
  • If you are unsure whether the input will be a string or an array, this node can handle both, providing flexibility in data handling.

Input/String to Int Array Common Errors and Solutions:

Invalid input format

  • Explanation: The input string is not correctly formatted, or it contains non-integer values.
  • Solution: Ensure that the input string contains only integers separated by commas. For example, "1,2,3" is valid, but "1, two, 3" is not.

Empty input string

  • Explanation: The input string is empty, resulting in an empty array.
  • Solution: Provide a valid input string with integers separated by commas to get a meaningful output array.

Input is not a string or array

  • Explanation: The input provided is neither a string nor an array.
  • Solution: Ensure that the input is either a string of comma-separated integers or an array of integers. Other data types are not supported.

Input/String to Int Array Related Nodes

Go back to the extension to check out more related nodes.
Bmad Nodes
RunComfy

© Copyright 2024 RunComfy. All Rights Reserved.

RunComfy is the premier ComfyUI platform, offering ComfyUI online environment and services, along with ComfyUI workflows featuring stunning visuals.