ComfyUI  >  Nodes  >  ComfyUI-post-processing-nodes >  PixelSort

ComfyUI Node: PixelSort

Class Name

PixelSort

Category
postprocessing/Effects
Author
EllangoK (Account age: 2833 days)
Extension
ComfyUI-post-processing-nodes
Latest Updated
8/9/2024
Github Stars
0.2K

How to Install ComfyUI-post-processing-nodes

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

PixelSort Description

Powerful post-processing node for visually striking effects by sorting pixels based on criteria, offering control over arrangement and artistic distortions.

PixelSort:

PixelSort is a powerful post-processing node designed to create visually striking effects by sorting pixels within an image based on specific criteria. This node allows you to manipulate the arrangement of pixels either horizontally or vertically, creating unique and artistic distortions. By leveraging parameters such as direction, span limit, sorting criteria (hue, saturation, or value), and sorting order, PixelSort provides a high degree of control over the final output. This node is particularly useful for generating abstract art, enhancing textures, or adding a creative twist to your images.

PixelSort Input Parameters:

image

The image parameter is the primary input image that you want to apply the pixel sorting effect to. This should be provided as a tensor representing the image data.

mask

The mask parameter is an image that defines the areas where the pixel sorting effect should be applied. Pixels corresponding to non-zero values in the mask will be sorted, while others will remain unchanged. This allows for selective application of the effect.

direction

The direction parameter determines the orientation of the pixel sorting. It can be set to either horizontal or vertical, dictating whether the pixels are sorted along rows or columns, respectively. This choice significantly impacts the visual outcome of the effect.

span_limit

The span_limit parameter sets the maximum length of contiguous pixel spans that will be sorted. It is an integer value with a default of 50, a minimum of 0, and a maximum of 100, adjustable in steps of 5. A higher span limit allows for longer stretches of sorted pixels, while a lower limit results in shorter, more frequent sorting.

sort_by

The sort_by parameter specifies the attribute used to sort the pixels. It can be set to hue, saturation, or value, each corresponding to different aspects of the pixel's color in the HSV color space. This choice affects the sorting order and the resulting visual effect.

order

The order parameter determines the sorting order of the pixels. It can be set to forward for ascending order or backward for descending order. This parameter influences the direction in which the pixels are rearranged, adding another layer of customization to the effect.

PixelSort Output Parameters:

IMAGE

The output of the PixelSort node is an IMAGE tensor that contains the processed image with the pixel sorting effect applied. This output can be used directly in your workflow for further processing or as a final artistic piece.

PixelSort Usage Tips:

  • Experiment with different direction settings to see how horizontal and vertical sorting affect the visual outcome.
  • Use the mask parameter to apply the effect selectively, allowing you to highlight specific areas of your image.
  • Adjust the span_limit to control the granularity of the sorting effect. Smaller values create more intricate patterns, while larger values produce broader strokes.
  • Try different sort_by options to explore how sorting by hue, saturation, or value changes the appearance of the effect.
  • Combine order settings with other parameters to achieve unique and unexpected results.

PixelSort Common Errors and Solutions:

"Invalid image tensor"

  • Explanation: The input image tensor is not in the correct format or is corrupted.
  • Solution: Ensure that the input image is a valid tensor and correctly formatted before passing it to the node.

"Mask tensor dimensions do not match image dimensions"

  • Explanation: The dimensions of the mask tensor do not match those of the input image tensor.
  • Solution: Verify that the mask image has the same dimensions as the input image to ensure proper application of the effect.

"Invalid span_limit value"

  • Explanation: The span_limit value is outside the allowed range.
  • Solution: Ensure that the span_limit is set within the range of 0 to 100, and adjust it in steps of 5 as needed.

"Unsupported sort_by option"

  • Explanation: The sort_by parameter is set to an unsupported value.
  • Solution: Check that the sort_by parameter is set to one of the allowed values: hue, saturation, or value.

"Unsupported order option"

  • Explanation: The order parameter is set to an unsupported value.
  • Solution: Ensure that the order parameter is set to either forward or backward.

PixelSort Related Nodes

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