https://github.com/stormcenter/ComfyUI-AutoSplitGridImage
ComfyUI-AutoSplitGridImage: A custom node for ComfyUI that intelligently splits images into grids, combining edge detection for columns and uniform division for rows.
https://github.com/stormcenter/ComfyUI-AutoSplitGridImage
Last synced: 4 months ago
JSON representation
ComfyUI-AutoSplitGridImage: A custom node for ComfyUI that intelligently splits images into grids, combining edge detection for columns and uniform division for rows.
- Host: GitHub
- URL: https://github.com/stormcenter/ComfyUI-AutoSplitGridImage
- Owner: stormcenter
- License: apache-2.0
- Created: 2024-10-22T11:47:07.000Z (about 1 year ago)
- Default Branch: main
- Last Pushed: 2025-01-06T12:02:58.000Z (12 months ago)
- Last Synced: 2025-01-06T13:19:50.744Z (12 months ago)
- Language: Python
- Size: 3.43 MB
- Stars: 24
- Watchers: 1
- Forks: 2
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
- awesome-comfyui - **ComfyUI-AutoSplitGridImage** - AutoSplitGridImage is a custom node for ComfyUI that provides intelligent image splitting functionality. It combines edge detection for column splits and uniform division for row splits, offering a balanced approach to grid-based image segmentation. (All Workflows Sorted by GitHub Stars)
- awesome-comfyui - **ComfyUI-AutoSplitGridImage** - AutoSplitGridImage is a custom node for ComfyUI that provides intelligent image splitting functionality. It combines edge detection for column splits and uniform division for row splits, offering a balanced approach to grid-based image segmentation. (Workflows (3395) sorted by GitHub Stars)
README
# ComfyUI-AutoSplitGridImage
ComfyUI-AutoSplitGridImage is a custom node for ComfyUI that provides flexible image splitting functionality. It allows users to choose between edge detection and uniform division for both row and column splits, offering a customizable approach to grid-based image segmentation.



## Features
- Customizable splitting methods for both rows and columns
- Choice between edge detection and uniform division for each axis
- Adjustable number of rows and columns
- Preview image with grid lines
- Outputs both the preview image and individual grid cells
- Automatic even dimension resizing with EvenImageResizer node
## Installation
1. Clone this repository into your ComfyUI `custom_nodes` directory:
```
cd /path/to/ComfyUI/custom_nodes
git clone https://github.com/yourusername/ComfyUI-AutoSplitGridImage.git
```
2. Restart ComfyUI or reload custom nodes.
## Usage
### GridImageSplitter Node
1. In the ComfyUI interface, find the "GridImageSplitter" node under the "image/processing" category.
2. Connect an image output to the "image" input of the GridImageSplitter node.
3. Set the desired number of rows and columns.
4. Choose the splitting method for rows and columns (uniform or edge detection).
5. The node will output two images:
- A preview image showing the grid lines
- A tensor containing all the split image cells
### EvenImageResizer Node
1. Find the "EvenImageResizer" node under the "image/processing" category.
2. Connect an image output to the "image" input.
3. The node will automatically ensure the output image has even dimensions by trimming if necessary.
## Parameters
### GridImageSplitter
- `image`: Input image to be split
- `rows`: Number of rows to split the image into (default: 2, range: 1-10)
- `cols`: Number of columns to split the image into (default: 3, range: 1-10)
- `row_split_method`: Method to split rows ("uniform" or "edge_detection")
- `col_split_method`: Method to split columns ("uniform" or "edge_detection")
### EvenImageResizer
- `image`: Input image to be processed
## How It Works
- Uniform Splitting: Divides the image into equal parts along the specified axis.
- Edge Detection Splitting: Uses OpenCV's Canny edge detection to find natural splitting points in the image.
- Even Dimension Resizing: Automatically trims images to ensure both width and height are even numbers.
## Contributing
Contributions are welcome! Please feel free to submit a Pull Request.
## License
This project is licensed under the Apache License 2.0 License - see the [LICENSE](LICENSE) file for details.
## Acknowledgements
- This project is designed to work with [ComfyUI](https://github.com/comfyanonymous/ComfyUI).
- Edge detection is implemented using OpenCV.