Nodes/ComfyUI-ArchAi3d-Qwen/Simple Edge Mask (DiffDiff)
ComfyUI Node

Simple Edge Mask (DiffDiff)

Denoise the middle of your tile, freeze the edges

By amir84ferdos·Created 11 months ago·Updated 5 months ago· 70
Simple Edge Mask (DiffDiff)
    • edge_mask
    • edge_mask_rgb
    tile_idx0
    tile_width512
    tile_height512
    tiles_x2
    tiles_y2
    edge_width32
    edge_feather8

    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.

    CategoryArchAi3d/Upscaling/Simple USDU

    Inputs (7)

    NameTypeDefaultDescription
    tile_idxINT00–1000
    tile_widthINT51264–4096
    tile_heightINT51264–4096
    tiles_xINT21–100
    tiles_yINT21–100
    edge_widthINT320–256Width of edge border in pixels
    edge_featherINT80–64Feather amount for soft edges

    Outputs (2)

    NameTypeDescription
    edge_maskMASK
    edge_mask_rgbIMAGE