Nodes/ComfyUI-WepeNerd/VAE DeGrid (WepeNerd)
ComfyUI Node

VAE DeGrid (WepeNerd)

Removes the faint 2px pixel grid that the Qwen Image, Qwen Image 2.1 and Wan 2.1 VAEs (Krea2, Anima and others built on them) leave in decoded images and video frames. Connect it straight after VAE Decode, before any resize, sharpening, upscaler or restorer: those amplify the grid or scramble it beyond repair. The node measures the lattice at every pixel and subtracts only that, so fine texture and sharp edges pass through instead of being filtered. A batch with no grid (an upscaled or resized image, say) is passed through untouched. After a run the node shows the grid strength it measured.

By WepeNerd·Created 7 months ago·Updated 14 days ago· 49
VAE DeGrid (WepeNerd)
  • image
  • image
  • removed_grid
◄strength1.00►
◄window8.0►
◄skip_when_cleantrue►
◄previewstrength map►
CategoryWepeNerd/Image

Inputs (5)

NameTypeDefaultDescription
imageIMAGEConnect straight from VAE Decode (images or video frames).
strengthFLOAT1.000–1.5How much of the measured grid to subtract. 1 removes it; 0 leaves the image untouched (handy for A/B checks).
windowFLOAT8.03–32Size in pixels of the area over which the grid's strength is measured. Smaller follows a grid whose strength changes quickly across the image; larger is more precise and spares fine texture even better. The default suits most images.
skip_when_cleanBOOLEANtruePass the batch through bit-for-bit when no grid is found (under 0.5/255). The decision covers the whole batch, so video frames are all treated alike. Turn off to remove whatever is found anyway.
previewCOMBOstrength mapWhat removed_grid shows. strength map: where the grid was strong (brighter = stronger, readable at any size). lattice zoom: a magnified centre crop of the removed pattern, where the 2px grid is visible. lattice full frame: the whole removed pattern (looks like gray noise unless viewed at 100%).

Outputs (2)

NameTypeDescription
imageIMAGEThe image with the grid removed: same size, channels and frame count as the input.
removed_gridIMAGEPreview of what was removed (see the preview setting). For inspection only.