AI Source Pattern Cleanup
Clean the AI checkerboard out of OpenAI images before they wreck your Flux reference
- image
- image
- difference_image
If you've ever upscaled or refined an image that ChatGPT/GPT-4o produced and wondered why the result has a faint, quilt-like micro-grid smeared over every flat surface - that's not your sampler, and it's not the upscaler's fault. It's baked into the source. OpenAI outputs carry an embedded high-frequency checker/micro-grid pattern, and when you feed that image in at 1:1 as an ETUR source or as a Flux 2 reference, the pattern gets amplified and carried forward into every tile.
AI Source Pattern Cleanup is the pre-flight check for exactly that case. It measures the grid frequency in your source image and attenuates it before the image hits the tiler or the reference encoder. As the author's own description stresses, this is a preprocessing node, not a finishing blur or sharpen pass. You run it on the input, not on the output.
How it works
The node runs a frequency detector tuned to the width of the source grid (that's what low_freq_radius, default 128, controls - the "notch width" of the detector), then reduces the detected high-frequency pattern by the amount you set in high_freq_reduce. The correction is deliberately capped so it doesn't smear the image into darkness or pixelation; it targets the measured grid and leaves the rest of the image alone.
The three inputs that matter:
- image - your direct 1:1 OpenAI/ChatGPT source. The tooltip is explicit that this is not meant for already-upscaled, resampled, or final generated output. If the pattern was already resampled away or buried in a finished render, running this can only hurt.
- high_freq_reduce (default 0.25) - how much of the detected grid to remove. Start at 0.20–0.35 for direct OpenAI images. Push it too high and you'll start eating real texture: pores, freckles, fabric weave, which is how you get that flat "AI skin" look.
- Generate_Difference_Image (default off) - when enabled, the second output shows only an exaggerated map of the micro-grid it found, with a Photoshop-style curve (0→0, 1→253, 255→255). Turn this on once to see what the node is removing, then turn it off.
Outputs are image (the cleaned image - wire this into your ETUR source or Flux 2 reference input) and difference_image (the debug map, only meaningful when the flag is on).
Installing it
This node ships in the TBG ETUR pack. Easiest is ComfyUI Manager → Install Custom Nodes → search "TBG" and install TBG_Enhanced Tiled Upscaler & Refiner FLUX PRO, then restart. Or clone it yourself:
cd ComfyUI/custom_nodes
git clone https://github.com/Ltamann/ComfyUI-TBG-ETUR
cd ComfyUI-TBG-ETUR
pip install -r requirements.txt
Then restart ComfyUI. Fair warning: that requirements file is heavy - opencv-contrib, triton, transformers, diffusers, bitsandbytes and friends all come along even if you only want this one node. See the pack's README notes if pip complains.
Troubleshooting
Two real failure modes, both on the user side. If you're losing real detail (smooth, plasticky skin), your high_freq_reduce is too high - back it off into the 0.2–0.35 band. If you're not sure the node is doing anything at all, flip on Generate_Difference_Image and look at what it detected; the map should show a faint grid, not a featureless image or a full edge map. If you see the grid and a mountain of other edges, your source was already upscaled or resampled, and you'd be better off regenerating the source at the resolution you actually need than trying to scrub it here.
One thing worth knowing: this is a source fix, not a magic bullet. If your OpenAI image is destined for a photo-realistic upscale, clean it first, then treat it like any other upscale source - the usual upscaling ladder still applies. The node just keeps the watermark-of-the-AI-era from compounding.
Inputs (4)
| Name | Type | Default | Description |
|---|---|---|---|
| image | IMAGE | Direct 1:1 OpenAI/ChatGPT source image to clean before using it as an ETUR source/reference. This targets the measured embedded high-frequency micro-grid/checker pattern; it is not intended for already-upscaled, resampled, or final generated output images. | |
| high_freq_reduce | FLOAT | 0.250–1 | How much detected source micro-grid pattern to reduce. Start at 0.20-0.35 for direct OpenAI images; high values can remove real pores/freckles or create flat skin. |
| low_freq_radius | FLOAT | 1281–256 | Width of the measured source-grid frequency detector. Existing workflows can keep 128; the actual correction is tightly capped to avoid dark spots and pixelation. |
| Generate_Difference_Image | BOOLEAN | false | When enabled, the second output shows only the exaggerated micro-grid difference map with a Photoshop-style curve: 0->0, 1->253, 255->255. |
Outputs (2)
| Name | Type | Description |
|---|---|---|
| image | IMAGE | — |
| difference_image | IMAGE | — |