ComfyUI > Nodes > ComfyUI > Extract Text from JSON

ComfyUI Node: Extract Text from JSON

Class Name

JsonExtractString

Category
text
Author
ComfyAnonymous (Account age: 763days)
Extension
ComfyUI
Latest Updated
2026-05-13
Github Stars
112.77K

How to Install ComfyUI

Install this extension via the ComfyUI Manager by searching for ComfyUI
  • 1. Click the Manager button in the main menu
  • 2. Select Custom Nodes Manager button
  • 3. Enter ComfyUI 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
  • 16GB VRAM to 80GB VRAM GPU machines
  • 400+ preloaded models/nodes
  • Freedom to upload custom models/nodes
  • 200+ ready-to-run workflows
  • 100% private workspace with up to 200GB storage
  • Dedicated Support

Run ComfyUI Online

Extract Text from JSON Description

Simplify JSON text value extraction process for specific keys, automating data retrieval without manual parsing.

Extract Text from JSON:

The JsonExtractString node is designed to simplify the process of extracting specific text values from JSON data. This node is particularly useful when you need to parse JSON strings and retrieve values associated with specific keys. By automating the extraction process, it eliminates the need for manual parsing, making it easier for you to work with JSON data without requiring extensive programming knowledge. The node's primary goal is to provide a straightforward method for accessing and utilizing data stored in JSON format, which is commonly used in various applications and data exchanges. This functionality is essential for tasks that involve data manipulation, integration, and analysis, allowing you to focus on creative aspects rather than technical details.

Extract Text from JSON Input Parameters:

json_string

The json_string parameter is the input where you provide the JSON data in string format. This parameter is crucial as it contains the data from which you want to extract specific values. The JSON string should be well-formed and valid, as any errors in the JSON structure can lead to unsuccessful extraction. There are no specific minimum or maximum values for this parameter, but it should be a valid JSON string. This parameter supports multiline input, allowing you to input complex JSON structures.

key

The key parameter specifies the exact key within the JSON data whose value you wish to extract. This parameter is essential because it determines which part of the JSON data will be accessed and returned by the node. The key should match exactly with the key in the JSON string, including case sensitivity. There are no default values for this parameter, and it does not support multiline input, as keys are typically single-line strings.

Extract Text from JSON Output Parameters:

output

The output parameter provides the extracted value from the JSON data corresponding to the specified key. If the key is found and the value is not None, the node returns this value as a string. If the key is not found or the value is None, the output will be an empty string. This output is crucial for further processing or analysis, as it allows you to access specific data points from a larger JSON structure.

Extract Text from JSON Usage Tips:

  • Ensure that the JSON string is correctly formatted and valid to avoid extraction errors.
  • Use precise key names to accurately retrieve the desired values from the JSON data.
  • If working with complex JSON structures, consider using a JSON validator tool to check the structure before inputting it into the node.

Extract Text from JSON Common Errors and Solutions:

JSONDecodeError

  • Explanation: This error occurs when the provided JSON string is not properly formatted or contains syntax errors.
  • Solution: Verify that the JSON string is correctly formatted and adheres to JSON syntax rules. Use a JSON validator to check for errors.

KeyError

  • Explanation: This error happens when the specified key does not exist in the JSON data.
  • Solution: Double-check the key name for typos or case sensitivity issues. Ensure that the key exists in the JSON structure.

TypeError

  • Explanation: This error might occur if the JSON string is not a valid JSON object or if the key is not a string.
  • Solution: Ensure that the JSON string is a valid JSON object and that the key is provided as a string.

Extract Text from JSON Related Nodes

Go back to the extension to check out more related nodes.
ComfyUI
RunComfy
Copyright 2025 RunComfy. All Rights Reserved.

RunComfy is the premier ComfyUI platform, offering ComfyUI online environment and services, along with ComfyUI workflows featuring stunning visuals. RunComfy also provides AI Models, enabling artists to harness the latest AI tools to create incredible art.

Extract Text from JSON