ComfyUI > Nodes > ComfyUI Impact Pack > SEGS Filter (range)

ComfyUI Node: SEGS Filter (range)

Class Name

ImpactSEGSRangeFilter

Category
ImpactPack/Util
Author
Dr.Lt.Data (Account age: 458days)
Extension
ComfyUI Impact Pack
Latest Updated
2024-06-19
Github Stars
1.38K

How to Install ComfyUI Impact Pack

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

SEGS Filter (range) Description

Filter segments based on criteria, refining and controlling processed segments by evaluating and filtering against specified range.

SEGS Filter (range):

The ImpactSEGSRangeFilter node is designed to filter segments (SEGS) based on specific criteria, allowing you to refine and control the segments that are processed further. This node evaluates each segment against a defined target attribute, such as area, width, height, or confidence, and filters them based on whether they fall within or outside a specified range. This functionality is particularly useful for AI artists who need to manage and manipulate image segments with precision, ensuring that only segments meeting certain criteria are included in subsequent operations. By using this node, you can streamline your workflow and achieve more accurate and targeted results in your AI art projects.

SEGS Filter (range) Input Parameters:

target

The target parameter specifies the attribute of the segment that will be evaluated for filtering. Options include "area(=wh)", "width", "height", "x1", "y1", "x2", "y2", and "length_percent". Each option corresponds to a different aspect of the segment's geometry or confidence level. For example, selecting "area(=wh)" will filter segments based on their area, while "confidence(0-100)" will filter based on the confidence score of the segment. This parameter is crucial as it determines the basis on which segments are filtered.

mode

The mode parameter is a boolean that determines the filtering logic. When set to True (inside mode), segments with target values within the specified range (min_value to max_value) are included. When set to False (outside mode), segments with target values outside the specified range are included. This parameter allows you to control whether you want to keep segments within a certain range or exclude them.

min_value

The min_value parameter defines the minimum value of the target attribute for filtering. Segments with target values below this threshold will be excluded (or included if mode is set to False). This parameter helps in setting the lower bound for the filtering criteria. The default value is 0, and it can be adjusted based on the specific requirements of your project.

max_value

The max_value parameter sets the maximum value of the target attribute for filtering. Segments with target values above this threshold will be excluded (or included if mode is set to False). This parameter helps in setting the upper bound for the filtering criteria. The default value is 67108864, providing a wide range that can be narrowed down as needed.

SEGS Filter (range) Output Parameters:

SEGS

The output parameter SEGS returns the filtered segments. This output consists of the segments that meet the specified criteria based on the target attribute and the defined range. The filtered segments can then be used in subsequent nodes for further processing or analysis. This output is essential for ensuring that only the desired segments are passed along in your workflow, enhancing the precision and effectiveness of your AI art projects.

SEGS Filter (range) Usage Tips:

  • To filter segments based on their size, set the target parameter to "area(=w*h)" and adjust the min_value and max_value to define the acceptable range of segment areas.
  • Use the mode parameter to switch between including segments within a range (inside mode) or excluding them (outside mode), depending on your specific needs.
  • When working with confidence scores, set the target to "confidence(0-100)" to filter segments based on their confidence levels, ensuring that only high-confidence segments are included in your results.

SEGS Filter (range) Common Errors and Solutions:

[Impact Pack] SEGSRangeFilter - Unexpected target '<target>'

  • Explanation: This error occurs when an invalid target attribute is specified in the target parameter.
  • Solution: Ensure that the target parameter is set to one of the valid options: "area(=w*h)", "width", "height", "x1", "y1", "x2", "y2", or "length_percent".

ValueError: min_value must be less than or equal to max_value

  • Explanation: This error occurs when the min_value parameter is set to a value greater than the max_value parameter.
  • Solution: Adjust the min_value and max_value parameters to ensure that min_value is less than or equal to max_value.

TypeError: target must be a string

  • Explanation: This error occurs when the target parameter is not provided as a string.
  • Solution: Ensure that the target parameter is specified as a string, using one of the valid options.

TypeError: mode must be a boolean

  • Explanation: This error occurs when the mode parameter is not provided as a boolean.
  • Solution: Ensure that the mode parameter is specified as a boolean value (True or False).

SEGS Filter (range) Related Nodes

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