SYNTOLOGY HomeExplorerAtlasCodeMethodologyAboutDevelopersFeedPricing
Paper · 2508.04122 · ICCV · 2025

Conditional Latent Diffusion Models for Zero-Shot Instance Segmentation

Rudolph Triebel, Maximilian Ulmer, Wout Boerdijk, Maximilian Durner

arXiv · PDF · Open in the Atlas

Code that ran

17 of 27 samples (functions and classes) lifted from this paper's linked repositories executed on a synthesized input in Syntology's jail (11 of them constructed an object rather than computing a result; 1 honoured the contract we drafted, 0 violated it and 13 have no contract verdict; 3 failures of our instrument; 10 no recorded run), measured 2026-11-24; 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/2508.04122.json · badge: /api/ran/2508.04122.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
DLR-RM/oc-dit community
Papers with Code archive
17 ran · 10 no recorded run
FunctionStatusWhere it lives
AttentionBlock Ran
ran on a synthesized input
DLR-RM/oc-dit/ocdit/models/ocdit.py
code served (permissive licence) · get_code("eafa76c0c20fd332")
How it ran

Ran in Syntology's sandbox on this synthesized input (drafted by a language model, class construct-then-call prompt, model not recorded) and returned Tensor, ndim 4, 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

INIT_ARGS = {
    'in_channels': 4,
    'num_heads': 2,
    'num_groups': 2,
}

ARGS = {
    'x': torch.randn(2, 4, 3, 5),
}

if __name__ == '__main__':
    block = nn.AttentionBlock(**INIT_ARGS)
    output = block(**ARGS)
    print(f"Input shape: {ARGS['x'].shape}")
    print(f"Output shape: {output.shape}")
    print("Success!")
Setup block drafted by
a language model, class construct-then-call prompt, model not recorded
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 — no output shape is stated: observe_signature.py observed this class with its constructor sizes canonicalised where it could, which the node does not record, so its shape is not stated as this setup block's
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: torch and numpy seeded to 0 by the harness immediately before the class was constructed from INIT_ARGS (fixture_check.py)
Decoder Ran
ran on a synthesized input · constructed an object; no result was computed
DLR-RM/oc-dit/ocdit/models/ocdit.py
code served (permissive licence) · get_code("15a7e196aa046c4e")
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 an instance of its own class, Decoder: the run constructed the object and did not call it, so no result was computed. 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)

ARGS = {
    "in_channels": 1,
    "num_channels": [256, 256, 128, 64],
    "out_channels": 256,
    "attn_resolutions": [0, 1],
    "num_groups": 16,
    "num_resolution_blocks": 1,
    "downsample_with_conv": True,
    "block_type": "resnet",
}
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 Decoder — the run constructed an instance of its own class and did not call it; no shape is stated — the instrument coerces any output to an array; for a Decoder 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
DiagonalGaussianDistribution Ran
ran on a synthesized input · constructed an object; no result was computed
DLR-RM/oc-dit/ocdit/models/ocdit.py
code served (permissive licence) · get_code("d80e85e8ef446930")
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 an instance of its own class, DiagonalGaussianDistribution: the run constructed the object and did not call it, so no result was computed. 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 numpy as np

torch.manual_seed(0)

# Create a parameters tensor with shape (batch=2, channels=8, height=4, width=3)
# This will be split into mean and logvar, each (batch=2, channels=4, height=4, width=3)
parameters = torch.randn(2, 8, 4, 3)

ARGS = {
    "parameters": parameters,
    "chunk_dim": 1,
    "deterministic": False,
}
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 DiagonalGaussianDistribution — the run constructed an instance of its own class and did not call it; no shape is stated — the instrument coerces any output to an array; for a DiagonalGaussianDistribution 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
Encoder Ran
ran on a synthesized input · constructed an object; no result was computed
DLR-RM/oc-dit/ocdit/models/ocdit.py
code served (permissive licence) · get_code("24d82a7111803899")
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 an instance of its own class, Encoder: the run constructed the object and did not call it, so no result was computed. 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)

ARGS = {
    'in_channels': 1,
    'num_channels': [32, 64, 128, 256],
    'out_channels': 256,
    'num_groups': 16,
    'num_resolution_blocks': 1,
    'downsample_with_conv': True,
    'block_type': 'resnet',
    'attn_resolutions': [-1]
}
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 Encoder — the run constructed an instance of its own class and did not call it; no shape is stated — the instrument coerces any output to an array; for a Encoder 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
Im2Patches Ran
ran on a synthesized input · constructed an object; no result was computed
DLR-RM/oc-dit/ocdit/models/ocdit.py
code served (permissive licence) · get_code("e7b6a47f39350dd7")
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 an instance of its own class, Im2Patches: the run constructed the object and did not call it, so no result was computed. 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 Im2Patches module takes a patch_size parameter
# The forward method expects a tensor x of shape (batch, channels, height, width)
# For patch_size > 1, height and width must be divisible by patch_size

patch_size = 2
batch_size = 2
channels = 4
height = 8  # divisible by patch_size (2)
width = 6   # divisible by patch_size (2)

# Create a sample input tensor
x = torch.randn(batch_size, channels, height, width)

ARGS = {
    "patch_size": patch_size,
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
einops, torch — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type Im2Patches — the run constructed an instance of its own class and did not call it; no shape is stated — the instrument coerces any output to an array; for a Im2Patches 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
LinearHead Ran
ran on a synthesized input · constructed an object; no result was computed
DLR-RM/oc-dit/ocdit/models/ocdit.py
code served (permissive licence) · get_code("07ad9aa01961417f")
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 an instance of its own class, LinearHead: the run constructed the object and did not call it, so no result was computed. 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 einops import rearrange

torch.manual_seed(0)

# Define minimal act_layer and norm_layer if needed
act_layer = nn.GELU
norm_layer = nn.LayerNorm

# Construct ARGS dict
ARGS = {
    "in_channels": 4,
    "hidden_size": 8,
    "num_layers": 2,
    "out_channels": 3,
    "t_embed_dim": 16,
    "act_layer": act_layer,
    "norm_layer": norm_layer,
    "num_patches": 4,
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
einops, torch — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type LinearHead — the run constructed an instance of its own class and did not call it; no shape is stated — the instrument coerces any output to an array; for a LinearHead 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
MPFourier Ran
ran on a synthesized input · constructed an object; no result was computed
DLR-RM/oc-dit/ocdit/models/ocdit.py
code served (permissive licence) · get_code("383b715200d4d8ed")
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 an instance of its own class, MPFourier: the run constructed the object and did not call it, so no result was computed. 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 numpy as np

torch.manual_seed(0)

ARGS = {
    'num_channels': 4,
    'bandwidth': 1
}
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 MPFourier — the run constructed an instance of its own class and did not call it; no shape is stated — the instrument coerces any output to an array; for a MPFourier 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
Precond Ran
ran on a synthesized input · constructed an object; no result was computed
DLR-RM/oc-dit/ocdit/models/ocdit.py
code served (permissive licence) · get_code("8bcc16a0c920bad2")
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 an instance of its own class, Precond: the run constructed the object and did not call it, so no result was computed. 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 numpy as np

torch.manual_seed(0)

ARGS = {
    'P_mean': 0.0,
    'P_std': 1.0,
    'sigma_data': 1.0,
    'sigma_min': 0.002,
    'sigma_max': 80.0,
    'dist': 'normal'
}
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 Precond — the run constructed an instance of its own class and did not call it; no shape is stated — the instrument coerces any output to an array; for a Precond 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
QueryEmbedder Ran
ran on a synthesized input · constructed an object; no result was computed
DLR-RM/oc-dit/ocdit/models/ocdit.py
code served (permissive licence) · get_code("37ad79bf4576aaaf")
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 an instance of its own class, QueryEmbedder: the run constructed the object and did not call it, so no result was computed. 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 timm.layers.patch_embed import PatchEmbed

torch.manual_seed(0)

ARGS = {
    "input_dims": (16, 20),
    "feature_dim": 3,
    "patch_size": 4,
    "max_num_classes": 5,
    "embed_dim": 8,
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
einops, timm, torch — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type QueryEmbedder — the run constructed an instance of its own class and did not call it; no shape is stated — the instrument coerces any output to an array; for a QueryEmbedder 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
ResnetBlock Ran
ran on a synthesized input
DLR-RM/oc-dit/ocdit/models/ocdit.py
code served (permissive licence) · get_code("4133e1b6ce61f735")
How it ran

Ran in Syntology's sandbox on this synthesized input (drafted by a language model, class construct-then-call prompt, model not recorded) and returned Tensor, ndim 4, 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

# INIT_ARGS for ResnetBlock.__init__
INIT_ARGS = {
    'in_channels': 8,
    'out_channels': 12,
    'num_groups': 4
}

# ARGS for ResnetBlock.forward
ARGS = {
    'x': torch.randn(2, 8, 16, 16)  # batch=2, channels=8 (matches in_channels), height=16, width=16
}
Setup block drafted by
a language model, class construct-then-call prompt, model not recorded
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 — no output shape is stated: observe_signature.py observed this class with its constructor sizes canonicalised where it could, which the node does not record, so its shape is not stated as this setup block's
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: torch and numpy seeded to 0 by the harness immediately before the class was constructed from INIT_ARGS (fixture_check.py)
SigmaEmbedder Ran
ran on a synthesized input · constructed an object; no result was computed
DLR-RM/oc-dit/ocdit/models/ocdit.py
code served (permissive licence) · get_code("e797dbab69786e36")
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 an instance of its own class, SigmaEmbedder: the run constructed the object and did not call it, so no result was computed. 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
import numpy as np

torch.manual_seed(0)

ARGS = {
    'hidden_size': 4
}
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 SigmaEmbedder — the run constructed an instance of its own class and did not call it; no shape is stated — the instrument coerces any output to an array; for a SigmaEmbedder 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
SpatialDinov2 Ran
ran on a synthesized input · constructed an object; no result was computed
DLR-RM/oc-dit/ocdit/models/ocdit.py
code served (permissive licence) · get_code("484e7664b84b8858")
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 an instance of its own class, SpatialDinov2: the run constructed the object and did not call it, so no result was computed. 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)

# Mock DINOv2 model to avoid downloading from hub
class MockDinov2Model(nn.Module):
    def __init__(self):
        super().__init__()
        self.embed_dim = 384
        self.patch_size = 14
        self.linear = nn.Linear(384, 384)
    
    def forward_features(self, x):
        # x is (B, C, H, W)
        B, C, H, W = x.shape
        # Simulate patch tokens: (B, num_patches, embed_dim)
        # For image H x W with patch_size 14: num_patches = (H//14) * (W//14)
        num_patches = (H // 14) * (W // 14)
        x_norm_patchtokens = torch.randn(B, num_patches, self.embed_dim)
        return {'x_norm_patchtokens': x_norm_patchtokens}
    
    def parameters(self):
        return self.linear.parameters()

# Monkey-patch torch.hub.load to return our mock model
_original_hub_load = torch.hub.load
def mock_hub_load(repo, model_type):
    return MockDinov2Model()

torch.hub.load = mock_hub_load

# Create sample input tensor
# Using distinct dimensions: batch=2, channels=3, height=28, width=42
sample_input = torch.randn(2, 3, 28, 42)

ARGS = {
    'freeze_weights': True,
    'model_type': 'dinov2_vits14'
}
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 SpatialDinov2 — the run constructed an instance of its own class and did not call it; no shape is stated — the instrument coerces any output to an array; for a SpatialDinov2 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
VAEBase Ran
ran on a synthesized input · constructed an object; no result was computed
DLR-RM/oc-dit/ocdit/models/ocdit.py
code served (permissive licence) · get_code("e4693f5b9a30784c")
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 an instance of its own class, VAEBase: the run constructed the object and did not call it, so no result was computed. 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 SimpleEncoder(nn.Module):
    def __init__(self):
        super().__init__()
        self.fc = nn.Linear(4, 8)
    
    def forward(self, x):
        return self.fc(x)

class SimpleDecoder(nn.Module):
    def __init__(self):
        super().__init__()
        self.fc = nn.Linear(8, 4)
    
    def forward(self, z):
        return self.fc(z)

class ConcreteVAE(nn.Module):
    def __init__(self):
        super().__init__()
        self.encoder = SimpleEncoder()
        self.decoder = SimpleDecoder()
    
    def encode(self, x):
        return self.encoder(x)
    
    def decode(self, z):
        return self.decoder(z)
    
    def forward(self, x, sample_posterior=True):
        z = self.encode(x)
        recon = self.decode(z)
        return recon

vae_instance = ConcreteVAE()

ARGS = {
}
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 VAEBase — the run constructed an instance of its own class and did not call it; no shape is stated — the instrument coerces any output to an array; for a VAEBase 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
class_embedding Ran
ran; our contract draft was wrong, not the code
DLR-RM/oc-dit/ocdit/models/ocdit.py
code served (permissive licence) · get_code("c8dd2041dbc05edb")
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, 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

torch.manual_seed(0)

# The function uses:
# - embedding: torch.Tensor with shape allowing indexing [:, start_index:start_index + current_num_classes]
# - max_num_classes: int used in randint upper bound calculation
# - current_num_classes: int used in randint upper bound calculation and slicing

# Create a small embedding tensor with shape (batch_size, num_embedding_dims)
# where num_embedding_dims >= max_num_classes so we can slice it
embedding = torch.randn(2, 10)  # shape: (2, 10) - batch=2, embedding_dim=10

# Set max_num_classes and current_num_classes such that:
# max_num_classes - current_num_classes > 0 (for randint to work)
# max_num_classes <= embedding.shape[1] (so we can slice the embedding)
max_num_classes = 8
current_num_classes = 3

ARGS = {
    "embedding": embedding,
    "max_num_classes": max_num_classes,
    "current_num_classes": current_num_classes,
}
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, 3) — shape (2, 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
const_like Ran
ran; our contract draft was wrong, not the code
DLR-RM/oc-dit/ocdit/models/ocdit.py
code served (permissive licence) · get_code("e0234040a8a9647a")
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 0, dtype family float, shape () 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)

# Create a reference tensor with specific dtype and device
ref = torch.tensor([[1.0, 2.0, 3.0, 4.0], [5.0, 6.0, 7.0, 8.0]], dtype=torch.float32, device=torch.device('cpu'))

ARGS = {
    'ref': ref,
    'value': 5.0,
    'shape': None,
    'dtype': None,
    'device': None,
    'memory_format': None
}
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 0, dtype family float, shape () — shape () 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
constant Ran
ran; our contract draft was wrong, not the code
DLR-RM/oc-dit/ocdit/models/ocdit.py
code served (permissive licence) · get_code("2c37e8b70c375691")
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 numpy as np

torch.manual_seed(0)

# Build arguments for the constant function
ARGS = {
    "value": np.array([1.0, 2.0, 3.0, 4.0]),
    "shape": (2, 4),
    "dtype": torch.float32,
    "device": torch.device('cpu'),
    "memory_format": torch.contiguous_format
}
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 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
truncated_exp_normal_dist Ran
ran, honoured the contract we drafted
DLR-RM/oc-dit/ocdit/models/ocdit.py
code served (permissive licence) · get_code("b6c750834f79e3b8")
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 1, dtype family float, shape (2,) 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 torch.distributions import normal

torch.manual_seed(0)

ARGS = {
    "mean": 0.5,
    "std": 0.2,
    "min": 0.1,
    "max": 10.0,
    "size": 2,
    "device": torch.device("cpu")
}
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 1, dtype family float, shape (2,) — shape (2,) 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
BinaryMaskVAE Not yet run
unverified (harvested, no recorded run)
DLR-RM/oc-dit/ocdit/models/ocdit.py
code served (permissive licence) · get_code("b4c1345835c30b60")
How it ran

no invocation recorded.

ConvVAE Not yet run
unverified (harvested, no recorded run)
DLR-RM/oc-dit/ocdit/models/ocdit.py
code served (permissive licence) · get_code("f21803b24807d1e7")
How it ran

no invocation recorded.

Diffuser Not yet run
unverified (harvested, no recorded run)
DLR-RM/oc-dit/ocdit/models/ocdit.py
code served (permissive licence) · get_code("ba66bd201ef00911")
How it ran

no invocation recorded.

LearnedPE Not yet run
unverified (harvested, no recorded run)
DLR-RM/oc-dit/ocdit/models/ocdit.py
code served (permissive licence) · get_code("b9938539c873efb9")
How it ran

no invocation recorded.

MasksVAE Not yet run
unverified (harvested, no recorded run)
DLR-RM/oc-dit/ocdit/models/ocdit.py
code served (permissive licence) · get_code("92feacbd0beecfcc")
How it ran

no invocation recorded.

OCDiT Not yet run
unverified (harvested, no recorded run)
DLR-RM/oc-dit/ocdit/models/ocdit.py
code served (permissive licence) · get_code("7aef5fbb74bb6430")
How it ran

no invocation recorded.

TemplateEmbedder Not yet run
unverified (harvested, no recorded run)
DLR-RM/oc-dit/ocdit/models/ocdit.py
code served (permissive licence) · get_code("a0cec32f8c908525")
How it ran

no invocation recorded.

interpolate_embedding Not yet run
unverified (harvested, no recorded run)
DLR-RM/oc-dit/ocdit/models/ocdit.py
code served (permissive licence) · get_code("a6dd37ac0f1c31d6")
How it ran

no invocation recorded.

make_attn Not yet run
unverified (harvested, no recorded run)
DLR-RM/oc-dit/ocdit/models/ocdit.py
code served (permissive licence) · get_code("7e141c9d5b330940")
How it ran

no invocation recorded.

make_block Not yet run
unverified (harvested, no recorded run)
DLR-RM/oc-dit/ocdit/models/ocdit.py
code served (permissive licence) · get_code("0c698990d9ca3c06")
How it ran

no invocation recorded.

Also present in other papers' code

Of 27 samples lifted from this paper's linked repositories, 27 carry a function identity and 0 do not. Of the 27 distinct functions with an identity, 2 are also present in other papers whose code we hold (2 with at least one paper dated earlier, 0 the same month, 2 later) and 25 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
constant
brick of this paper's assembly: helper
26 other papers
18 dated earlier, 7 later, 1 same year, order not determinable
2306.06991 (2023-06)
Fast Diffusion Model
2308.15321 (2023-08)
Elucidating the Exposure Bias in Diffusion Models
2309.03350 (2023-09)
Relay Diffusion: Unifying diffusion process across resolutions for image synthesis
and 23 more not named here
const_like
brick of this paper's assembly: helper
5 other papers
2 dated earlier, 2 later, 1 same year, order not determinable
Xia_Rectified_Diffusion_Guidance_for_Conditional_Generation_CVPR_2025_paper (2025 (year only))
Rectified Diffusion Guidance for Conditional Generation
2505.07447 (2025-05)
Unified Continuous Generative Models
2506.14605 (2025-06)
Unsupervised Imaging Inverse Problems with Diffusion Distribution Matching
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-24.

Repositories linked to this paper

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

Abstract

This paper presents Object-Conditioned Diffusion Transformer (OC-DiT), a novel class of diffusion models designed for object-centric prediction, and applies it to zeroshot instance segmentation. We propose a conditional latent diffusion framework that generates instance masks by conditioning the generative process on object templates and image features within the diffusion model's latent space. This allows our model to effectively disentangle object instances through the diffusion process, which is guided by visual object descriptors and localized image cues. Specifically, we introduce two model variants: a coarse model for generating initial object instance proposals, and a refinement model that refines all proposals in parallel. We train these models on a newly created, large-scale synthetic dataset comprising thousands of high-quality object meshes. Remarkably, our model achieves state-of-the-art performance on multiple challenging real-world benchmarks, without requiring any retraining on target data. Through comprehensive ablation studies, we demonstrate the potential of diffusion models for instance segmentation tasks. Code is available at https://github.com/DLR-RM/oc-dit.

For agents

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

get_harvested_code_for_paper("2508.04122")
get_code_for_paper("2508.04122")
have("2508.04122")

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

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

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

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

Connect an agent — have() is free.