ComfyUI  >  Nodes  >  ComfyUI-0246 >  Script Rule

ComfyUI Node: Script Rule

Class Name


Trung0246 (Account age: 3389 days)
Latest Updated
Github Stars

How to Install ComfyUI-0246

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

Script Rule Description

Facilitates script rule execution with various modes for flexible automation in ComfyUI framework.

Script Rule:

The 0246.ScriptRule node is designed to facilitate the execution of specific script rules within the ComfyUI framework. This node allows you to define and apply different modes of script execution, such as direct execution, slicing, or cycling through data. By leveraging these modes, you can control how scripts are processed and applied to your data, enabling more flexible and powerful automation workflows. The primary goal of this node is to provide a structured way to manage and execute scripts based on predefined rules, enhancing the efficiency and effectiveness of your AI art generation processes.

Script Rule Input Parameters:


The script_rule_mode parameter determines the mode of script execution. It accepts three options: "_", "slice", and "cycle". When set to "_", the script is executed directly without any modifications. The "slice" mode divides the input data into slices and processes each slice individually, which can be useful for batch processing. The "cycle" mode cycles through the input data, applying the script to each item in a round-robin fashion. This parameter is crucial for defining how the script should be applied to the data, and selecting the appropriate mode can significantly impact the results and performance of the node.

Script Rule Output Parameters:


The script_rule_data output parameter contains the processed script data based on the selected execution mode. This output is essential as it provides the resulting data after the script has been applied according to the specified rules. The script_rule_data can be used in subsequent nodes or processes within your workflow, enabling you to build complex and dynamic automation pipelines.

Script Rule Usage Tips:

  • When dealing with large datasets, consider using the "slice" mode to process the data in smaller, more manageable chunks, which can improve performance and reduce memory usage.
  • Use the "cycle" mode when you need to apply the script to each item in a dataset in a sequential manner, ensuring that each item is processed in turn.
  • For simple, straightforward script execution without any modifications, use the "_" mode to apply the script directly to the input data.

Script Rule Common Errors and Solutions:

Invalid rule mode "<script_rule_mode>".

  • Explanation: This error occurs when an unsupported or incorrect value is provided for the script_rule_mode parameter.
  • Solution: Ensure that the script_rule_mode parameter is set to one of the following valid options: "_", "slice", or "cycle".

Script rule loop mode "<script_rule_loop_mode>" is not supported yet.

  • Explanation: This error indicates that the specified loop mode for the script rule is not recognized or implemented.
  • Solution: Verify that the script_rule_loop_mode parameter is set to a supported value. If the mode you need is not supported, consider using an alternative mode or updating the node to include the desired functionality.

Script rule pin mode "<script_rule_pin_mode>" is not supported yet.

  • Explanation: This error signifies that the provided pin mode for the script rule is not available or recognized by the node.
  • Solution: Check the script_rule_pin_mode parameter and ensure it is set to a valid and supported value. If necessary, consult the documentation or update the node to support the required pin mode.

Script Rule Related Nodes

Go back to the extension to check out more related nodes.

© 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.