# ComfyUI-SmartGridCutter ✂️ Universal grid image splitter for ComfyUI. Automatically detects grid layout by analyzing brightness/contrast and splits any grid image into individual frames. ## Features - 🔍 **Smart Detection** — Automatically finds grid dividers by brightness analysis - 📐 **Preset Modes** — 3×3, 4×2, 3×2, 2×2, or custom - 🎯 **Auto Fallback** — If smart detection fails, falls back to aspect ratio heuristics - 🔗 **URL Support** — Download and cut images directly from URL (for API/n8n integration) - 📏 **Pixel Alignment** — Aligns output dimensions to 16px for video compatibility - ✂️ **Edge Padding** — Configurable trim to remove divider artifacts ## Nodes ### Smart Grid Cutter ✂️ Takes an IMAGE input and splits it into up to 9 individual frames. | Input | Type | Description | |-------|------|-------------| | image | IMAGE | Grid image to split | | mode | ENUM | auto / 3x3 / 4x2 / 3x2 / 2x2 / custom | | custom_cols | INT | Columns (for custom mode) | | custom_rows | INT | Rows (for custom mode) | | divider_threshold | FLOAT | Detection sensitivity (0.01-0.5) | | min_divider_width | INT | Minimum divider width in px | | padding | INT | Pixels to trim from edges | | align_to | INT | Dimension alignment (16 for video) | ### Smart Grid Cutter (URL) ✂️🔗 Downloads image from URL and splits it. Same parameters as above, but takes `image_url` string instead of IMAGE tensor. ## Output - `frame_0` through `frame_8` — Individual frames as IMAGE tensors - `cols`, `rows` — Detected/preset grid dimensions - `total_frames` — Actual number of frames - `grid_info` — Human-readable detection summary ## Installation ### ComfyUI Manager Search for "SmartGridCutter" in ComfyUI Manager. ### Manual ```bash cd ComfyUI/custom_nodes/ git clone https://github.com/imind-studio/ComfyUI-SmartGridCutter.git # Restart ComfyUI ``` ## Use Cases - **Storyboard cutting** — Split 3×3 AI-generated storyboards into individual scenes - **Character sheets** — Split 4×2 character reference sheets into individual poses - **Contact sheets** — Split any contact/proof sheet into individual images - **Comic panels** — Split comic pages into individual panels ## License MIT ## Author iMind Studio — [imind.pw](https://imind.pw)