ComfyUI > Nodes > ComfyUI-iTools > iTools Prompt Loader

ComfyUI Node: iTools Prompt Loader

Class Name

iToolsPromptLoader

Category
iTools
Author
MohammadAboulEla (Account age: 1256days)
Extension
ComfyUI-iTools
Latest Updated
2025-02-08
Github Stars
0.04K

How to Install ComfyUI-iTools

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

iTools Prompt Loader Description

Streamline prompt retrieval from text files, access specific lines efficiently, dynamic prompt selection, handle fallback scenarios.

iTools Prompt Loader:

The iToolsPromptLoader is a versatile node designed to streamline the process of retrieving prompts from a text file. Its primary function is to access a specified line within a text file, using a given index, and return the corresponding prompt. This node is particularly beneficial for AI artists who work with a large collection of prompts, as it allows for efficient and organized access to specific lines without manually searching through the file. By leveraging a seed value, the node can dynamically select prompts, which is useful for generating varied outputs or testing different scenarios. The node's ability to handle fallback scenarios ensures that even if an index is out of range, a valid prompt can still be retrieved, enhancing its robustness and reliability.

iTools Prompt Loader Input Parameters:

file_path

The file_path parameter specifies the location of the text file from which prompts will be loaded. It is a string input that defaults to 'prompts.txt', indicating the file's name. This parameter is crucial as it directs the node to the correct file, ensuring that the desired prompts are accessed. The file path should be accurate and point to an existing file; otherwise, the node will not be able to retrieve the prompts. The file_path does not support multiline input, emphasizing the need for a precise file location.

seed

The seed parameter is an integer that determines the index of the line to be retrieved from the text file. It defaults to 0, with a minimum value of 0 and a maximum value of 0xffff (65535). This parameter is essential for selecting specific prompts based on their line number, starting from zero. The seed value allows for controlled and repeatable access to prompts, which is particularly useful in scenarios where specific prompts need to be revisited or tested. If the seed exceeds the number of lines in the file, the node can use a fallback mechanism to wrap around and select a valid line.

iTools Prompt Loader Output Parameters:

prompt

The prompt output is a string that contains the text retrieved from the specified line in the text file. This output is the primary result of the node's operation, providing the user with the exact prompt they need based on the input parameters. The prompt is essential for further processing or use in AI art generation, as it serves as the foundational text input for various creative tasks.

count

The count output is an integer representing the total number of lines in the text file. This output is important for understanding the scope of the file and for validating the seed value. By knowing the total line count, users can make informed decisions about which seed values to use and can anticipate the behavior of the node when the seed exceeds the available lines.

iTools Prompt Loader Usage Tips:

  • Ensure that the file_path is correctly specified and points to an existing text file to avoid errors related to file access.
  • Use the seed parameter strategically to access specific prompts or to iterate through prompts in a controlled manner, especially when testing different scenarios or generating varied outputs.
  • Consider using the fallback mechanism by setting the seed to a value that might exceed the line count, allowing the node to wrap around and still provide a valid prompt.

iTools Prompt Loader Common Errors and Solutions:

File not exist, <file_path>

  • Explanation: This error occurs when the specified file path does not point to an existing file, preventing the node from accessing the prompts.
  • Solution: Verify that the file_path is correct and that the file exists at the specified location. Ensure there are no typos or incorrect directory paths.

IndexError

  • Explanation: This error happens when the seed value exceeds the number of lines in the file, and the fallback mechanism is not enabled or fails.
  • Solution: Enable the fallback mechanism by setting it to "Yes" or adjust the seed value to be within the range of available lines in the file.

iTools Prompt Loader Related Nodes

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