Nodes/ComfyUI FRED Nodes v2/πŸ‘‘ FRED Jpeg Artifact Simulator
ComfyUI Node

πŸ‘‘ FRED Jpeg Artifact Simulator

Simulate JPEG artifacts on your images, useful for training and testing

By PoukpalaovaΒ·Created about a year agoΒ·Updated 7 months agoΒ· 3
πŸ‘‘ FRED Jpeg Artifact Simulator
  • images
  • image
  • help
β—„quality50β–Ί

JPEG artifacts are the most common real-world degradation there is - everything on the internet has been through some lossy compressor at some point. FRED_JpegArtifact_Simulator reproduces them in-process: it compresses your image as a JPEG at the quality you pick and immediately decompresses it back, handing you an image that genuinely carries blocking and ringing artifacts. Two inputs, one output, and a surprising amount of utility.

How it works

The mechanism is exactly what it sounds like, and that's the good news: no model, no guesswork. Your images batch is encoded to JPEG at quality (1–100, default 50), then decoded back to an IMAGE tensor. What comes out is a faithful reproduction of what that image would look like after a JPEG round-trip - same artifacts a real user's compressed copy would have. Quality 50 is a strong, clearly-visible degradation; 90+ is nearly lossless; low single digits is brutal.

Why you'd deliberately add artifacts

Three real use cases:

  1. Training data augmentation. If you're training a restoration or upscale model - or fine-tuning a LoRA on "real" internet images - the model needs to see degraded inputs at inference time. Distorting your clean training set with JPEG noise at varied qualities is a standard augmentation, and this node does it with one slider instead of a shell-out to ffmpeg or an external script.

  2. Testing robustness. Evaluate how your upscaler or denoiser handles compression damage before you trust it on real-world input. Run the same image through quality 30 / 50 / 70, then through your pipeline, and compare outputs with FRED_ImageQualityInspector. That's a concrete, repeatable robustness test.

  3. Honest previews. "What will this look like after the website re-compresses it?" Render at the quality your platform uses (many compress to ~80) and you'll stop being surprised by blocky skies in the final upload.

It's a deliberately small node - images in, image (degraded) out, plus help. No resize, no mode switching. If you need chroma subsampling variations or progressive JPEG behavior, that's beyond what this does.

Install

cd ComfyUI/custom_nodes
git clone https://github.com/Poukpalaova/ComfyUI-FRED-Nodes_v2.git

Restart, or "ComfyUI FRED Nodes v2" via ComfyUI Manager. It needs Pillow from the pack's requirements - nothing exotic.

Gotchas

It's a real encode-decode round trip, so it's not free: on a big batch it's CPU-bound work, though trivial next to any sampling. And there's a subtlety worth internalizing - the artifacts you get are exactly as faithful as Pillow's JPEG encoder, which is very good but not byte-identical to every website's encoder. For testing your pipeline's tolerance, that's plenty. For matching one specific compressor's quirks, it's close but not exact.

CategoryπŸ‘‘FRED/image

Inputs (2)

NameTypeDefaultDescription
imagesIMAGEβ€”
qualityINT501–100β€”

Outputs (2)

NameTypeDescription
imageIMAGEβ€”
helpSTRINGβ€”