ComfyUI > Nodes > ComfyUI-CoCoTools > JSON Reader

ComfyUI Node: JSON Reader

Class Name

JSONReaderNode

Category
COCO Tools/JSON Tools
Author
Conor-Collins (Account age: 431days)
Extension
ComfyUI-CoCoTools
Latest Updated
2025-03-05
Github Stars
0.03K

How to Install ComfyUI-CoCoTools

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

JSON Reader Description

Extract specific metadata from JSON files for AI art by reading seed values and prompts efficiently.

JSON Reader:

The JSONReaderNode is designed to facilitate the extraction of specific metadata from JSON files, making it an essential tool for AI artists who work with structured data. This node allows you to read and retrieve key information such as seed values and prompts from JSON files, which can be crucial for generating consistent and reproducible AI art. By specifying a folder path and a file name, the node efficiently locates and reads the desired JSON file, extracting the necessary metadata to be used in your creative processes. This functionality is particularly beneficial for managing and utilizing metadata in large datasets, ensuring that you can easily access and leverage the information needed for your projects.

JSON Reader Input Parameters:

folder_path

The folder_path parameter specifies the directory where the JSON file is located. It is crucial for guiding the node to the correct location to find the file you want to read. The default value is set to "D:/Default_Folder/", but you can change it to any valid directory path where your JSON files are stored. This parameter ensures that the node knows where to look for the file, and an incorrect path will result in the node being unable to locate the file.

name

The name parameter is used to specify the name of the JSON file (without the .json extension) that you wish to read. This parameter is essential because it allows the node to construct the full file path by appending the .json extension to the provided name and combining it with the folder_path. The default value is "metadata", but you can change it to match the specific file you need to access. This parameter ensures that the node reads the correct file and retrieves the desired metadata.

JSON Reader Output Parameters:

Seed

The Seed output parameter represents the seed value extracted from the JSON file. This value is often used in AI art generation to ensure reproducibility of results, as it allows the same random processes to be repeated. If the seed is not found in the JSON file, a default value of 0 is returned. This output is crucial for artists who need to recreate specific outputs or maintain consistency across different runs.

Positive Prompt

The Positive Prompt output parameter contains the positive prompt extracted from the JSON file. This prompt is typically used to guide the AI in generating desired features or characteristics in the artwork. If the positive prompt is not found, the node returns "MISSING KEY" to indicate the absence of this information. This output is important for directing the AI's creative process in a positive direction.

Negative Prompt

The Negative Prompt output parameter includes the negative prompt extracted from the JSON file. This prompt is used to instruct the AI on what to avoid or minimize in the generated artwork. Similar to the positive prompt, if the negative prompt is not found, the node returns "MISSING KEY". This output helps in refining the AI's output by specifying undesirable elements to be excluded from the final result.

JSON Reader Usage Tips:

  • Ensure that the folder_path is correctly set to the directory containing your JSON files to avoid file not found errors.
  • Use descriptive and consistent names for your JSON files to make it easier to specify the name parameter and locate the correct file.
  • Regularly update your JSON files with accurate metadata to ensure that the node retrieves the most relevant and useful information for your projects.

JSON Reader Common Errors and Solutions:

<name>`.json not found in `<folder_path>

  • Explanation: This error occurs when the specified JSON file cannot be found in the provided directory path.
  • Solution: Verify that the folder_path and name parameters are correctly set and that the file exists in the specified location.

Invalid JSON format in file '<json_file_path>'

  • Explanation: This error indicates that the JSON file is not properly formatted and cannot be parsed.
  • Solution: Check the JSON file for syntax errors and ensure it adheres to the correct JSON structure.

Key '<key_to_find>' not found in available keys: <list_of_keys>``

  • Explanation: This error occurs when the specified key is not present in the JSON file.
  • Solution: Ensure that the JSON file contains the expected keys and that they are correctly spelled and structured.

JSON Reader Related Nodes

Go back to the extension to check out more related nodes.
ComfyUI-CoCoTools
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 Playground, enabling artists to harness the latest AI tools to create incredible art.