SYNTOLOGY HomeExplorerAtlasCodeMethodologyAboutDevelopersFeedPricing
Paper · 2305.15581 · 2023

Unsupervised Semantic Correspondence Using Stable Diffusion

arXiv · PDF · Open in the Atlas

Code that ran

11 of 12 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, 1 violated it and 6 have no contract verdict; 3 failures of our instrument; 1 no recorded run), measured 2026-11-23; 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/2305.15581.json · badge: /api/ran/2305.15581.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
ubc-vision/LDM_correspondences canonical (classifier label)
classifier basis: census
11 ran · 1 no recorded run
FunctionStatusWhere it lives
boolean_string Ran
ran, violated the contract we drafted
ubc-vision/LDM_correspondences/utils/utils.py
pointer only (licence: Apache-2.0); the stored copy get_code serves, from PruneTruong/GOCor, is pointer only (licence: NOASSERTION) · get_code("b1f9cebf0d177140")
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 PruneTruong/GOCor, and GitHub could not classify the licence of that repository (NOASSERTION). 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.

diffusion_step Ran
ran on a synthesized input
ubc-vision/LDM_correspondences/utils/ptp_utils.py
code served (permissive licence) · get_code("a9127186bb55b3f4")
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)

class StandInUNet(nn.Module):
    def __init__(self):
        super().__init__()
        self.linear = nn.Linear(4, 4)
    
    def forward(self, latents, t, encoder_hidden_states):
        # latents: (batch, 4)
        # encoder_hidden_states: (batch, seq_len, hidden_dim)
        # Returns dict with 'sample' key containing noise prediction
        batch_size = latents.shape[0]
        noise = self.linear(latents)
        return {'sample': noise}

class StandInScheduler:
    def step(self, noise_pred, t, latents):
        # Returns dict with 'prev_sample' key
        # Just return a slightly perturbed version of latents
        return {'prev_sample': latents + 0.01 * noise_pred}

class StandInModel(nn.Module):
    def __init__(self):
        super().__init__()
        self.unet = StandInUNet()
        self.scheduler = StandInScheduler()

class StandInController:
    def step_callback(self, latents):
        # Just return latents as-is
        return latents

# Build arguments
model = StandInModel()
controller = StandInController()
latents = torch.randn(2, 4)
context = torch.randn(2, 7, 5)  # (batch, seq_len, hidden_dim)
t = torch.tensor([50])
guidance_scale = 7.5
cfg = True

ARGS = {
    'model': model,
    'controller': controller,
    'latents': latents,
    'context': context,
    't': t,
    'guidance_scale': guidance_scale,
    'cfg': cfg
}
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
find_knn Ran
ran on a synthesized input
ubc-vision/LDM_correspondences/eval/dataset.py
code served (permissive licence) · get_code("d743428e092c7a2d")
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 int, shape (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
import torch.nn as nn

torch.manual_seed(0)

# Create small tensor arguments for find_knn
# db_vectors: shape (num_db, embedding_dim)
# qr_vectors: shape (num_queries, embedding_dim)
db_vectors = torch.randn(2, 4)  # 2 database vectors, 4-dim embeddings
qr_vectors = torch.randn(3, 4)  # 3 query vectors, 4-dim embeddings

ARGS = {
    "db_vectors": db_vectors,
    "qr_vectors": qr_vectors,
}
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 int, shape (3,) — shape (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
get_confirm_token Ran
ran; our contract draft was wrong, not the code
ubc-vision/LDM_correspondences/eval/download.py
code served (permissive licence) · get_code("988fd31ae49fff76")
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 str. 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 sys
from unittest.mock import Mock

# Create a mock response object with cookies attribute
mock_response = Mock()

# Create a mock cookies dict-like object
mock_cookies = {}
mock_cookies['download_warning'] = 'test_token_value'
mock_cookies['other_cookie'] = 'other_value'

mock_response.cookies = mock_cookies

ARGS = {
    'response': mock_response
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
none outside the standard library — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type str — a str output has no array shape of its own; none is stated — the instrument coerces any output to an array; for a str 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
init_latent Ran
ran; our contract draft was wrong, not the code
ubc-vision/LDM_correspondences/utils/ptp_utils.py
code served (permissive licence) · get_code("caadc5c4b7627e0c")
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 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)

# Build a minimal model with a unet that has in_channels and device
class MinimalUNet(nn.Module):
    def __init__(self):
        super().__init__()
        self.in_channels = 4
        self.linear = nn.Linear(10, 10)  # dummy layer to have parameters
    
    def forward(self, x):
        return x

class MinimalModel(nn.Module):
    def __init__(self):
        super().__init__()
        self.unet = MinimalUNet()
        self.device = torch.device("cpu")
    
    def forward(self, x):
        return x

# Create instances
model = MinimalModel()
generator = torch.Generator()
generator.manual_seed(42)

# Parameters for init_latent
latent = None  # Will be generated inside the function
height = 32
width = 24
batch_size = 2

ARGS = {
    "latent": latent,
    "model": model,
    "height": height,
    "width": width,
    "generator": generator,
    "batch_size": batch_size,
}
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 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
latent2image Ran
ran; our contract draft was wrong, not the code
ubc-vision/LDM_correspondences/utils/ptp_utils.py
code served (permissive licence) · get_code("e3c3bb87bbe9b4a7")
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 ndarray, ndim 4, dtype family int, shape (2, 32, 32, 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
import torch.nn as nn
import numpy as np

torch.manual_seed(0)

class MockVAE(nn.Module):
    def __init__(self):
        super().__init__()
        self.decoder_layer = nn.Linear(4, 768)
    
    def decode(self, latents):
        # latents shape: (batch, channels, height, width)
        # We need to return a dict with 'sample' key containing decoded image
        batch_size = latents.shape[0]
        # Return a tensor of shape (batch, 3, 32, 32) for RGB image
        sample = torch.randn(batch_size, 3, 32, 32)
        return {'sample': sample}

vae = MockVAE()
latents = torch.randn(2, 4, 8, 8)

ARGS = {
    'vae': vae,
    'latents': latents
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1
Imports
numpy, torch — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type ndarray, ndim 4, dtype family int, shape (2, 32, 32, 3) — shape (2, 32, 32, 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
load_512 Ran
ran, honoured the contract we drafted
ubc-vision/LDM_correspondences/utils/optimize_token.py
pointer only (licence: Apache-2.0); the stored copy get_code serves, from cuixing100876/instastyle, is pointer only (licence: NONE) · get_code("0230471a58926463")
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 cuixing100876/instastyle, 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.

load_checkpoint Ran
ran on a synthesized input
ubc-vision/LDM_correspondences/utils/utils.py
code served (permissive licence) · get_code("0e293426913c9cf4")
How it ran

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

import os
import torch
import torch.nn as nn
from torch.optim import SGD
from torch.optim.lr_scheduler import StepLR

torch.manual_seed(0)

# Create a minimal model
class SimpleModel(nn.Module):
    def __init__(self):
        super().__init__()
        self.linear = nn.Linear(4, 3)
    
    def forward(self, x):
        return self.linear(x)

# Create model, optimizer, and scheduler
model = SimpleModel()
optimizer = SGD(model.parameters(), lr=0.01)
scheduler = StepLR(optimizer, step_size=1)

# Define ARGS with all parameters
ARGS = {
    'model': model,
    'optimizer': optimizer,
    'scheduler': scheduler,
    'filename': 'checkpoint.pth.tar'
}
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 1, dtype family float — a tuple output has no array shape of its own; none is stated
dtype family
int means an integer dtype; float means any other dtype the instrument saw, bool and complex included (fixture_check.py records only these two families)
Environment
image not recorded; re-verify against syntology-harvest-sandbox:v5-deps; not recorded for this sample: the harness installs a cuda-to-cpu shim (cuda_shim.py) before every sample and no run records whether a sample needed it; seed: none by the harness; any seed is in the setup block
parse_list Ran
ran on a synthesized input
ubc-vision/LDM_correspondences/utils/utils.py
code served (permissive licence) · get_code("7e8f8e2a3ea7f64e")
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 list, ndim 1, dtype family int; 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 re

def parse_list(list_str):
    """Parse given list (string -> int)"""
    return list(map(int, re.findall('\\d+', list_str)))

# The function takes a single parameter: list_str (a string)
# It uses re.findall to extract all digit sequences and converts them to integers
# So we need to provide a string that contains numbers

ARGS = {
    "list_str": "[1, 2, 3, 42, 100]"
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
none outside the standard library — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type list, ndim 1, dtype family int — a list output has no array shape of its own; none is stated
dtype family
int means an integer dtype; float means any other dtype the instrument saw, bool and complex included (fixture_check.py records only these two families)
Environment
image not recorded; re-verify against syntology-harvest-sandbox:v5-deps; not recorded for this sample: the harness installs a cuda-to-cpu shim (cuda_shim.py) before every sample and no run records whether a sample needed it; seed: none by the harness; any seed is in the setup block
random_crop Ran
ran on a synthesized input
ubc-vision/LDM_correspondences/eval/dataset.py
code served (permissive licence) · get_code("d7fccb2844458579")
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 random

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

# Create a small image tensor (C, H, W)
img = torch.randint(0, 256, (3, 128, 96), dtype=torch.uint8).float()

# Create keypoints tensor (N, 2) - N keypoints with x, y coordinates
kps = torch.tensor([
    [20.0, 30.0],
    [50.0, 60.0],
    [70.0, 80.0],
    [40.0, 50.0]
], dtype=torch.float)

# Create bounding box (left, top, right, bottom) as a tuple/list
# bbox format: (x_min, y_min, width_min, height_min) based on the code logic
bbox = (10, 15, 40, 50)

ARGS = {
    'img': img,
    'bbox': bbox,
    'kps': kps,
    'size': (512, 512),
    'p': 0.7
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
ipdb, torch, torchvision — 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
resize Ran
ran on a synthesized input
ubc-vision/LDM_correspondences/eval/dataset.py
code served (permissive licence) · get_code("3c8be19016fde613")
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 torchvision.transforms.functional

torch.manual_seed(0)

# Create a small image tensor: (C, H, W) = (3, 64, 48)
img = torch.randn(3, 64, 48)

# Create keypoints tensor: (N, 2) where N=4 keypoints
# Each keypoint has (x, y) coordinates
kps = torch.tensor([
    [10.0, 20.0],
    [30.0, 40.0],
    [15.0, 25.0],
    [45.0, 50.0]
], dtype=torch.float)

# Target size for resizing
size = (512, 512)

ARGS = {
    "img": img,
    "kps": kps,
    "size": size
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
torch, torchvision — 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
load_dataset Not yet run
unverified (harvested, no recorded run)
ubc-vision/LDM_correspondences/eval/download.py
code served (permissive licence) · get_code("d2ba3f4063f64a9f")
How it ran

no invocation recorded.

Also present in other papers' code

Of 12 samples lifted from this paper's linked repositories, 12 carry a function identity and 0 do not. Of the 12 distinct functions with an identity, 6 are also present in other papers whose code we hold (3 with at least one paper dated earlier, 3 the same month, 6 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
get_confirm_token 38 other papers
31 dated earlier, 7 later
1409.8230 (2014-09)
RENOIR - A Dataset for Real Low-Light Image Noise Reduction
1503.03832 (2015-03)
FaceNet: A Unified Embedding for Face Recognition and Clustering
1506.03134 (2015-06)
Pointer Networks
and 35 more not named here
latent2image 13 other papers
1 the same month, 12 later
2305.19164 (2023-05)
LANCE: Stress-testing Visual Models by Generating Language-guided Counterfactual Images
2308.06160 (2023-08)
DatasetDM: Synthesizing Data with Perception Annotations Using Diffusion Models
2309.14494 (2023-09)
Free-Bloom: Zero-Shot Text-to-Video Generator with LLM Director and LDM Animator
and 10 more not named here
boolean_string 10 other papers
6 dated earlier, 4 later
1908.09355 (2019-08)
Patient Knowledge Distillation for BERT Model Compression
1912.05524 (2019-12)
GLU-Net: Global-Local Universal Network for Dense Flow and Correspondences
2006.11280 (2020-06)
Self-PU: Self Boosted and Calibrated Positive-Unlabeled Training
and 7 more not named here
load_512 5 other papers
1 dated earlier, 1 the same month, 3 later
2304.06140 (2023-04)
An Edit Friendly DDPM Noise Space: Inversion and Manipulations
2305.18729 (2023-05)
Real-World Image Variation by Aligning Diffusion Inversion Chain
2311.15040 (2023-11)
InstaStyle: Inversion Noise of a Stylized Image is Secretly a Style Adviser
and 2 more not named here
init_latent 3 other papers
2 the same month, 1 later
2305.18729 (2023-05)
Real-World Image Variation by Aligning Diffusion Inversion Chain
2305.19164 (2023-05)
LANCE: Stress-testing Visual Models by Generating Language-guided Counterfactual Images
2405.01008 (2024-05)
On Mechanistic Knowledge Localization in Text-to-Image Generative Models
parse_list 1 other paper
1 later
Sun_Pixel-level_Semantic_Correspondence_through_Layout-aware_Representation_Learning_and_Multi-scale_Matching_CVPR_2024_paper (2024 (year only))
Pixel-level Semantic Correspondence through Layout-aware Representation Learning and Multi-scale Matching Integration

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-23.

Repositories linked to this paper

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

Abstract

Text-to-image diffusion models are now capable of generating images that are often indistinguishable from real images. To generate such images, these models must understand the semantics of the objects they are asked to generate. In this work we show that, without any training, one can leverage this semantic knowledge within diffusion models to find semantic correspondences - locations in multiple images that have the same semantic meaning. Specifically, given an image, we optimize the prompt embeddings of these models for maximum attention on the regions of interest. These optimized embeddings capture semantic information about the location, which can then be transferred to another image. By doing so we obtain results on par with the strongly supervised state of the art on the PF-Willow dataset and significantly outperform (20.9% relative for the SPair-71k dataset) any existing weakly or unsupervised method on PF-Willow, CUB-200 and SPair-71k datasets.

For agents

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

get_harvested_code_for_paper("2305.15581")
get_code_for_paper("2305.15581")
have("2305.15581")

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

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

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

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

Connect an agent — have() is free.