SYNTOLOGY HomeExplorerAtlasCodeMethodologyAboutDevelopersFeedPricing
Paper · 2409.19681 · NeurIPS · 2024

Simple and Fast Distillation of Diffusion Models

Can Wang, Siwei Lyu, Chun Chen, Defang Chen, Zhenyu Zhou

arXiv · PDF · Open in the Atlas

Code that ran

5 of 6 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; 0 honoured the contract we drafted, 0 violated it and 0 have no contract verdict; 5 failures of our instrument; 1 no recorded run), 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/2409.19681.json · badge: /api/ran/2409.19681.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
zju-pi/diff-sampler canonical (classifier label)
classifier basis: classifier_2025
2 ran · 0 no recorded run
zhyzhouu/amed-solver community
Papers with Code archive
2 ran · 1 no recorded run
copy not recorded community
not in the paper's declared repositories
1 ran · 0 no recorded run
FunctionStatusWhere it lives
euler_sampler Ran
ran; our contract draft was wrong, not the code
zju-pi/diff-sampler/sfd-main/solvers.py
code served (permissive licence) · get_code("bcfd14b3703839b8")
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 Tensor, ndim 2, 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
import torch.nn as nn

torch.manual_seed(0)

# Build a minimal net that satisfies the function's usage
class MinimalDiffusionNet(nn.Module):
    def __init__(self):
        super().__init__()
        self.linear = nn.Linear(4, 4)
        self.guidance_type = "unconditional"
    
    def forward(self, x, t, class_labels=None, condition=None, unconditional_condition=None, step_condition=None):
        # x shape: (batch, 4), t shape: scalar or (batch,)
        # Return denoised sample of same shape as x
        return self.linear(x)

# Build a minimal get_schedule function (needed by euler_sampler)
def get_schedule(num_steps, sigma_min, sigma_max, device, schedule_type='polynomial', schedule_rho=7, net=None):
    # Return a schedule of time steps
    if schedule_type == 'polynomial':
        steps = torch.linspace(0, 1, num_steps, device=device) ** (1 / schedule_rho)
        t_steps = sigma_min + (sigma_max - sigma_min) * (1 - steps)
    else:
        t_steps = torch.linspace(sigma_max, sigma_min, num_steps, device=device)
    return t_steps

# Inject get_schedule into the module namespace
import sys
current_module = sys.modules[__name__]
current_module.get_schedule = get_schedule

# Create instances
net = MinimalDiffusionNet()
latents = torch.randn(2, 4)  # batch_size=2, dim=4
class_labels = torch.randint(0, 10, (2,))
condition = torch.randn(2, 8)
unconditional_condition = torch.randn(2, 8)
step_condition = torch.randn(2, 4)

ARGS = {
    'net': net,
    'latents': latents,
    'class_labels': class_labels,
    'condition': condition,
    'unconditional_condition': unconditional_condition,
    'randn_like': torch.randn_like,
    'num_steps': 4,
    'sigma_min': 0.002,
    'sigma_max': 80,
    'schedule_type': 'polynomial',
    'schedule_rho': 7,
    'afs': False,
    'denoise_to_zero': False,
    'return_inters': False,
    'return_eps': False,
    'train': False,
    'step_idx': None,
    'step_condition': step_condition,
    't_steps': None,
}
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 Tensor, ndim 2, dtype family float — no output shape is stated: observe_signature.py could not observe it (fixture:KeyError)
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_amed_prediction Ran
ran; the contract check could not run (RAISES, DEP_MISSING or TIMEOUT)
zhyzhouu/amed-solver/amed-solver-main/solvers_amed.py
code served (permissive licence) · get_code("f9e91ce2a9928924")
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 5, 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
import torch.nn as nn

torch.manual_seed(0)

# Create a minimal AMED_predictor that returns outputs
class MinimalAMEDPredictor(nn.Module):
    def __init__(self, output_type='three'):
        super().__init__()
        self.scale_time = True
        self.output_type = output_type
        self.linear = nn.Linear(64, 1)
    
    def forward(self, unet_enc, t_cur, t_next):
        batch_size = unet_enc.shape[0]
        if self.output_type == 'three':
            # Return r, scale_dir, scale_time
            r = torch.randn(batch_size)
            scale_dir = torch.randn(batch_size)
            scale_time = torch.randn(batch_size)
            return r, scale_dir, scale_time
        elif self.output_type == 'two':
            # Return r, scale_time
            r = torch.randn(batch_size)
            scale_time = torch.randn(batch_size)
            return r, scale_time
        else:
            # Return just r
            r = torch.randn(batch_size)
            return r

# Create a minimal net with guidance_type attribute
class MinimalNet(nn.Module):
    def __init__(self, guidance_type=None):
        super().__init__()
        self.guidance_type = guidance_type
        self.linear = nn.Linear(10, 10)
    
    def forward(self, x):
        return self.linear(x)

# Test case 1: classifier-free guidance
batch_size = 2
AMED_predictor = MinimalAMEDPredictor(output_type='three')
t_cur = torch.tensor([0.5], dtype=torch.float32)
t_next = torch.tensor([0.6], dtype=torch.float32)
net = MinimalNet(guidance_type='classifier-free')
# unet_enc_out should be a list with at least one element, where the last element has shape (4, 3, 8, 8)
# for classifier-free with batch_size=2, we expect (2*batch_size, 3, 8, 8)
unet_enc_out = [torch.randn(4, 3, 8, 8)]
use_afs = False

ARGS = {
    'AMED_predictor': AMED_predictor,
    't_cur': t_cur,
    't_next': t_next,
    'net': net,
    'unet_enc_out': unet_enc_out,
    'use_afs': use_afs,
    'batch_size': batch_size,
}
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 tuple, ndim 5, 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
get_denoised Ran
ran; our contract draft was wrong, not the code
this paper's copy was not recorded; identical code first harvested from onefly123/pas
pointer only · get_code("3eed7631aeebeabc")
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.

get_denoised Ran
ran; our contract draft was wrong, not the code
zju-pi/diff-sampler/sfd-main/solvers.py
code served (permissive licence) · get_code("4c1d07c9d92262b9")
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 2, dtype family float, shape (2, 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 torch.nn as nn

torch.manual_seed(0)

# Create a mock network with guidance_type attribute
class MockNetWithGuidance(nn.Module):
    def __init__(self):
        super().__init__()
        self.guidance_type = "classifier-free"
        self.linear = nn.Linear(4, 4)
    
    def forward(self, x, t, class_labels=None, condition=None, unconditional_condition=None, step_condition=None):
        # Simple mock implementation
        return self.linear(x)

# Create a mock network without guidance_type
class MockNetWithoutGuidance(nn.Module):
    def __init__(self):
        super().__init__()
        self.linear = nn.Linear(4, 4)
    
    def forward(self, x, t, class_labels=None, step_condition=None):
        # Simple mock implementation
        return self.linear(x)

# Instantiate the network with guidance_type
net = MockNetWithGuidance()

# Create tensors
x = torch.randn(2, 4)  # batch_size=2, feature_dim=4
t = torch.tensor([10, 20])  # timesteps for batch

# Optional parameters
class_labels = torch.tensor([0, 1])  # class labels for batch
condition = torch.randn(2, 3)  # condition tensor with different dim
unconditional_condition = torch.randn(2, 3)  # unconditional condition
step_condition = torch.randn(2, 5)  # step-specific condition with yet another dim

ARGS = {
    "net": net,
    "x": x,
    "t": t,
    "class_labels": class_labels,
    "condition": condition,
    "unconditional_condition": unconditional_condition,
    "step_condition": step_condition,
}
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 2, dtype family float, shape (2, 4) — shape (2, 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
init_hook Ran
ran; our contract draft was wrong, not the code
zhyzhouu/amed-solver/amed-solver-main/solvers_amed.py
code served (permissive licence) · get_code("3109a1d3fe7e3fdb")
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. 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)

class DiffusionModel(nn.Module):
    def __init__(self):
        super().__init__()
        self.middle_block = nn.Linear(4, 4)
    
    def forward(self, x):
        return self.middle_block(x)

class GuidanceNet(nn.Module):
    def __init__(self):
        super().__init__()
        self.guidance_type = "classifier_free"
        self.model = nn.Module()
        self.model.model = nn.Module()
        self.model.model.diffusion_model = DiffusionModel()
    
    def forward(self, x):
        return self.model.model.diffusion_model(x)

class SimpleNet256(nn.Module):
    def __init__(self):
        super().__init__()
        self.img_resolution = 256
        self.model = nn.Module()
        self.model.middle_block = nn.Linear(4, 4)
    
    def forward(self, x):
        return self.model.middle_block(x)

class ComplexNet(nn.Module):
    def __init__(self, with_class_labels=False):
        super().__init__()
        self.img_resolution = 512
        self.model = nn.Module()
        self.model.enc = nn.ModuleDict()
        block_name = '8x8_block2' if with_class_labels else '8x8_block3'
        self.model.enc[block_name] = nn.Linear(4, 4)
    
    def forward(self, x):
        return x

net_guidance = GuidanceNet()
net_256 = SimpleNet256()
net_complex = ComplexNet(with_class_labels=False)
net_complex_with_labels = ComplexNet(with_class_labels=True)

ARGS = {
    "net": net_guidance,
    "class_labels": None,
}
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 tuple — a tuple output has no array shape of its own; none is 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
amed_sampler Not yet run
unverified (harvested, no recorded run)
zhyzhouu/amed-solver/amed-solver-main/solvers_amed.py
code served (permissive licence) · get_code("2f7706b5bd63049d")
How it ran

no invocation recorded.

Also present in other papers' code

Of 6 samples lifted from this paper's linked repositories, 6 carry a function identity and 0 do not. Of the 6 distinct functions with an identity, 1 are also present in other papers whose code we hold (1 with at least one paper dated earlier, 0 the same month, 1 later) and 5 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
get_denoised
brick of this paper's assembly: model
5 other papers
2 dated earlier, 3 later · 2 only as an assembly brick
2206.00364 (2022-06)
Elucidating the Design Space of Diffusion-Based Generative Models
2312.00094 (2023-12)
Fast ODE-based Sampling for Diffusion Models in Around 5 Steps
2411.06503 (2024-11)
Diffusion Sampling Correction via Approximately 10 Parameters
and 2 more not named here

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-based generative models have demonstrated their powerful performance across various tasks, but this comes at a cost of the slow sampling speed. To achieve both efficient and high-quality synthesis, various distillation-based accelerated sampling methods have been developed recently. However, they generally require time-consuming fine tuning with elaborate designs to achieve satisfactory performance in a specific number of function evaluation (NFE), making them difficult to employ in practice. To address this issue, we propose Simple and Fast Distillation (SFD) of diffusion models, which simplifies the paradigm used in existing methods and largely shortens their fine-tuning time up to 1000×. We begin with a vanilla distillation-based sampling method and boost its performance to state of the art by identifying and addressing several small yet vital factors affecting the synthesis efficiency and quality. Our method can also achieve sampling with variable NFEs using a single distilled model. Extensive experiments demonstrate that SFD strikes a good balance between the sample quality and fine-tuning costs in few-step image generation task. For example, SFD achieves 4.53 FID (NFE=2) on CIFAR-10 with only 0.64 hours of fine-tuning on a single NVIDIA A100 GPU. Our code is available at https://github.com/zju-pi/diff-sampler. Recent years have witnessed significant progress in accelerating the sampling of diffusion mod-

For agents

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

get_harvested_code_for_paper("2409.19681")
get_code_for_paper("2409.19681")
have("2409.19681")

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

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

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

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

Connect an agent — have() is free.