SYNTOLOGY HomeExplorerAtlasCodeMethodologyAboutDevelopersFeedPricing
Paper · 2405.07510 · 2024

PeRFlow: Piecewise Rectified Flow as Universal Plug-and-Play Accelerator

arXiv · PDF · Open in the Atlas

Code that ran

7 of 8 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; 1 honoured the contract we drafted, 0 violated it and 0 have no contract verdict; 6 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/2405.07510.json · badge: /api/ran/2405.07510.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
magic-research/piecewise-rectified-flow canonical (classifier label)
classifier basis: census
7 ran · 1 no recorded run
FunctionStatusWhere it lives
betas_for_alpha_bar Ran
ran, honoured the contract we drafted
magic-research/piecewise-rectified-flow/src/scheduler_perflow.py
pointer only (licence: BSD-3-Clause); the stored copy get_code serves, from jabir-zheng/TCD, is pointer only (licence: NONE) · get_code("f1e3f7493aad4745")
How it ran

The body of this sample is withheld: this paper's link allows the body inline (BSD-3-Clause), but get_code serves the stored copy, first harvested from jabir-zheng/TCD, 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.

collate_fn Ran
ran; our contract draft was wrong, not the code
magic-research/piecewise-rectified-flow/app/IP-Adapter-main/_archive_/tutorial_train.py
pointer only (licence: BSD-3-Clause); the stored copy get_code serves, from yepengliu/ctrlregen, is pointer only (licence: NONE) · get_code("01c0e92550c3a1ca")
How it ran

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

collate_fn Ran
ran; our contract draft was wrong, not the code
magic-research/piecewise-rectified-flow/app/IP-Adapter-main/_archive_/tutorial_train_faceid.py
code served (permissive licence) · get_code("1e0487828d53d63e")
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 dict. 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

torch.manual_seed(0)

# Construct example data items that match the expected structure
example_1 = {
    'image': torch.randn(3, 4, 4),  # 3-channel image, 4x4 spatial
    'text_input_ids': torch.randint(0, 100, (5,)),  # 5 tokens
    'face_id_embed': torch.randn(7,),  # 7-dim face embedding
    'drop_image_embed': False
}

example_2 = {
    'image': torch.randn(3, 4, 4),  # 3-channel image, 4x4 spatial
    'text_input_ids': torch.randint(0, 100, (6,)),  # 6 tokens
    'face_id_embed': torch.randn(7,),  # 7-dim face embedding
    'drop_image_embed': True
}

data = [example_1, example_2]

ARGS = {
    'data': data
}
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 dict — a dict output has no array shape of its own; none is stated — the instrument coerces any output to an array; for a dict 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
merge_delta_weights_into_unet Ran
ran; our contract draft was wrong, not the code
magic-research/piecewise-rectified-flow/src/utils_perflow.py
code served (permissive licence) · get_code("f60d2297047fbe6e")
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 SimplePipe. 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 SimpleUNet(nn.Module):
    def __init__(self):
        super().__init__()
        self.conv1 = nn.Conv2d(3, 4, 3)
        self.conv2 = nn.Conv2d(4, 8, 3)
    
    def forward(self, x):
        return self.conv2(self.conv1(x))

class SimplePipe:
    def __init__(self):
        self.unet = SimpleUNet()

# Create a pipe with a simple UNet
pipe = SimplePipe()

# Create delta_weights with the same keys as the unet state_dict
# but with potentially different dtypes
unet_state = pipe.unet.state_dict()
delta_weights = {}

for key in unet_state.keys():
    # Create delta weights with same shape as original weights
    original_shape = unet_state[key].shape
    # Use float32 for deltas (different from potential original dtype)
    delta_weights[key] = torch.randn(original_shape, dtype=torch.float32)

ARGS = {
    "pipe": pipe,
    "delta_weights": delta_weights
}
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 SimplePipe — a SimplePipe output has no array shape of its own; none is stated — the instrument coerces any output to an array; for a SimplePipe 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
resize_for_condition_image Ran
ran; our contract draft was wrong, not the code
magic-research/piecewise-rectified-flow/app/replicate_api/predict.py
code served (permissive licence) · get_code("fb98a03fa1c6a2d9")
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 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
import numpy as np

# Create a small test image
# The function uses: input_image.convert('RGB'), input_image.size, input_image.resize()
# These are standard PIL Image methods
img_array = np.random.randint(0, 256, (100, 150, 3), dtype=np.uint8)
input_image = Image.fromarray(img_array, mode='RGB')

ARGS = {
    'input_image': input_image,
    'resolution': 512
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
PIL, numpy — 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
save_image Ran
ran; our contract draft was wrong, not the code
magic-research/piecewise-rectified-flow/app/Wonder3D/gradio_app_mv.py
code served (permissive licence) · get_code("f426c133571857ae")
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 ndarray, ndim 3, dtype family int, shape (4, 5, 3) 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
from PIL import Image

torch.manual_seed(0)

# The function expects a tensor with shape (C, H, W) where:
# - C is the number of channels (3 for RGB)
# - H is height
# - W is width
# The tensor values should be in [0, 1] range for typical image data
tensor = torch.rand(3, 4, 5)  # 3 channels, 4 height, 5 width

ARGS = {
    "tensor": tensor
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
PIL, torch — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type ndarray, ndim 3, dtype family int, shape (4, 5, 3) — shape (4, 5, 3) 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
save_image_to_disk Ran
ran; our contract draft was wrong, not the code
magic-research/piecewise-rectified-flow/app/Wonder3D/gradio_app_mv.py
code served (permissive licence) · get_code("875303a4e4ca2140")
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 ndarray, ndim 3, dtype family int, shape (4, 5, 3) 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
from tempfile import NamedTemporaryFile
import os

torch.manual_seed(0)

# Create a valid image tensor with shape (C, H, W)
# Values should be in [0, 1] range for typical image tensors
tensor = torch.rand(3, 4, 5)

# Create a temporary file path for saving
temp_file = NamedTemporaryFile(delete=False, suffix='.png')
fp = temp_file.name
temp_file.close()

# Clean up the file so save_image_to_disk can create it
os.unlink(fp)

ARGS = {
    'tensor': tensor,
    'fp': fp
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
PIL, torch — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type ndarray, ndim 3, dtype family int, shape (4, 5, 3) — shape (4, 5, 3) 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
sam_segment Not yet run
unverified (harvested, no recorded run)
magic-research/piecewise-rectified-flow/app/Wonder3D/gradio_app_mv.py
code served (permissive licence) · get_code("363075ab074e4164")
How it ran

no invocation recorded.

Also present in other papers' code

Of 8 samples lifted from this paper's linked repositories, 8 carry a function identity and 0 do not. Of the 8 distinct functions with an identity, 5 are also present in other papers whose code we hold (4 with at least one paper dated earlier, 1 the same month, 3 later) and 3 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
betas_for_alpha_bar 14 other papers
6 dated earlier, 1 the same month, 6 later, 1 same year, order not determinable
2303.01469 (2023-03)
Consistency Models
2311.15908 (2023-11)
Enhancing Perceptual Quality in Video Super-Resolution through Temporally-Consistent Detail Synthesis using Diffusion Models
2311.18832 (2023-11)
Exploiting Diffusion Prior for Generalizable Dense Prediction
and 11 more not named here
collate_fn 2 other papers
1 dated earlier, 1 later
2308.06721 (2023-08)
IP-Adapter: Text Compatible Image Prompt Adapter for Text-to-Image Diffusion Models
2410.05470 (2024-10)
Image Watermarks are Removable Using Controllable Regeneration from Clean Noise
collate_fn 1 other paper
1 dated earlier
2308.06721 (2023-08)
IP-Adapter: Text Compatible Image Prompt Adapter for Text-to-Image Diffusion Models
resize_for_condition_image 1 other paper
1 later
2504.15835 (2025-04)
Text-based Animatable 3D Avatars with Morphable Model Alignment
sam_segment 1 other paper
1 dated earlier
2310.15110 (2023-10)
Zero123++: a Single Image to Consistent Multi-view Diffusion Base Model

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

We present Piecewise Rectified Flow (PeRFlow), a flow-based method for accelerating diffusion models. PeRFlow divides the sampling process of generative flows into several time windows and straightens the trajectories in each interval via the reflow operation, thereby approaching piecewise linear flows. PeRFlow achieves superior performance in a few-step generation. Moreover, through dedicated parameterizations, the PeRFlow models inherit knowledge from the pretrained diffusion models. Thus, the training converges fast and the obtained models show advantageous transfer ability, serving as universal plug-and-play accelerators that are compatible with various workflows based on the pre-trained diffusion models. Codes for training and inference are publicly released. https://github.com/magic-research/piecewise-rectified-flow

For agents

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

get_harvested_code_for_paper("2405.07510")
get_code_for_paper("2405.07510")
have("2405.07510")

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

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

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

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

Connect an agent — have() is free.