ComfyUI  >  Nodes  >  comfyui_LLM_party >  故事JSON工具(story_json_tool)

ComfyUI Node: 故事JSON工具(story_json_tool)

Class Name

story_json_tool

Category
大模型派对(llm_party)/工具(tools)
Author
heshengtao (Account age: 2893 days)
Extension
comfyui_LLM_party
Latest Updated
6/22/2024
Github Stars
0.1K

How to Install comfyui_LLM_party

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

故事JSON工具(story_json_tool) Description

Facilitates extraction and manipulation of story data stored in JSON format for AI artists.

故事JSON工具(story_json_tool):

The story_json_tool is designed to facilitate the extraction and manipulation of story data stored in JSON format. This node is particularly useful for AI artists who need to access specific chapters or sections of a story without manually parsing the JSON file. By providing a straightforward interface to query and retrieve story content, it simplifies the process of working with structured story data, allowing you to focus on creative tasks rather than technical details. The primary function of this node is to read a specified chapter from a JSON file and return it in a well-formatted JSON string, making it easy to integrate with other tools and workflows.

故事JSON工具(story_json_tool) Input Parameters:

path

This parameter specifies the path to the JSON file containing the story data. It can be either an absolute path or a relative path, depending on the path_type setting. The default value is "story.json", which assumes the file is located in the current directory. If the path is incorrect or the file does not exist, the node will not be able to read the story data.

is_enable

This boolean parameter determines whether the node is active. If set to False, the node will not perform any operations and will return None. The default value is True, enabling the node to function as expected. This parameter is useful for conditionally enabling or disabling the node based on your workflow requirements.

path_type

This parameter specifies whether the path is an absolute path or a relative path. It accepts two options: "Absolute_Path" and "Relative_Path", with the default being "Relative_Path". This setting helps the node correctly interpret the provided file path, ensuring it can locate and read the JSON file.

故事JSON工具(story_json_tool) Output Parameters:

tools

The output parameter tools is a JSON string that contains the extracted story data for the specified chapter. This output is formatted to ensure readability and ease of use, making it simple to integrate with other tools or processes. The JSON string includes the content of the requested chapter, allowing you to access and manipulate the story data as needed.

故事JSON工具(story_json_tool) Usage Tips:

  • Ensure the path parameter correctly points to the JSON file containing your story data. Double-check the file path and name to avoid errors.
  • Use the is_enable parameter to conditionally enable or disable the node based on your workflow needs. This can help streamline your process by only activating the node when necessary.
  • Set the path_type parameter appropriately to ensure the node correctly interprets the file path. Use "Absolute_Path" for full file paths and "Relative_Path" for paths relative to the current directory.

故事JSON工具(story_json_tool) Common Errors and Solutions:

FileNotFoundError: [Errno 2] No such file or directory: '<path>'

  • Explanation: This error occurs when the specified file path does not exist or is incorrect.
  • Solution: Verify that the path parameter is correct and that the file exists at the specified location. Ensure the path_type is set correctly.

JSONDecodeError: Expecting value: line 1 column 1 (char 0)

  • Explanation: This error indicates that the JSON file is empty or contains invalid JSON.
  • Solution: Check the contents of the JSON file to ensure it is properly formatted and not empty. Use a JSON validator to confirm the file's integrity.

KeyError: '<chapter>'

  • Explanation: This error occurs when the specified chapter does not exist in the JSON file.
  • Solution: Verify that the chapter number provided in the query exists in the JSON file. Check the structure of the JSON to ensure the chapter keys are correct.

故事JSON工具(story_json_tool) Related Nodes

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