ComfyUI > Nodes > Prompt Info > Extract Info

ComfyUI Node: Extract Info

Class Name

ExtractInfo

Category
prompt_info
Author
chrisgoringe (Account age: 4223days)
Extension
Prompt Info
Latest Updated
2024-05-22
Github Stars
0.03K

How to Install Prompt Info

Install this extension via the ComfyUI Manager by searching for Prompt Info
  • 1. Click the Manager button in the main menu
  • 2. Select Custom Nodes Manager button
  • 3. Enter Prompt Info 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

Extract Info Description

Parse and extract specific information from JSON data structures for AI art projects, simplifying data extraction and workflow.

Extract Info:

The ExtractInfo node is designed to parse and extract specific information from JSON data structures, making it easier to retrieve and utilize relevant data within your AI art projects. This node is particularly useful for handling complex JSON objects, allowing you to navigate through nested structures and extract the exact piece of information you need. By simplifying the process of data extraction, ExtractInfo helps streamline your workflow, ensuring that you can focus more on the creative aspects of your projects rather than getting bogged down by data management tasks.

Extract Info Input Parameters:

info

This parameter expects a JSON string from which the information will be extracted. The JSON string should be well-formed and contain the data structure you wish to navigate. If the JSON is not properly formatted, the node will not be able to process it correctly.

node_id

This parameter specifies the ID of the node within the JSON structure from which you want to extract information. It helps in pinpointing the exact node in a potentially large and complex JSON object.

side

This parameter indicates which side of the node (input or output) you are interested in. It helps in narrowing down the search within the node to either its inputs or outputs.

name

This parameter specifies the name of the attribute or value you want to extract from the node. It allows you to target a specific piece of information within the node's inputs or outputs.

id

This parameter is used for internal tracking and messaging purposes. It helps in sending synchronous messages back to the PromptServer instance, ensuring that the extracted information is communicated effectively.

Extract Info Output Parameters:

thing

This output parameter contains the extracted information from the JSON structure. It can be a string, a JSON object, or a formatted JSON string, depending on the nature of the extracted data.

flt

This output parameter provides the extracted information as a floating-point number, if applicable. If the extracted data cannot be converted to a float, this parameter will be None.

nt

This output parameter provides the extracted information as an integer, if applicable. If the extracted data cannot be converted to an integer, this parameter will be None.

Extract Info Usage Tips:

  • Ensure that the JSON string provided in the info parameter is well-formed to avoid parsing errors.
  • Use the node_id parameter to target specific nodes within a complex JSON structure, making it easier to extract relevant information.
  • Utilize the side and name parameters to narrow down the search within a node, focusing on either inputs or outputs and specific attributes.
  • Check the thing output first to understand the nature of the extracted data before using the flt and nt outputs.

Extract Info Common Errors and Solutions:

JSONDecodeError

  • Explanation: This error occurs when the JSON string provided in the info parameter is not properly formatted.
  • Solution: Ensure that the JSON string is well-formed and valid. Use online JSON validators to check the syntax before using it in the node.

KeyError

  • Explanation: This error occurs when the specified node_id, side, or name does not exist in the JSON structure.
  • Solution: Double-check the JSON structure to ensure that the specified node_id, side, and name are correct and exist within the JSON object.

ValueError

  • Explanation: This error occurs when the extracted data cannot be converted to a float or integer.
  • Solution: Ensure that the data you are trying to extract and convert is indeed a numeric value. If not, handle the data as a string or JSON object instead.

Extract Info Related Nodes

Go back to the extension to check out more related nodes.
Prompt Info
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.