3.7 KiB
3.7 KiB
ComfyUI Setup Guide
This repository is designed to work out-of-the-box with ComfyUI as a custom node.
Installation
Option 1: Clone directly into ComfyUI (Recommended)
cd ComfyUI/custom_nodes/
git clone https://github.com/rockerBOO/pixel-sorting.git
cd pixel-sorting
pip install -e .
Option 2: Manual installation
- Download or clone this repository
- Copy the entire
pixel-sortingfolder toComfyUI/custom_nodes/ - Install dependencies:
cd ComfyUI/custom_nodes/pixel-sorting pip install -e .
Option 3: Using ComfyUI Manager
(If this node is registered with ComfyUI Manager)
- Open ComfyUI
- Go to Manager
- Search for "Pixel Sorting"
- Click Install
Available Nodes
Once installed, you'll find these nodes in ComfyUI:
Pixel Sorting (PixelSorting)
Category: image/effects
Applies pixel sorting effects to images.
Inputs:
image(required) - Input imageinterval(required) - How to define sorting intervals- Options: threshold, bright, dark, white, black, random, waves, edges, none
sorting(required) - How to sort pixels within intervals- Options: lightness, hue, saturation, intensity, minimum, value
angle(optional) - Rotation angle in degrees (default: 0)randomness(optional) - Skip percentage 0-100 (default: 0)char_length(optional) - Interval width for random/waves (default: 50)loops(optional) - Number of passes (default: 1)bright_value(optional) - Threshold for bright mode 0-255 (default: 127)dark_value(optional) - Threshold for dark mode 0-255 (default: 223)lower_threshold(optional) - Lower threshold 0-1 (default: 0.25)upper_threshold(optional) - Upper threshold 0-1 (default: 0.8)
Output:
IMAGE- Sorted image
Pixel Sort Analyze (PixelSortAnalyze)
Category: image/analysis
Analyzes an image and outputs suggested threshold values.
Inputs:
image(required) - Input image
Outputs:
bright_subtle(INT) - Suggested bright threshold (top 25%)bright_moderate(INT) - Suggested bright threshold (top 50%)dark_subtle(INT) - Suggested dark threshold (bottom 25%)dark_moderate(INT) - Suggested dark threshold (bottom 50%)
Usage Tips
- Start with analysis: Use the
PixelSortAnalyzenode first to get recommended threshold values for your image - Connect outputs: Connect the analyze node outputs directly to the sorting node parameters
- Experiment: Try different combinations of interval and sorting modes
- Subtle effects: Start with lower values and increase gradually
- Diagonal sorting: Use angle=45 or angle=90 for interesting effects
Example Workflows
Basic Workflow
Image Input → PixelSorting (interval=bright, sorting=value) → Preview
Analyzed Workflow
Image Input → PixelSortAnalyze
↓
bright_subtle → PixelSorting (interval=bright, sorting=hue)
↓
Preview
Creative Effects
Image Input → PixelSorting (interval=random, sorting=hue, char_length=100, randomness=20) → Preview
Troubleshooting
Nodes don't appear:
- Make sure you installed dependencies:
pip install -e .in the pixel-sorting directory - Restart ComfyUI completely
- Check the console for error messages
Import errors:
- Ensure Pillow is installed:
pip install pillow - Make sure you're using Python 3.10+
Poor results:
- Use the Analyze node first to find good thresholds for your specific image
- The default values (especially dark=223) often don't work well - use analyzed values instead
Uninstallation
- Delete the
pixel-sortingfolder fromComfyUI/custom_nodes/ - Restart ComfyUI