SYNTOLOGY HomeExplorerAtlasCodeMethodologyAboutDevelopersFeedPricing
Paper · 2502.09873 · ICCV · 2025

Compression-Aware One-Step Diffusion Model for JPEG Artifact Removal

Yong Guo, Yulun Zhang, Zheng Chen, Wenbo Li, Jinpei Guo

arXiv · PDF · Open in the Atlas

Code that ran

9 of 11 samples (functions and classes) lifted from this paper's linked repositories executed on a synthesized input in Syntology's jail (0 of them constructed an object rather than computing a result; 2 honoured the contract we drafted, 0 violated it and 1 has no contract verdict; 6 failures of our instrument; 2 no recorded run); 2 of them were also run on the host, not in the jail, by the peer-agreement lane that set their level, measured 2026-11-22; repository links from the Papers with Code archive attributed under CC BY-SA, no affiliation; bodies inline only under a permissive licence as GitHub detects it. Not a reproduction of the paper's results.

"Ran" means the function executed on a synthesized input and returned a value. It is not a reproduction of the paper's results. This record, dated, as JSON: /api/ran/2502.09873.json · badge: /api/ran/2502.09873.svg

Each repository's role is a label: a classifier's output recorded on the link, or, where no role is recorded, what the Papers with Code archive marked. The line under it names its basis. Neither says who wrote the code.

RepositoryRoleRan
jp-guo/CODiff canonical (classifier label)
classifier basis not recorded on the link
9 ran · 2 no recorded run
FunctionStatusWhere it lives
parse_float_list Ran
ran, honoured the contract we drafted
jp-guo/CODiff/main_train_codiff.py
code served (permissive licence) · get_code("8bc0bbc72282d3f8")
How it ran

Ran in Syntology's jail on this synthesized input (drafted by a language model, Claude Haiku 4.5, prompt python_fixture_v1) and returned list, ndim 1, dtype family float; no output shape is stated. The image it ran in was not recorded. The comparison behind this sample's level is a different run: the peer-agreement lane ran it again on the host, not in the jail (report dated 2026-09-05T00:52:19Z). If your copy returns the same type and ndim on these inputs, it matched what we observed; nothing here checks that. It does NOT mean the output is correct: nothing has compared it to the paper.

import argparse

def parse_float_list(arg):
    try:
        return [float(x) for x in arg.split(',')]
    except ValueError:
        raise argparse.ArgumentTypeError('List elements should be floats')

ARGS = {
    'arg': '1.5,2.3,3.7,4.2'
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1
Imports
none outside the standard library — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type list, ndim 1, dtype family float — a list output has no array shape of its own; none is stated
dtype family
int means an integer dtype; float means any other dtype the instrument saw, bool and complex included (fixture_check.py records only these two families)
Environment
image not recorded; re-verify against syntology-harvest-sandbox:v5-deps; not recorded for this sample: the harness installs a cuda-to-cpu shim (cuda_shim.py) before every sample and no run records whether a sample needed it; seed: none by the harness; any seed is in the setup block
parse_int_list Ran
ran, honoured the contract we drafted
jp-guo/CODiff/main_train_codiff.py
code served (permissive licence) · get_code("b2d5ad9f0fef3e14")
How it ran

Ran in Syntology's jail on this synthesized input (drafted by a language model, Claude Haiku 4.5, prompt python_fixture_v1) and returned list, ndim 1, dtype family int; no output shape is stated. The image it ran in was not recorded. The comparison behind this sample's level is a different run: the peer-agreement lane ran it again on the host, not in the jail (report dated 2026-09-05T01:33:15Z). If your copy returns the same type and ndim on these inputs, it matched what we observed; nothing here checks that. It does NOT mean the output is correct: nothing has compared it to the paper.

import argparse

def parse_int_list(arg):
    try:
        return [int(x) for x in arg.split(',')]
    except ValueError:
        raise argparse.ArgumentTypeError('List elements should be integers')

# Setup code
ARGS = {
    'arg': '1,2,3,4,5'
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1
Imports
none outside the standard library — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type list, ndim 1, dtype family int — a list output has no array shape of its own; none is stated
dtype family
int means an integer dtype; float means any other dtype the instrument saw, bool and complex included (fixture_check.py records only these two families)
Environment
image not recorded; re-verify against syntology-harvest-sandbox:v5-deps; not recorded for this sample: the harness installs a cuda-to-cpu shim (cuda_shim.py) before every sample and no run records whether a sample needed it; seed: none by the harness; any seed is in the setup block
conv Ran
ran; our contract draft was wrong, not the code
jp-guo/CODiff/cave/cave.py
code served (permissive licence) · get_code("0bb3503f833a6f8e")
How it ran

Ran in Syntology's sandbox on this synthesized input (drafted by a language model, Claude Haiku 4.5, prompt python_fixture_v1) and returned Sequential. The image it ran in was not recorded. If your copy returns the same type on these inputs, it matched what we observed; nothing here checks that. It does NOT mean the output is correct: nothing has compared it to the paper.

import torch
import torch.nn as nn
from collections import OrderedDict

torch.manual_seed(0)

ARGS = {
    'in_channels': 3,
    'out_channels': 64,
    'kernel_size': 3,
    'stride': 1,
    'padding': 1,
    'bias': True,
    'mode': 'CBR',
    'negative_slope': 0.2
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1
Imports
torch — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type Sequential — a Sequential output has no array shape of its own; none is stated — the instrument coerces any output to an array; for a Sequential output the recorded ndim 1 and dtype family float describe that coercion, not the output, and are not stated
Environment
image not recorded; re-verify against syntology-harvest-sandbox:v5-deps; not recorded for this sample: the harness installs a cuda-to-cpu shim (cuda_shim.py) before every sample and no run records whether a sample needed it; seed: none by the harness; any seed is in the setup block
find_last_checkpoint Ran
ran; our contract draft was wrong, not the code
jp-guo/CODiff/utils/utils_model.py
code served (permissive licence) · get_code("a81b59f721cab8ed")
How it ran

Ran in Syntology's sandbox on this synthesized input (drafted by a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API) and returned tuple, ndim 1, dtype family float; no output shape is stated. The image it ran in was not recorded. If your copy returns the same type and ndim on these inputs, it matched what we observed; nothing here checks that. It does NOT mean the output is correct: nothing has compared it to the paper.

import os
import tempfile
import shutil

# Create a temporary directory for testing
test_dir = tempfile.mkdtemp()

# Create some mock checkpoint files
# The function looks for files matching pattern: {number}_{net_type}.pth
os.makedirs(test_dir, exist_ok=True)

# Create checkpoint files with different iteration numbers
checkpoint_files = [
    os.path.join(test_dir, '1000_G.pth'),
    os.path.join(test_dir, '2000_G.pth'),
    os.path.join(test_dir, '500_G.pth'),
]

for checkpoint_file in checkpoint_files:
    with open(checkpoint_file, 'w') as f:
        f.write('')

ARGS = {
    'save_dir': test_dir,
    'net_type': 'G'
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
none outside the standard library — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type tuple, ndim 1, dtype family float — a tuple output has no array shape of its own; none is stated
dtype family
int means an integer dtype; float means any other dtype the instrument saw, bool and complex included (fixture_check.py records only these two families)
Environment
image not recorded; re-verify against syntology-harvest-sandbox:v5-deps; not recorded for this sample: the harness installs a cuda-to-cpu shim (cuda_shim.py) before every sample and no run records whether a sample needed it; seed: none by the harness; any seed is in the setup block
normalization Ran
ran on a synthesized input
jp-guo/CODiff/diffusion/models/model_util.py
code served (permissive licence) · get_code("a9064bd19ca9f80a")
How it ran

Ran in Syntology's sandbox on this synthesized input (drafted by a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API) and returned GroupNorm32. The image it ran in was not recorded. If your copy returns the same type on these inputs, it matched what we observed; nothing here checks that. It does NOT mean the output is correct: nothing has compared it to the paper.

import torch
import torch.nn as nn

torch.manual_seed(0)

# The function normalization takes:
# - channels: number of input channels (int)
# - norm_channel: normalization group size (int, default=32)

# Looking at the function body, it creates a GroupNorm32 with:
# GroupNorm32(norm_channel, channels)
# This means norm_channel is the number of groups and channels is the number of channels

# For GroupNorm to work properly, channels must be divisible by norm_channel
# So we need to choose values where this holds true

ARGS = {
    "channels": 32,
    "norm_channel": 8
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
torch — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type GroupNorm32 — a GroupNorm32 output has no array shape of its own; none is stated — the instrument coerces any output to an array; for a GroupNorm32 output the recorded ndim 0 and dtype family float describe that coercion, not the output, and are not stated
Environment
image not recorded; re-verify against syntology-harvest-sandbox:v5-deps; not recorded for this sample: the harness installs a cuda-to-cpu shim (cuda_shim.py) before every sample and no run records whether a sample needed it; seed: none by the harness; any seed is in the setup block
parse_str_list Ran
ran; our contract draft was wrong, not the code
jp-guo/CODiff/main_train_codiff.py
code served (permissive licence) · get_code("fa3b3cc4f07c4a0f")
How it ran

Ran in Syntology's sandbox on this synthesized input (drafted by a language model, Claude Haiku 4.5, prompt python_fixture_v1) and returned list, ndim 1, dtype family float; no output shape is stated. The image it ran in was not recorded. If your copy returns the same type and ndim on these inputs, it matched what we observed; nothing here checks that. It does NOT mean the output is correct: nothing has compared it to the paper.

import torch

torch.manual_seed(0)

ARGS = {
    "arg": "hello,world,test"
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1
Imports
torch — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type list, ndim 1, dtype family float — a list output has no array shape of its own; none is stated
dtype family
int means an integer dtype; float means any other dtype the instrument saw, bool and complex included (fixture_check.py records only these two families)
Environment
image not recorded; re-verify against syntology-harvest-sandbox:v5-deps; not recorded for this sample: the harness installs a cuda-to-cpu shim (cuda_shim.py) before every sample and no run records whether a sample needed it; seed: none by the harness; any seed is in the setup block
test Ran
ran; our contract draft was wrong, not the code
jp-guo/CODiff/utils/utils_model.py
pointer only (licence: MIT); the stored copy get_code serves, from guanys-dar/mgdn, is pointer only (licence: NONE) · get_code("8afaf26fe2391d00")
How it ran

The body of this sample is withheld: this paper's link allows the body inline (MIT), but get_code serves the stored copy, first harvested from guanys-dar/mgdn, and GitHub detected no licence in that repository when it was checked. The setup block that called it is withheld with it, because it is written against that body. source_path and origin say where the code lives, to read under the repository's own terms. A run is recorded.

upsample_pixelshuffle Ran
ran; our contract draft was wrong, not the code
jp-guo/CODiff/cave/cave.py
pointer only (licence: MIT); the stored copy get_code serves, from qcf-568/ostf, is pointer only (licence: NONE) · get_code("1e826b826044c581")
How it ran

The body of this sample is withheld: this paper's link allows the body inline (MIT), but get_code serves the stored copy, first harvested from qcf-568/ostf, and GitHub detected no licence in that repository when it was checked. The setup block that called it is withheld with it, because it is written against that body. source_path and origin say where the code lives, to read under the repository's own terms. A run is recorded.

upsample_upconv Ran
ran; our contract draft was wrong, not the code
jp-guo/CODiff/cave/cave.py
pointer only (licence: MIT); the stored copy get_code serves, from qcf-568/ostf, is pointer only (licence: NONE) · get_code("d53f0c58a1467858")
How it ran

The body of this sample is withheld: this paper's link allows the body inline (MIT), but get_code serves the stored copy, first harvested from qcf-568/ostf, and GitHub detected no licence in that repository when it was checked. The setup block that called it is withheld with it, because it is written against that body. source_path and origin say where the code lives, to read under the repository's own terms. A run is recorded.

checkpoint Not yet run
unverified (harvested, no recorded run)
jp-guo/CODiff/diffusion/models/model_util.py
code served (permissive licence) · get_code("9dee9ecfc0e9f269")
How it ran

no invocation recorded.

conv_nd Not yet run
unverified (harvested, no recorded run)
jp-guo/CODiff/diffusion/models/model_util.py
pointer only (licence: MIT); the stored copy get_code serves, from Ashwin-Pokharel/base_diffusion, is pointer only (licence: NONE) · get_code("49ff3519834529f3")
How it ran

The body of this sample is withheld: this paper's link allows the body inline (MIT), but get_code serves the stored copy, first harvested from Ashwin-Pokharel/base_diffusion, and GitHub detected no licence in that repository when it was checked. The setup block that called it is withheld with it, because it is written against that body. source_path and origin say where the code lives, to read under the repository's own terms. No invocation recorded.

Also present in other papers' code

Of 11 samples lifted from this paper's linked repositories, 11 carry a function identity and 0 do not. Of the 11 distinct functions with an identity, 10 are also present in other papers whose code we hold (10 with at least one paper dated earlier, 1 the same month, 2 later) and 1 are only here among the 52,977 papers whose code Syntology holds (as of 2026-09-26).

Only here means: among the 52,977 papers whose code Syntology holds (51,887 with lifted samples, 1,090 through their assemblies only), as of 2026-09-26, no other paper's lifted samples or current assembly bricks contain an identical function body after normalisation.

FunctionAlso present inEarliest-datedOthers named
conv_nd 121 other papers
106 dated earlier, 2 the same month, 13 later · 32 only as an assembly brick
2006.11239 (2020-06)
Denoising Diffusion Probabilistic Models
2010.02502 (2020-10)
Denoising Diffusion Implicit Models
2111.11672 (2021-11)
Few-shot Image Generation with Mixup-based Distance Learning
and 118 more not named here
checkpoint 51 other papers
45 dated earlier, 6 later · 29 only as an assembly brick
2006.11239 (2020-06)
Denoising Diffusion Probabilistic Models
2105.05233 (2021-05)
Diffusion Models Beat GANs on Image Synthesis
2110.11291 (2021-10)
Likelihood Training of Schrödinger Bridge using Forward-Backward SDEs Theory
and 48 more not named here
upsample_pixelshuffle 10 other papers
9 dated earlier, 1 same year, order not determinable
2008.13751 (2020-08)
Plug-and-Play Image Restoration with Deep Denoiser Prior
2109.14573 (2021-09)
Towards Flexible Blind JPEG Artifacts Removal
2110.03220 (2021-10)
Gradient Step Denoiser for convergent Plug-and-Play
and 7 more not named here
conv 9 other papers
8 dated earlier, 1 same year, order not determinable
2008.13751 (2020-08)
Plug-and-Play Image Restoration with Deep Denoiser Prior
2109.14573 (2021-09)
Towards Flexible Blind JPEG Artifacts Removal
2203.05568 (2022-03)
Unfolded Deep Kernel Estimation for Blind Image Super-resolution
and 6 more not named here
find_last_checkpoint 5 other papers
5 dated earlier
2103.14006 (2021-03)
Designing a Practical Degradation Model for Deep Blind Image Super-Resolution
2106.15368 (2021-06)
Text Prior Guided Scene Text Image Super-resolution
2207.13784 (2022-07)
AvatarPoser: Articulated Full-Body Pose Tracking from Sparse Motion Sensing
and 2 more not named here
test 4 other papers
4 dated earlier
2008.13751 (2020-08)
Plug-and-Play Image Restoration with Deep Denoiser Prior
2103.14006 (2021-03)
Designing a Practical Degradation Model for Deep Blind Image Super-Resolution
2203.13278 (2022-03)
Practical Blind Image Denoising via Swin-Conv-UNet and Data Synthesis
and 1 more not named here
parse_float_list 3 other papers
3 dated earlier
2401.00877 (2024-01)
Improving the Stability and Efficiency of Diffusion Models for Content Consistent Super-Resolution
2406.08177 (2024-06)
One-Step Effective Diffusion Network for Real-World Image Super-Resolution
2412.03017 (2024-12)
Pixel-level and Semantic-level Adjustable Super-resolution: A Dual-LoRA Approach
parse_int_list 3 other papers
3 dated earlier
2401.00877 (2024-01)
Improving the Stability and Efficiency of Diffusion Models for Content Consistent Super-Resolution
2406.08177 (2024-06)
One-Step Effective Diffusion Network for Real-World Image Super-Resolution
2412.03017 (2024-12)
Pixel-level and Semantic-level Adjustable Super-resolution: A Dual-LoRA Approach
parse_str_list 3 other papers
3 dated earlier
2401.00877 (2024-01)
Improving the Stability and Efficiency of Diffusion Models for Content Consistent Super-Resolution
2406.08177 (2024-06)
One-Step Effective Diffusion Network for Real-World Image Super-Resolution
2412.03017 (2024-12)
Pixel-level and Semantic-level Adjustable Super-resolution: A Dual-LoRA Approach
upsample_upconv 2 other papers
2 dated earlier
2109.14573 (2021-09)
Towards Flexible Blind JPEG Artifacts Removal
2407.21422 (2024-07)
Revisiting Tampered Scene Text Detection in the Era of Generative AI

Presence, not direction: an identical function body in two papers' repositories does not say who wrote it, which came from which, or that either paper's method rests on it. Matching is exact after normalisation, so a renamed or edited function is not matched. Dates are when papers appeared, not when code was written. Only .py files the harvester lifted are covered; notebooks are not read. A new-style arXiv id YYMM.NNNN dates a paper to the month 20YY-MM; otherwise Paper.year dates it to the year; otherwise it is undated. Dates are when the paper appeared, not when the code was written. Read 2026-11-22.

Repositories linked to this paper

Some links come from the archived Papers with Code dataset (CC BY-SA 4.0): attribution and licence.

Abstract

Diffusion models have demonstrated remarkable success in image restoration tasks. However, their multi-step denoising process introduces significant computational overhead, limiting their practical deployment. Furthermore, existing methods struggle to effectively remove severe JPEG artifact, especially in highly compressed images. To address these challenges, we propose CODiff, a compression-aware one-step diffusion model for JPEG artifact removal. The core of CODiff is the compression-aware visual embedder (CaVE), which extracts and leverages JPEG compression priors to guide the diffusion model. Moreover, We propose a dual learning strategy for CaVE, which combines explicit and implicit learning. Specifically, explicit learning enforces a quality prediction objective to differentiate lowquality images with different compression levels. Implicit learning employs a reconstruction objective that enhances the model's generalization. This dual learning allows for a deeper understanding of JPEG compression. Experimental results demonstrate that CODiff surpasses recent leading methods in both quantitative and visual quality metrics. The code is available at https://github.com/jp-guo/CODiff. JPEG [37] artifact removal task aims to remove the artifact caused by the compression algorithm and recover the lost information from the compressed images. Recent advancements have focused on leveraging 15,20,24,54] to remove JPEG artifact for compressed images with different quality factors (QFs), achieving remarkable performance. However, these methods (see Fig. 1) face significant challenges at high compression levels, due to substantial compression artifact and severe visual information loss. Recent advances in diffusion models [2,12,33,34], particularly large-scale pre-trained text-to-image (T2I) models [28,29,31], have strong image generation priors. These priors make diffusion models a promising solution

For agents

The same record, over MCP at https://syntology.ai/mcp:

get_harvested_code_for_paper("2502.09873")
get_code_for_paper("2502.09873")
have("2502.09873")

The run record, dated, one paper per request, free:

curl https://syntology.ai/api/ran/2502.09873.json

A badge for a README (the split and the date, never a ratio):

[![Syntology run record](https://syntology.ai/api/ran/2502.09873.svg)](https://syntology.ai/paper/2502.09873)

Connect an agent — have() is free.