图像分区 · 批量准备区域分块
Turn a tile plan into actual crops, masks, and coordinates — in one batch node
- image
- plan
- protection_mask
- tile_images
- ownership_masks
- protection_crops
- x
- y
- width
- height
- grow
- blur
- tile_index
- report_json
- labeled_preview_images
- shared_generation_masks
- global_inward_alpha
The tile planner tells you where to cut; something has to actually do the cutting. RegionEditTileBatchPrepare is that something - it takes a REGION_TILE_PLAN and your source image, and emits every tile crop, its ownership mask, its protection crop, and its coordinates as matched lists, ready to feed a batch-generation chain. This is the "controlled" variant: the grow and feather settings come in from a central control node rather than being buried inside the planner, so you can tweak all tiles from one place.
The key idea in the geometry, straight from the source: grow and blur are completely independent concepts, and people confuse them. default_grow controls the reconstruction extent - how many pixels outside the target mask get regenerated, so the model has context to rebuild what was behind the removed object. default_blur controls only the composite edge softness. The source explicitly decouples them (the tooltip hammers it: "只控制合成边缘柔和程度,不再随外扩自动增大" - only controls edge softness, no longer auto-scales with grow). Internal seams between tiles get their own independent double-coverage guard band - the pack reserves a seam-guard region that must be generated by at least two tiles, so no seam is ever the responsibility of a single tile's edge.
Inputs: image, plan (the REGION_TILE_PLAN from RegionEditTilePlanner), protection_mask (full-image; each tile gets its own protection crop), then the four control values: default_grow (INT), tile_grow_overrides (STRING), default_blur (INT), tile_blur_overrides (STRING). The override strings let you per-tile tune: 2=16,5=64 means "tile 2 grows 16px, tile 5 grows 64px," with tile numbers matching the plan's preview, starting at 1. Leave them empty for uniform behavior.
Outputs are all lists (one entry per tile): tile_images, ownership_masks (which pixels belong to which tile - disjoint by design), protection_crops, x, y, width, height, grow, blur, and tile_index. The non-list extras are worth knowing: labeled_preview_images shows every tile with its index overlaid - the fastest way to understand the plan before you burn a generation; shared_generation_masks; and global_inward_alpha, a full-image inward-feather mask that merges the tile boundaries into one coherent alpha for the final composite.
How it wires: outputs feed the batch image-edit chain (each tile through your edit model), and then - importantly - you keep the parallel list of x/y/width/height and ownership masks for the merge side. If you drop the coordinate list, RegionEditTileMerge can't put things back.
Install: ComfyUI Manager → search Region Edit Toolkit (registry ID native-region-tile-planner-merge), or git clone https://github.com/Liu-Bot24/ComfyUI-Region-Edit-Toolkit.git into custom_nodes, pip-install requirements.txt into ComfyUI's real Python, restart.
The beginner trap: these are ComfyUI lists, not single tensors. If you're not used to is_list outputs, the tile_images output arriving as a list is easy to miswire into a node that expects one image. Use the pack's example workflows as the wiring reference, and let labeled_preview_images be your sanity check before you commit to a long run. The pack is new and quiet, so the labeled preview is your best teacher until the community catches up.
Inputs (7)
| Name | Type | Default | Description |
|---|---|---|---|
| image | IMAGE | — | |
| plan | REGION_TILE_PLAN | — | |
| protection_mask | MASK | — | |
| default_grow | INT | — | |
| tile_grow_overrides | STRING | — | |
| default_blur | INT | — | |
| tile_blur_overrides | STRING | — |
Outputs (14)
| Name | Type | Description |
|---|---|---|
| tile_images | IMAGE | — |
| ownership_masks | MASK | — |
| protection_crops | MASK | — |
| x | INT | — |
| y | INT | — |
| width | INT | — |
| height | INT | — |
| grow | INT | — |
| blur | INT | — |
| tile_index | INT | — |
| report_json | STRING | — |
| labeled_preview_images | IMAGE | — |
| shared_generation_masks | MASK | — |
| global_inward_alpha | MASK | — |