Simple Edge Mask (DiffDiff)
Denoise the middle of your tile, freeze the edges
- edge_mask
- edge_mask_rgb
Here's the tension at the heart of tiled upscaling: you want each tile regenerated with new detail in the middle, but you want the edges left alone so neighboring tiles blend together instead of fighting. The Simple Edge Mask is the node that splits the difference - it makes a per-tile mask that tells the sampler "go wild in the center, hands off the borders."
It's part of the "Simple USDU" tiling subsystem inside ComfyUI-ArchAi3d-Qwen, Amir Ferdos's pack (primarily a Qwen-VL interior-design toolkit; the tiling side is its own self-contained upscale pipeline the README barely documents). This node is the DiffDiff companion to the Simple Tile Sampler.
How it works
The mask is deliberately inverted from what you might expect from a blend mask. Here:
- White center = MORE denoising - this is where the diffusion model regenerates and adds detail.
- Black edges = LESS denoising - preserve the original pixels so this tile matches its neighbors.
- Black is only drawn on edges where the tile actually has a neighbor (internal edges). Edges at the image boundary stay white, because there's nothing to blend with out there.
So the geometry logic is the same as the Blend Mask's, just flipped, and the output plugs into the sampler's denoise_mask input. That's Differential Diffusion (DiffDiff): instead of one denoise strength for the whole latent, you supply a per-pixel noise mask - white regions get more noise/denoise, black regions get less. The result is tiles that stay consistent with each other at the seams while still getting the upscale's detail gain in their centers.
Inputs
- tile_idx, tile_width, tile_height, tiles_x, tiles_y - which tile and what grid (must match the Cropper).
- edge_width - how wide the preserved border is, in pixels. 32 is the default; if you see seams, raise it; if tiles look disconnected, lower it.
- edge_feather - Gaussian blur on the mask edge so the white/black transition is soft instead of a hard line. 8 is a good starting point.
Outputs are edge_mask (MASK → Simple Tile Sampler's denoise_mask) and edge_mask_rgb (preview image).
Installing
Same pack, standard install:
cd ComfyUI/custom_nodes
git clone https://github.com/amir84ferdos/ComfyUI-ArchAi3d-Qwen.git
cd ComfyUI-ArchAi3d-Qwen
pip install -r requirements.txt
Or ComfyUI Manager → search "ArchAi3d Qwen". No model files involved - this mask is computed, not loaded. Note the pack's dual license: free for personal use, commercial license required for paid work.
The catch
For a single tile this is one node; for a grid it's one per tile, which is where the graph gets tall. There's no batch variant of this one yet, so on big grids you're wiring a row of them. If that gets old, the Smart Tile SEGS Blur node in the same pack does the same "feather the seams" job for a whole grid at once, via masks on SEGS instead of per-tile nodes. Both approaches are valid; this one is for people who want the explicit, visible control and the DiffDiff workflow.
Inputs (7)
| Name | Type | Default | Description |
|---|---|---|---|
| tile_idx | INT | 00–1000 | — |
| tile_width | INT | 51264–4096 | — |
| tile_height | INT | 51264–4096 | — |
| tiles_x | INT | 21–100 | — |
| tiles_y | INT | 21–100 | — |
| edge_width | INT | 320–256 | Width of edge border in pixels |
| edge_feather | INT | 80–64 | Feather amount for soft edges |
Outputs (2)
| Name | Type | Description |
|---|---|---|
| edge_mask | MASK | — |
| edge_mask_rgb | IMAGE | — |