Install this extension via the ComfyUI Manager by searching for
BrushNet
1. Click the Manager button in the main menu
2. Select Custom Nodes Manager button
3. Enter BrushNet 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
Execute custom code and shell commands in ComfyUI with Terminal node for automation and control.
Terminal:
The Terminal node is a versatile utility within the ComfyUI framework designed to execute arbitrary code or shell commands directly from the user interface. This node is particularly useful for advanced users who need to perform custom operations or integrate external scripts and commands into their workflow. By leveraging the Terminal node, you can dynamically execute Python code or shell commands, providing a powerful tool for automation, debugging, and extending the functionality of your AI art projects. The node's primary goal is to offer flexibility and control, enabling you to perform complex tasks without leaving the ComfyUI environment.
Terminal Input Parameters:
text
The text parameter is a multiline string input that allows you to specify the code or shell command you wish to execute. This parameter is highly flexible, accepting both Python code and shell commands. If the input text is enclosed in double quotes, it will be treated as a shell command and executed accordingly. Otherwise, it will be interpreted as Python code and executed within the current environment. This parameter empowers you to perform a wide range of operations, from simple print statements to complex script executions, directly from the node interface.
Terminal Output Parameters:
image
The image output parameter returns a placeholder image tensor with dimensions (1, 128, 128, 4). This output is primarily a formality to comply with the node's expected return type and does not represent the actual result of the executed code or command. Instead, the true output of the Terminal node is the side effect of the executed code or command, such as printed output, file creation, or other actions performed by the script.
Terminal Usage Tips:
Use the Terminal node to quickly test and debug small snippets of Python code without leaving the ComfyUI environment.
Enclose shell commands in double quotes to execute them directly from the Terminal node, allowing you to perform system-level operations or run external scripts.
Combine the Terminal node with other nodes to create complex workflows that require custom code execution at specific stages.
Terminal Common Errors and Solutions:
SyntaxError: invalid syntax
Explanation: This error occurs when the Python code provided in the text parameter contains a syntax error.
Solution: Review the code for any syntax mistakes, such as missing colons, unmatched parentheses, or incorrect indentation, and correct them.
NameError: name 'xyz' is not defined
Explanation: This error occurs when the code references a variable or function that has not been defined.
Solution: Ensure that all variables and functions used in the code are properly defined before they are referenced.
Command not found
Explanation: This error occurs when a shell command enclosed in double quotes is not recognized by the system.
Solution: Verify that the command is correctly spelled and available in the system's PATH. If necessary, provide the full path to the executable.
IndentationError: unexpected indent
Explanation: This error occurs when the code contains inconsistent or incorrect indentation.
Solution: Ensure that the code follows consistent indentation rules, using either spaces or tabs, but not both.
TypeError: unsupported operand type(s)
Explanation: This error occurs when an operation is performed on incompatible data types.
Solution: Check the data types of the variables involved in the operation and ensure they are compatible. Use type casting if necessary.
Terminal Related Nodes
Go back to the extension to check out more related nodes.
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.