ComfyUI  >  Nodes  >  WAS Node Suite >  Model Input Switch

ComfyUI Node: Model Input Switch

Class Name

Model Input Switch

Category
WAS Suite/Logic
Author
WASasquatch (Account age: 4688 days)
Extension
WAS Node Suite
Latest Updated
8/25/2024
Github Stars
1.1K

How to Install WAS Node Suite

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

Model Input Switch Description

Dynamically select between models based on boolean condition for conditional model selection in AI art projects.

Model Input Switch:

The Model Input Switch node is designed to dynamically select between two different models based on a boolean condition. This node is particularly useful when you need to switch between models during runtime without manually changing the configuration. By leveraging this node, you can streamline workflows that require conditional model selection, enhancing flexibility and efficiency in your AI art projects. The primary function of this node is to evaluate a boolean input and return one of the two provided models accordingly, making it an essential tool for scenarios where model selection is contingent on specific conditions or criteria.

Model Input Switch Input Parameters:

model_a

This parameter represents the first model that can be selected by the switch. It is one of the two models between which the node will switch based on the boolean condition. The type of this parameter is MODEL, and it is required for the node to function. The model provided here will be returned if the boolean condition is evaluated as true.

model_b

This parameter represents the second model that can be selected by the switch. Similar to model_a, this parameter is of type MODEL and is required for the node to function. The model provided here will be returned if the boolean condition is evaluated as false.

boolean

This parameter is a boolean value that determines which model will be selected. It is of type BOOLEAN and is required for the node to function. The boolean parameter has a forceInput attribute set to true, ensuring that a value must be provided. If the boolean value is true, model_a will be selected; if false, model_b will be selected.

Model Input Switch Output Parameters:

MODEL

The output of this node is a single model, which is of type MODEL. The specific model returned depends on the evaluation of the boolean input. If the boolean is true, the output will be model_a; if false, the output will be model_b. This output is crucial for directing the subsequent workflow to use the appropriate model based on the given condition.

Model Input Switch Usage Tips:

  • Use the Model Input Switch node to dynamically change models in your workflow based on specific conditions, such as user input or other logical operations.
  • Ensure that both model_a and model_b are properly configured and compatible with the rest of your workflow to avoid any runtime issues.
  • Utilize the boolean parameter to create complex conditional logic, enabling more sophisticated and responsive AI art generation processes.

Model Input Switch Common Errors and Solutions:

TypeError: 'NoneType' object is not subscriptable

  • Explanation: This error occurs when one of the model inputs (model_a or model_b) is not provided or is None.
  • Solution: Ensure that both model_a and model_b are correctly specified and not None.

ValueError: Invalid boolean value

  • Explanation: This error occurs when the boolean parameter is not provided or is not a valid boolean value.
  • Solution: Verify that the boolean parameter is correctly set to either true or false.

Model compatibility error

  • Explanation: This error occurs when the selected model is not compatible with the subsequent nodes in the workflow.
  • Solution: Check the compatibility of both model_a and model_b with the rest of your workflow to ensure they can be used interchangeably without issues.

Model Input Switch Related Nodes

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