SYNTOLOGY HomeExplorerAtlasCodeMethodologyAboutDevelopersFeedPricing
Paper · 2401.00877 · 2024

Improving the Stability and Efficiency of Diffusion Models for Content Consistent Super-Resolution

arXiv · PDF · Open in the Atlas

Code that ran

12 of 15 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 0 have no contract verdict; 10 failures of our instrument; 3 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/2401.00877.json · badge: /api/ran/2401.00877.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
csslc/ccsr canonical (classifier label)
classifier basis: census
9 ran · 3 no recorded run
copy not recorded community
not in the paper's declared repositories
3 ran · 0 no recorded run
FunctionStatusWhere it lives
parse_float_list Ran
ran, honoured the contract we drafted
this paper's copy was not recorded; identical code first harvested from cswry/OSEDiff
pointer only · get_code("8bc0bbc72282d3f8")
How it ran

The body of this sample is withheld: this paper's copy of the code was not recorded (its link names no repository or source path), so no licence was read for it. 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.

parse_int_list Ran
ran, honoured the contract we drafted
this paper's copy was not recorded; identical code first harvested from cswry/OSEDiff
pointer only · get_code("b2d5ad9f0fef3e14")
How it ran

The body of this sample is withheld: this paper's copy of the code was not recorded (its link names no repository or source path), so no licence was read for it. 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.

DiffAugment Ran
ran; the contract check could not run (RAISES, DEP_MISSING or TIMEOUT)
csslc/ccsr/models/DiffAugment.py
code served (permissive licence) · get_code("d5662fd75b69cda4")
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 Tensor, ndim 4, dtype family float, shape (2, 3, 4, 4) as a later run recorded it. The image it ran in was not recorded. If your copy returns the same type, ndim and shape 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 numpy as np

torch.manual_seed(0)
np.random.seed(0)

# Create a small batch of image tensors
# Shape: (batch_size, channels, height, width)
x = torch.randn(2, 3, 4, 4, dtype=torch.float32)

# Define arguments for DiffAugment function
ARGS = {
    'x': x,
    'policy': 'color,translation,resize,cutout',
    'channels_first': True
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
numpy, torch — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type Tensor, ndim 4, dtype family float, shape (2, 3, 4, 4) — shape (2, 3, 4, 4) as a later run recorded it
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
format_time Ran
ran; our contract draft was wrong, not the code
csslc/ccsr/ADD/dnnlib/util.py
pointer only (licence: Apache-2.0); the stored copy get_code serves, from leaplabthu/adanat, is pointer only (licence: NONE) · get_code("a091d19d483bafe2")
How it ran

The body of this sample is withheld: this paper's link allows the body inline (Apache-2.0), but get_code serves the stored copy, first harvested from leaplabthu/adanat, 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.

format_time_brief Ran
ran; our contract draft was wrong, not the code
csslc/ccsr/ADD/dnnlib/util.py
pointer only (licence: Apache-2.0); the stored copy get_code serves, from leaplabthu/adanat, is pointer only (licence: NONE) · get_code("556dd2c77ff90670")
How it ran

The body of this sample is withheld: this paper's link allows the body inline (Apache-2.0), but get_code serves the stored copy, first harvested from leaplabthu/adanat, 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.

forward_flex Ran
ran; our contract draft was wrong, not the code
csslc/ccsr/models/vit_utils.py
code served (permissive licence) · get_code("92726cd76c52caca")
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 Tensor, ndim 3, dtype family float, shape (2, 17, 16) as a later run recorded it. The image it ran in was not recorded. If your copy returns the same type, ndim and shape 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)

# Build minimal patch_embed with proj method
class PatchEmbed(nn.Module):
    def __init__(self):
        super().__init__()
        self.proj = nn.Conv2d(3, 16, kernel_size=4, stride=4)
    
    def forward(self, x):
        return self.proj(x)

# Build minimal transformer block
class TransformerBlock(nn.Module):
    def __init__(self, dim):
        super().__init__()
        self.norm = nn.LayerNorm(dim)
        self.attn = nn.Linear(dim, dim)
        self.mlp = nn.Linear(dim, dim)
    
    def forward(self, x):
        x = x + self.attn(self.norm(x))
        x = x + self.mlp(self.norm(x))
        return x

# Build the model container
class FlexModel(nn.Module):
    def __init__(self):
        super().__init__()
        self.patch_size = (4, 4)
        self.patch_embed = PatchEmbed()
        self.cls_token = nn.Parameter(torch.randn(1, 1, 16))
        self.pos_embed = nn.Parameter(torch.randn(1, 65, 16))
        self.pos_drop = nn.Dropout(0.1)
        self.blocks = nn.ModuleList([TransformerBlock(16) for _ in range(2)])
        self.norm = nn.LayerNorm(16)
    
    def _resize_pos_embed(self, pos_embed, h, w):
        # Simple stand-in: just return pos_embed reshaped or padded to (1, h*w+1, 16)
        num_patches = h * w
        target_size = num_patches + 1
        current_size = pos_embed.size(1)
        if current_size == target_size:
            return pos_embed
        elif current_size < target_size:
            padding = torch.zeros(1, target_size - current_size, pos_embed.size(2))
            return torch.cat([pos_embed, padding], dim=1)
        else:
            return pos_embed[:, :target_size, :]

model = FlexModel()

# Create input tensor: batch=2, channels=3, height=16, width=16
x = torch.randn(2, 3, 16, 16)

ARGS = {
    "self": model,
    "x": x
}
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 Tensor, ndim 3, dtype family float, shape (2, 17, 16) — shape (2, 17, 16) as a later run recorded it
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
get_activation Ran
ran; our contract draft was wrong, not the code
csslc/ccsr/models/vit_utils.py
code served (permissive licence) · get_code("b9e2f79c13245bdc")
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 function. 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 get_activation takes a single parameter 'name' which is a string.
# It returns a hook function that stores model outputs in the activations dict.
# The hook function itself takes (model, input, output) but those are used by PyTorch's
# register_forward_hook mechanism, not by get_activation directly.
# So we just need to provide a valid string name.

ARGS = {
    "name": "layer_output"
}
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 function — a function output has no array shape of its own; none is stated — the instrument coerces any output to an array; for a function 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
image_grid Ran
ran; the contract check could not run (RAISES, DEP_MISSING or TIMEOUT)
csslc/ccsr/train_ccsr_stage1.py
code served (permissive licence) · get_code("bd5a05ce886da4ce")
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 Image. 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.

from PIL import Image

# Create small test images with distinct dimensions
img1 = Image.new('RGB', size=(64, 48), color=(255, 0, 0))
img2 = Image.new('RGB', size=(64, 48), color=(0, 255, 0))
img3 = Image.new('RGB', size=(64, 48), color=(0, 0, 255))
img4 = Image.new('RGB', size=(64, 48), color=(255, 255, 0))

ARGS = {
    'imgs': [img1, img2, img3, img4],
    'rows': 2,
    'cols': 2,
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1
Imports
PIL — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type Image — a Image output has no array shape of its own; none is stated — the instrument coerces any output to an array; for a Image output the recorded ndim 3 and dtype family int 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
this paper's copy was not recorded; identical code first harvested from cswry/OSEDiff
pointer only · get_code("fa3b3cc4f07c4a0f")
How it ran

The body of this sample is withheld: this paper's copy of the code was not recorded (its link names no repository or source path), so no licence was read for it. 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.

rand_brightness Ran
ran; our contract draft was wrong, not the code
csslc/ccsr/models/DiffAugment.py
code served (permissive licence) · get_code("37b50aac63f46854")
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 Tensor, ndim 4, dtype family float, shape (2, 3, 4, 5) as a later run recorded it. The image it ran in was not recorded. If your copy returns the same type, ndim and shape 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)

# Create a small batch of tensors
# Shape: (batch_size=2, channels=3, height=4, width=5)
x = torch.randn(2, 3, 4, 5, dtype=torch.float32)

ARGS = {
    "x": x
}
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 Tensor, ndim 4, dtype family float, shape (2, 3, 4, 5) — shape (2, 3, 4, 5) as a later run recorded it
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
rand_saturation Ran
ran; our contract draft was wrong, not the code
csslc/ccsr/models/DiffAugment.py
code served (permissive licence) · get_code("db65cf4b9c6f357e")
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 Tensor, ndim 4, dtype family float, shape (2, 4, 3, 5) as a later run recorded it. The image it ran in was not recorded. If your copy returns the same type, ndim and shape 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)

# Construct a small input tensor
# The function expects x to have shape (batch_size, channels, height, width)
# or at least 4 dimensions since it calls mean(dim=1, keepdim=True)
x = torch.randn(2, 4, 3, 5)

ARGS = {
    "x": x
}
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 Tensor, ndim 4, dtype family float, shape (2, 4, 3, 5) — shape (2, 4, 3, 5) as a later run recorded it
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
zero_module Ran
ran; our contract draft was wrong, not the code
csslc/ccsr/models/controlnet.py
code served (permissive licence) · get_code("da94debb8019ad46")
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 SimpleModule. 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
from torch import nn

torch.manual_seed(0)

# Create a simple neural network module with some parameters
class SimpleModule(nn.Module):
    def __init__(self):
        super().__init__()
        self.linear1 = nn.Linear(4, 3)
        self.linear2 = nn.Linear(3, 2)
    
    def forward(self, x):
        x = self.linear1(x)
        x = self.linear2(x)
        return x

# Instantiate the module
module = SimpleModule()

# Define the ARGS dictionary
ARGS = {
    "module": module
}
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 SimpleModule — a SimpleModule output has no array shape of its own; none is stated — the instrument coerces any output to an array; for a SimpleModule 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
ask_yes_no Not yet run
unverified (harvested, no recorded run)
csslc/ccsr/ADD/dnnlib/util.py
code served (permissive licence) · get_code("9d31d2c4cd16bb2d")
How it ran

no invocation recorded.

forward_vit Not yet run
unverified (harvested, no recorded run)
csslc/ccsr/models/vit_utils.py
code served (permissive licence) · get_code("5f2544125330bf84")
How it ran

no invocation recorded.

import_model_class_from_model_name_or_path Not yet run
unverified (harvested, no recorded run)
csslc/ccsr/train_ccsr_stage1.py
code served (permissive licence) · get_code("2f00b39db5a81466")
How it ran

no invocation recorded.

Also present in other papers' code

Of 15 samples lifted from this paper's linked repositories, 15 carry a function identity and 0 do not. Of the 15 distinct functions with an identity, 9 are also present in other papers whose code we hold (6 with at least one paper dated earlier, 3 the same month, 9 later) and 6 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
format_time 73 other papers
24 dated earlier, 1 the same month, 47 later, 1 undated
2004.00049 (2020-04)
In-Domain GAN Inversion for Real Image Editing
2004.11660 (2020-04)
Disentangled and Controllable Face Image Generation via 3D Imitative-Contrastive Learning
2108.00946 (2021-08)
StyleGAN-NADA: CLIP-Guided Domain Adaptation of Image Generators
and 70 more not named here
ask_yes_no 69 other papers
24 dated earlier, 1 the same month, 43 later, 1 undated
2004.00049 (2020-04)
In-Domain GAN Inversion for Real Image Editing
2004.11660 (2020-04)
Disentangled and Controllable Face Image Generation via 3D Imitative-Contrastive Learning
2108.00946 (2021-08)
StyleGAN-NADA: CLIP-Guided Domain Adaptation of Image Generators
and 66 more not named here
format_time_brief 68 other papers
20 dated earlier, 1 the same month, 46 later, 1 undated
2108.00946 (2021-08)
StyleGAN-NADA: CLIP-Guided Domain Adaptation of Image Generators
2202.00273 (2022-02)
StyleGAN-XL: Scaling StyleGAN to Large Diverse Datasets
2206.07695 (2022-06)
VoxGRAF: Fast 3D-Aware Image Synthesis with Sparse Voxel Grids
and 65 more not named here
zero_module 40 other papers
10 dated earlier, 28 later, 2 same year, order not determinable
2305.13077 (2023-05)
ControlVideo: Training-free Controllable Text-to-Video Generation
2305.17098 (2023-05)
ControlVideo: Conditional Control for One-shot Text-driven Video Editing and Beyond
2308.03448 (2023-08)
Make Explicit Calibration Implicit: Calibrate Denoiser Instead of the Noise Model
and 37 more not named here
import_model_class_from_model_name_or_path 24 other papers
8 dated earlier, 15 later, 1 same year, order not determinable
2212.04489 (2022-12)
SINE: SINgle Image Editing with Text-to-Image Diffusion Models
2306.06874 (2023-06)
VillanDiffusion: A Unified Backdoor Attack Framework for Diffusion Models
2306.07280 (2023-06)
Controlling Text-to-Image Diffusion by Orthogonal Finetuning
and 21 more not named here
image_grid 17 other papers
5 dated earlier, 11 later, 1 same year, order not determinable
2201.08896 (2022-01)
Environment Generation for Zero-Shot Compositional Reinforcement Learning
2303.09522 (2023-03)
P+: Extended Textual Conditioning in Text-to-Image Generation
2311.16518 (2023-11)
SeeSR: Towards Semantics-Aware Real-World Image Super-Resolution
and 14 more not named here
parse_float_list 3 other papers
3 later
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
2502.09873 (2025-02)
Compression-Aware One-Step Diffusion Model for JPEG Artifact Removal
parse_int_list 3 other papers
3 later
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
2502.09873 (2025-02)
Compression-Aware One-Step Diffusion Model for JPEG Artifact Removal
parse_str_list 3 other papers
3 later
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
2502.09873 (2025-02)
Compression-Aware One-Step Diffusion Model for JPEG Artifact Removal

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

The generative priors of pre-trained latent diffusion models (DMs) have demonstrated great potential to enhance the visual quality of image super-resolution (SR) results. However, the noise sampling process in DMs introduces randomness in the SR outputs, and the generated contents can differ a lot with different noise samples. The multi-step diffusion process can be accelerated by distilling methods, but the generative capacity is difficult to control. To address these issues, we analyze the respective advantages of DMs and generative adversarial networks (GANs) and propose to partition the generative SR process into two stages, where the DM is employed for reconstructing image structures and the GAN is employed for improving fine-grained details. Specifically, we propose a non-uniform timestep sampling strategy in the first stage. A single timestep sampling is first applied to extract the coarse information from the input image, then a few reverse steps are used to reconstruct the main structures. In the second stage, we finetune the decoder of the pre-trained variational auto-encoder by adversarial GAN training for deterministic detail enhancement. Once trained, our proposed method, namely content consistent super-resolution (CCSR),allows flexible use of different diffusion steps in the inference stage without re-training. Extensive experiments show that with 2 or even 1 diffusion step, CCSR can significantly improve the content consistency of SR outputs while keeping high perceptual quality. Codes and models can be found at \href{https://github.com/csslc/CCSR}{https://github.com/csslc/CCSR}.

For agents

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

get_harvested_code_for_paper("2401.00877")
get_code_for_paper("2401.00877")
have("2401.00877")

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

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

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

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

Connect an agent — have() is free.