ComfyUI > Nodes > Crystools > 🪛 Switch image

ComfyUI Node: 🪛 Switch image

Class Name

Switch image [Crystools]

Category
crystools 🪛/Switch
Author
Crystian (Account age: 4118days)
Extension
Crystools
Latest Updated
2024-06-20
Github Stars
0.49K

How to Install Crystools

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

🪛 Switch image Description

Facilitates conditional image processing with dynamic switching between two inputs based on boolean condition for AI art workflows.

Switch image [Crystools]:

The Switch image [Crystools] node is designed to facilitate conditional image processing within your AI art workflows. This node allows you to dynamically switch between two different image inputs based on a boolean condition, enabling more flexible and adaptive image manipulation. By leveraging this node, you can create more complex and responsive image processing pipelines that adjust their behavior based on specific conditions or criteria. This can be particularly useful in scenarios where you need to apply different image transformations or effects depending on certain conditions, thereby enhancing the versatility and efficiency of your creative process.

Switch image [Crystools] Input Parameters:

on_true

This parameter accepts an image input that will be used if the boolean condition is evaluated to true. The image provided here will be the output when the condition is met. This allows you to define the image that should be processed or displayed when the specified condition is satisfied.

on_false

This parameter accepts an image input that will be used if the boolean condition is evaluated to false. The image provided here will be the output when the condition is not met. This allows you to define an alternative image that should be processed or displayed when the specified condition is not satisfied.

boolean

This parameter is a boolean value that determines which image input (on_true or on_false) will be selected. If the boolean value is true, the on_true image will be chosen; if false, the on_false image will be chosen. The default value for this parameter is true, meaning the on_true image will be selected unless specified otherwise.

Switch image [Crystools] Output Parameters:

image

The output parameter is an image that results from the evaluation of the boolean condition. Depending on whether the boolean condition is true or false, the output will be either the on_true or on_false image. This output is crucial for further processing or display in your AI art workflow, as it represents the dynamically selected image based on the specified condition.

Switch image [Crystools] Usage Tips:

  • Use the boolean parameter to create dynamic image processing pipelines that adapt to different conditions, enhancing the flexibility of your workflow.
  • Combine this node with other conditional nodes to build more complex decision-making processes in your image manipulation tasks.
  • Ensure that both on_true and on_false images are pre-processed and ready for use to avoid any unexpected results during the switching process.

Switch image [Crystools] Common Errors and Solutions:

Invalid image file: <image_path>

  • Explanation: This error occurs when the provided image file path is invalid or the file does not exist.
  • Solution: Verify that the image file path is correct and that the file exists at the specified location. Ensure that the file is accessible and not corrupted.

TypeError: Expected image input, got <type>

  • Explanation: This error occurs when the input provided is not of the expected image type.
  • Solution: Ensure that the inputs for on_true and on_false parameters are valid image files. Check the data type of the inputs and convert them to the appropriate image format if necessary.

Boolean parameter missing or invalid

  • Explanation: This error occurs when the boolean parameter is missing or not a valid boolean value.
  • Solution: Ensure that the boolean parameter is provided and is a valid boolean value (true or false). Double-check the parameter configuration in your node setup.

🪛 Switch image Related Nodes

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