Nodes/GPT Image Latent Refiner/GPT Image Latent Refiner
ComfyUI Node

GPT Image Latent Refiner

The node that scrubs the speckle out of GPT Image outputs before an upscaler bakes it in

By AIEGOBOT·Created 24 days ago·Updated 22 days ago· 7
GPT Image Latent Refiner
  • image
  • image
profileqwen
strength1.00
deviceauto
tile_vaetrue

You know the look. GPT Image-family models (in ChatGPT, and anything running the same base) leave a tell on every output: a fine stippling of bright specks, an over-sharpened "scale" pattern that lands on skin and fabric, grime in the shadows, micro-texture that tiles when you zoom. It's a fingerprint of that one model family, and it's annoying to fix - regular denoising eats real detail, and frequency filters can't tell artifact from texture. This node is a tiny latent-space model trained specifically to unlearn that one failure mode, and it runs entirely locally. No OpenAI API key, no network call. The "GPT" in the name is the target, not the transport.

It's not a generator and it won't wow you on its own - the author is upfront that its benefit really shows when you run it before SeedVR2 upscaling, stopping the upscaler from reconstructing and amplifying those dots as "detail." If your pipeline is "GPT image → upscale → done," this is the preprocessing step you're missing.

How it works

The mechanism is deliberately simple, and it's borrowed from the community project that inspired it (Larryvrh's GPT Image 2 Artifact Cleaner, re-trained here on a 75-pair dataset and repackaged as a native node). The node:

  1. Encodes your image into VAE latent space using one of three profiles - Qwen Image VAE, FLUX.2 small decoder, or SDXL VAE.
  2. Runs a small residual UNet over the latent (the checkpoints are ~1.8 MB each - the artifacts are model-specific enough that the correction barely needs any parameters).
  3. Adds the predicted correction scaled by strength, then decodes back to pixels.

Because the artifacts and the real texture live partly separated in latent space, the network has far less to learn than a pixel-space denoiser. The honest trade-off: both live at the same scale, so cleanup always costs a little genuine detail. This node makes an image easier to look at; it doesn't repair a structurally broken generation.

The inputs that matter

The full graph is Load Image → GPT Image Latent Refiner → Preview/Save Image. Five inputs, and you'll touch three of them:

  • profile - qwen (default, best cleanup/preservation balance), flux2 (gentler, preserves more source detail), sdxl (stronger reconstruction drift, but can work better on photorealistic portraits). Start with qwen.
  • strength - 0 is a true bypass, 1.0 is the trained correction, above 1.0 extrapolates the learned residual (range 0–2, step 0.05). For an important image, run a low strength first and compare.
  • image - the IMAGE tensor. Output is one IMAGE, same resolution, ready to feed an upscaler.

The other two, device (auto is right) and tile_vae (defaults to true; tiling the internal VAE saves VRAM on big inputs at a speed cost) are fine at defaults until they're not.

Install

Easiest path: ComfyUI Manager → search "GPT Image Latent Refiner" → Install, then restart. Or clone it:

cd ComfyUI/custom_nodes
git clone https://github.com/AIEGOBOT/ComfyUI-GPT-Image-Latent-Refiner
cd ComfyUI-GPT-Image-Latent-Refiner
pip install -r requirements.txt

Dependencies are light - diffusers and safetensors only. But the three VAEs are not bundled and will bite you on first run if you skip them. Download config.json and diffusion_pytorch_model.safetensors for each into ComfyUI/models/vae/GPT-Image-Latent-Refiner/<profile>/ (Qwen Image VAE, FLUX.2 small decoder, SDXL Base VAE - all from their official Hugging Face pages). The node validates the profile, latent channels, checkpoint and VAE files rather than silently mixing mismatched assets, so a missing file is a loud error, not a wrong-looking image. One more catch: this is built on ComfyUI's newer node API (requires-comfyui >= 0.33.1), so it won't load in older installs - update ComfyUI first.

Troubleshooting and gotchas

  • "VAE config not found" - you downloaded the refiner but not the three VAEs. That's the #1 first-run failure; the paths in the README's table are exact.
  • OOM on big images - tile_vae is on by default for this reason. Process one large image at a time. The refiner's own footprint is modest (roughly 7.5 GiB free-memory target for qwen, ~4 GiB for the others), but the SeedVR2 stage you're feeding is the real VRAM hog - swap its 7B FP16 for the INT8 ConvRot variant if needed.
  • The SeedVR2 examples use regular VAEEncode/VAEDecode - only swap those for tiled versions if that stage is the one OOMing; it's independent of the node's tile_vae switch.
  • The 0.5x pre-downscale in the example workflow is optional. It helps suppress grid texture before SeedVR2 rebuilds, but it can also destroy real fine detail or small text. Set it to 1.0 when source preservation matters.

Worth knowing before you build a business on it: the code and bundled checkpoints are PolyForm Noncommercial, same as the upstream project. Fine for personal work, a licensing conversation if you're selling the output.

CategoryGPT Image/refinement

Inputs (5)

NameTypeDefaultDescription
imageIMAGE
profileCOMBOqwenqwen: recommended balance; flux2: stronger source preservation; sdxl: stronger reconstruction drift, but may work better for photorealistic portraits.
strengthFLOAT1.000–20 bypasses the learned correction; 1 is the trained strength.
deviceCOMBOauto3 options: auto, cuda, cpu
tile_vaeBOOLEANtrueUse VAE tiling to reduce peak VRAM on large images.

Outputs (1)

NameTypeDescription
imageIMAGE