ComfyUI  >  Nodes  >  KJNodes for ComfyUI >  Create Fluid Mask

ComfyUI Node: Create Fluid Mask

Class Name

CreateFluidMask

Category
KJNodes/masking/generate
Author
kijai (Account age: 2192 days)
Extension
KJNodes for ComfyUI
Latest Updated
6/25/2024
Github Stars
0.3K

How to Install KJNodes for ComfyUI

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

Create Fluid Mask Description

Generate dynamic fluid-based masks using fluid simulation techniques for AI art projects, offering intricate and organic patterns with customizable control.

Create Fluid Mask:

The CreateFluidMask node is designed to generate dynamic fluid-based masks for your AI art projects. This node leverages fluid simulation techniques to create intricate and organic patterns that can be used as masks in your compositions. By simulating the flow and interaction of fluids, it produces visually appealing and complex masks that can add a unique touch to your artwork. The node allows you to control various aspects of the fluid simulation, such as the number of inflow points, their velocity, radius, and duration, providing you with a high degree of customization. This makes it an excellent tool for creating masks that mimic natural fluid dynamics, enhancing the realism and aesthetic quality of your AI-generated images.

Create Fluid Mask Input Parameters:

invert

This boolean parameter determines whether the generated mask should be inverted. When set to True, the mask values are flipped, turning areas that would be masked into unmasked areas and vice versa. The default value is False.

frames

This integer parameter specifies the number of frames for which the fluid simulation should run. It controls the duration of the simulation, with a minimum value of 1 and a maximum value of 4096. The default value is 1.

width

This integer parameter sets the width of the generated mask. It defines the horizontal resolution of the mask, with a minimum value of 16 and a maximum value of 4096. The default value is 256.

height

This integer parameter sets the height of the generated mask. It defines the vertical resolution of the mask, with a minimum value of 16 and a maximum value of 4096. The default value is 256.

inflow_count

This integer parameter determines the number of inflow points in the fluid simulation. These points act as sources of fluid, influencing the complexity and pattern of the generated mask. The minimum value is 0 and the maximum value is 255. The default value is 3.

inflow_velocity

This integer parameter controls the velocity of the fluid at the inflow points. Higher values result in faster-moving fluid, affecting the overall dynamics and spread of the mask. The minimum value is 0 and the maximum value is 255. The default value is 1.

inflow_radius

This integer parameter sets the radius of the inflow points. It determines the size of the area around each inflow point where fluid is introduced into the simulation. The minimum value is 0 and the maximum value is 255. The default value is 8.

inflow_padding

This integer parameter specifies the padding around the inflow points. It affects the placement of the inflow points within the simulation grid, with higher values pushing the points closer to the center. The minimum value is 0 and the maximum value is 255. The default value is 50.

inflow_duration

This integer parameter defines the duration for which the inflow points remain active during the simulation. It controls how long fluid is introduced into the system, influencing the development and complexity of the mask. The minimum value is 0 and the maximum value is 255. The default value is 60.

Create Fluid Mask Output Parameters:

IMAGE

This output parameter provides the generated fluid-based image. It is a tensor containing the visual representation of the fluid simulation, which can be used as a mask or directly in your artwork. The image captures the dynamic patterns created by the fluid flow.

MASK

This output parameter provides the generated fluid-based mask. It is a tensor containing the binary mask derived from the fluid simulation, where the mask values indicate the presence or absence of fluid. This mask can be used to selectively apply effects or blend images in your compositions.

Create Fluid Mask Usage Tips:

  • Experiment with different inflow_count and inflow_velocity values to create more complex and dynamic fluid patterns.
  • Adjust the inflow_radius and inflow_padding to control the spread and placement of the fluid sources, which can significantly alter the resulting mask.
  • Use the invert parameter to quickly switch between masked and unmasked areas, providing flexibility in how you apply the generated mask to your artwork.

Create Fluid Mask Common Errors and Solutions:

ImportError: No module named 'scipy.special'

  • Explanation: This error occurs when the scipy library is not installed or not found in your Python environment.
  • Solution: Install the scipy library using the command pip install scipy.

ValueError: frames must be between 1 and 4096

  • Explanation: This error occurs when the frames parameter is set to a value outside the allowed range.
  • Solution: Ensure that the frames parameter is set to a value between 1 and 4096.

ValueError: width and height must be between 16 and 4096

  • Explanation: This error occurs when the width or height parameters are set to values outside the allowed range.
  • Solution: Ensure that both the width and height parameters are set to values between 16 and 4096.

ValueError: inflow_count, inflow_velocity, inflow_radius, inflow_padding, and inflow_duration must be between 0 and 255

  • Explanation: This error occurs when any of the inflow-related parameters are set to values outside the allowed range.
  • Solution: Ensure that inflow_count, inflow_velocity, inflow_radius, inflow_padding, and inflow_duration are all set to values between 0 and 255.

Create Fluid Mask Related Nodes

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