Nodes/ComfyUI-ArchAi3d-Qwen/Simple Blend Mask
ComfyUI Node

Simple Blend Mask

The node that decides whether your tiled upscale has seams

By amir84ferdos·Created 11 months ago·Updated 5 months ago· 70
Simple Blend Mask
    • blend_mask
    • blend_mask_rgb
    tile_idx0
    tile_width512
    tile_height512
    tiles_x2
    tiles_y2
    overlap64
    mask_blur16

    Tiled upscaling has exactly one failure mode that matters: the seams. You slice a big image into tiles, run diffusion on each one, and when you stitch them back the overlap regions look like a patchwork quilt - dark X's at corners, a visible grid. Blend masks are how you stop that, and this node makes one for a single tile.

    This comes from ComfyUI-ArchAi3d-Qwen, Amir Ferdos's pack (he's an architect who's been building ComfyUI nodes since 2023, mostly Qwen-VL editing for interior design). The node lives in the pack's "Simple USDU" subsystem - a from-scratch, self-contained tiled-upscaling pipeline modeled on Ultimate SD Upscale, which the pack README barely mentions. The tooltips and this node's source are the real docs.

    How it works

    The idea is a weighted blend: each tile contributes most where it's the only thing covering the image, and fades out where its neighbor takes over. This node outputs a mask per tile where white (1.0) means "this tile contributes fully" and black (0.0) means "nothing here", with a gradient in between.

    The clever bit is what's called distance-based masking. Instead of drawing a simple border, the node measures each pixel's distance to the nearest internal edge - an edge where the tile actually has a neighbor. Edges at the image boundary stay sharp white because there's nobody to blend with. That detail is what fixes the classic "diagonal dark corner" artifact, where corner pixels get double-faded and the output ends up darker where four tiles meet.

    Inputs that matter

    Most of these describe your tile grid, and they have to match what you told the Cropper and Sampler:

    • tile_idx - which tile this mask is for (0-indexed, left-to-right then top-to-bottom).
    • tile_width / tile_height / tiles_x / tiles_y - tile size and grid dimensions.
    • overlap - the padding between tiles. The tooltip notes it's the same as tile_padding.
    • mask_blur - the gradient width in pixels. 16 is a sane start; more = wider blend zone, but too wide and edges get mushy.

    Outputs are blend_mask (a MASK, wire this into the Compositor's blend_masks input) and blend_mask_rgb (an IMAGE preview so you can actually see what the mask looks like before you commit).

    Installing it

    The pack installs the standard way:

    cd ComfyUI/custom_nodes
    git clone https://github.com/amir84ferdos/ComfyUI-ArchAi3d-Qwen.git
    cd ComfyUI-ArchAi3d-Qwen
    pip install -r requirements.txt
    # restart ComfyUI
    

    Or use ComfyUI Manager and search "ArchAi3d Qwen". The tile nodes only need numpy/Pillow/torch, which ComfyUI already ships, so the long requirements list is mostly for the pack's other nodes. No models to download here - you're generating the mask yourself.

    Where it fits

    The Simple USDU chain is Cropper → Sampler → Compositor, with this node feeding the compositor. If you have a 4×4 grid, you'd make 16 of these (or use the Batch sibling). One honest caveat: if you're not deliberately building your own pipeline to learn how tiled upscaling works, Impact Pack's UltimateSDUpscale does all of this in one node. This suite is for people who want the pieces - and for that, this mask generator is the right first piece.

    CategoryArchAi3d/Upscaling/Simple USDU

    Inputs (7)

    NameTypeDefaultDescription
    tile_idxINT00–1000
    tile_widthINT51264–4096
    tile_heightINT51264–4096
    tiles_xINT21–100
    tiles_yINT21–100
    overlapINT640–512Overlap between tiles (same as tile_padding)
    mask_blurINT160–256Gradient width in pixels (blend zone)

    Outputs (2)

    NameTypeDescription
    blend_maskMASK
    blend_mask_rgbIMAGE