TS VAE Fix
Your Qwen decode has a 2-pixel grid — TS VAE Fix deletes it before your upscaler eats it
- image
- image
- removed_grid
A grid you can't see until you sharpen
Here's a thing that took the community a while to notice: the Qwen Image VAE - and Krea 2, which is built on it - leaves a repeating lattice on every decoded image. A checkerboard, fine stripes, or both, at 1–5/255. You won't see it at 100%; flat dark areas hide it best, which is exactly where it does damage quietly. Then you sharpen and it turns into texture. Then you upscale and it becomes a pattern. A restorer like SeedVR2 reads it as detail worth rebuilding, and rebuilds it at 4×.
TS VAE Fix measures that lattice and subtracts it. One node, no model download, no extra Python package - and safe to leave permanently in a graph, because with no grid present it hands your image straight back.
The VAE became a quality lever again this year, and concepts.md covers why: the Qwen-Image VAE is Wan 2.1's architecture with a frozen encoder and a decoder fine-tuned for legible text, so fine texture is what got traded away. The lattice comes from the same place - the stride of the decoder's last upsample stage.
How it works
Two filters in one node. The notch isolates the 2-pixel component: a 9-tap binomial kernel with alternating signs, whose response is sin^8(w/2) - exactly 1 at a 2-pixel period, an 8th-order flat zero at DC. The horizontal and vertical passes combine as Bx + By - Bxy, giving a hard zero for stripes either way and for the checkerboard, while smooth gradients pass without banding. The correction is clamped to limit before subtraction, so a real edge survives and the tiny lattice does not.
The detector is what makes it safe to leave in a workflow. The grid's phase is locked to the decoder's output stride, so it sits on the same pixel positions across the whole frame - average the four (y%2, x%2) sublattices and the grid stays while real detail cancels out. Under 0.5/255, the image passes through untouched.
A batch is one clip: one decision and one limit for every frame, since per-frame calls would make video flicker.
What you actually set
Wire image straight from VAE Decode, then leave the rest alone:
mode-automeasures the removal limit from the image itself;manualuseslimit(default 0.02, max 0.1).skip_when_clean- on by default, and the reason the node is safe to leave wired in. Off filters regardless.preview_gain/preview_view- preview only, never your pixels.4x zoomand8x zoomshow a magnified centre crop, because a 2-pixel grid is invisible in a full-frame thumbnail.
Two outputs: image (cleaned, same size and batch) and removed_grid - what was subtracted, amplified and centred on grey. A healthy removed_grid is a uniform fine pattern; if you can make out a face or an edge, the limit is too high. The console gets one line, e.g. grid 1.78/255 (V-stripe) - removed, limit 0.015 auto | edges protected: 6.4%.
Install
ComfyUI Manager → Custom Nodes Manager → search Timesaver → install → restart. Manually:
cd ComfyUI/custom_nodes
git clone https://github.com/AlexYez/comfyui-timesaver
cd comfyui-timesaver
python -m pip install -r requirements.txt
Know what you're installing: Timesaver is an 83-node grab-bag (image, video, HDR, audio, LLM, prompt tooling), so you pull the lot for one degrid node. This node needs nothing beyond torch, but the pack's core requirements land transformers>=5.2.0, openai-whisper, opencv-python-headless and matplotlib in your environment - the usual dependency risk described in comfyui-ecosystem.md. The pack uses ComfyUI's V3 API (comfy_api.v0_0_2), so you want a reasonably current ComfyUI. The node lives under TS/Image/Retouch; searching grid, degrid or TS finds it.
If the degrid is all you want, ComfyUI-DeGrid is a standalone Apache-2.0 node doing the same job, and the 7-tap GLSL shader from the thread that started it drops into a shader node.
Where people get burned
Placement is the whole game. Put it immediately after VAE Decode, before any resize, sharpen or upscaler. After a resize the lattice is already scrambled: it measures 0.05/255 or less, the detector calls the image clean, and you get it back unchanged. That's the node working as designed, not failing.
Expecting it to fix a Wan 2.1 or Flux pipeline. The thread that started this blamed the Wan 2.1 VAE too, but measured decodes land at 0.05–0.4/255, under the threshold, so the node passes them through. Trust the measurement over the folklore - and if you want a fixed answer anyway, use manual and raise limit.
Cranking limit in manual mode. Too low and the grid survives in contrasty areas, where it's most visible. Too high and the finest texture - pores, fabric weave - softens slightly. That's why auto exists.
Assuming it's free. The notch shaves roughly 1/255 of genuine fine detail. Small, but real - hence the pass-through threshold. One non-issue: a fourth alpha channel is copied through untouched, and memory stays at a few copies of one frame, not the whole batch, so a long video batch is fine.
Inputs (6)
| Name | Type | Default | Description |
|---|---|---|---|
| image | IMAGE | Straight from VAE Decode. A batch of video frames is treated as one clip. | |
| mode | COMBO | auto | auto: the removal limit is measured from the image itself. manual: use the 'limit' value below. |
| limit | FLOAT | 0.0200–0.1 | Manual mode only. Largest correction per pixel, on the 0-1 scale. Too low: the grid survives in contrasty areas. Too high: the finest texture (pores, fabric) softens slightly. |
| skip_when_clean | BOOLEAN | true | Pass the image through bit for bit when no grid is found, e.g. after an upscaler or a resize. Off: filter regardless. |
| preview_gain | FLOAT | 101–50 | Brightness of the removed_grid preview only. Never changes the image. |
| preview_view | COMBO | 4x zoom | Framing of the removed_grid preview. A 2px grid turns into gray noise in a full-frame thumbnail; a magnified centre crop shows the pattern. |
Outputs (2)
| Name | Type | Description |
|---|---|---|
| image | IMAGE | The cleaned image, same size and batch as the input. |
| removed_grid | IMAGE | What was subtracted, amplified and centred on gray. Healthy: a uniform fine pattern. Recognisable faces or edges here mean the limit is too high. |