SYNTOLOGY HomeExplorerAtlasCodeMethodologyAboutDevelopersFeedPricing
Paper · 2406.07547 · 2024

Zero-shot Image Editing with Reference Imitation

arXiv · PDF · Open in the Atlas

Code that ran

12 of 13 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 7 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/2406.07547.json · badge: /api/ran/2406.07547.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
ali-vilab/MimicBrush community (classifier label)
classifier basis not recorded on the link
12 ran · 1 no recorded run
FunctionStatusWhere it lives
FeedForward Ran
ran; our contract draft was wrong, not the code
ali-vilab/MimicBrush/mimicbrush/resampler.py
pointer only (licence: Apache-2.0); the stored copy get_code serves, from rainbowluocs/openomni, is pointer only (licence: NONE) · get_code("5105747c2711b1cb")
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 rainbowluocs/openomni, 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.

calc_mean_std Ran
ran; our contract draft was wrong, not the code
ali-vilab/MimicBrush/models/ReferenceNet_attention.py
code served (permissive licence) · get_code("8199644cda7be3f8")
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 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

torch.manual_seed(0)

# The function calc_mean_std takes a tensor 'feat' and an optional eps parameter.
# It computes variance and mean along dim=-2 with keepdims=True.
# We need a tensor with at least 2 dimensions where dim=-2 makes sense.

# Create a small tensor: shape (2, 4, 3) so dim=-2 has size 4
feat = torch.randn(2, 4, 3)

# eps is a float with default value 1e-05
eps = 1e-05

ARGS = {
    "feat": feat,
    "eps": eps,
}
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 4, 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
collage_region Ran
ran on a synthesized input
ali-vilab/MimicBrush/run_gradio3_demo.py
code served (permissive licence) · get_code("44791985965ff2de")
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.

import numpy as np
from PIL import Image

# Create small test images as numpy arrays
# The function converts inputs to numpy arrays and processes them
# low will be zeroed out, high will be blended based on mask
low_image = np.random.randint(0, 256, size=(4, 3, 3), dtype=np.uint8)
high_image = np.random.randint(0, 256, size=(4, 3, 3), dtype=np.uint8)
mask_image = np.random.randint(0, 256, size=(4, 3, 3), dtype=np.uint8)

ARGS = {
    "low": low_image,
    "high": high_image,
    "mask": mask_image
}
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
gaussian_blure Ran
ran on a synthesized input
ali-vilab/MimicBrush/dataset/data_utils.py
code served (permissive licence) · get_code("bcc8b9cd94a83d38")
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.

import numpy as np
import cv2
from PIL import Image

# Create a small test image as a numpy array
# Using shape (4, 3, 3) for a 4x3 RGB image
test_image = np.random.randint(0, 256, size=(4, 3, 3), dtype=np.uint8)

# Convert to PIL Image for the first argument
img_pil = Image.fromarray(test_image)

ARGS = {
    'img': img_pil,
    'intens': 5
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
PIL, cv2, 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
get_SIFT Ran
ran on a synthesized input
ali-vilab/MimicBrush/dataset/data_utils.py
code served (permissive licence) · get_code("6dddd743cbcceb4f")
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 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 cv2
import numpy as np

# Create a small test image (grayscale, required for ORB feature detection)
# Using a simple pattern that will have detectable features
test_image = np.random.randint(0, 256, (100, 120), dtype=np.uint8)

# Add some structure to ensure features are detected
test_image[20:40, 30:50] = 255
test_image[60:80, 70:90] = 0
test_image[10:30, 80:100] = 128

ARGS = {
    "image": test_image
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
cv2, numpy — 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 float — 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
masked_mean Ran
ran; our contract draft was wrong, not the code
ali-vilab/MimicBrush/mimicbrush/resampler.py
pointer only (licence: Apache-2.0); the stored copy get_code serves, from Minyeol/MIDAS, is pointer only (licence: NONE) · get_code("230588e8f1237737")
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 Minyeol/MIDAS, 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.

pad_img_to_square Ran
ran on a synthesized input
ali-vilab/MimicBrush/run_gradio3_demo.py
code served (permissive licence) · get_code("4a9a64c1228de9c4")
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.

import numpy as np
from PIL import Image

# Create a test image that is not square (wider than tall)
# Using numpy to create a simple RGB image array
width, height = 100, 60
image_array = np.ones((height, width, 3), dtype=np.uint8) * 200
original_image = Image.fromarray(image_array, 'RGB')

ARGS = {
    'original_image': original_image,
    'is_mask': False
}
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
random_mask Ran
ran on a synthesized input
ali-vilab/MimicBrush/dataset/data_utils.py
code served (permissive licence) · get_code("ba8f22021dec0132")
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 2, dtype family int, shape (4, 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 numpy as np
import random

random.seed(0)
np.random.seed(0)

# Create a small mask array with distinct dimensions (4x3)
mask = np.zeros((4, 3), dtype=np.uint8)

ARGS = {
    "mask": mask
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
numpy — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type ndarray, ndim 2, dtype family int, shape (4, 3) — shape (4, 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
reshape_tensor Ran
ran; the contract check could not run (RAISES, DEP_MISSING or TIMEOUT)
ali-vilab/MimicBrush/mimicbrush/resampler.py
pointer only (licence: Apache-2.0); the stored copy get_code serves, from Minyeol/MIDAS, is pointer only (licence: NONE) · get_code("4cb2e2a2ca0bec9f")
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 Minyeol/MIDAS, 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.

resize_image_keep_aspect_ratio Ran
ran on a synthesized input
ali-vilab/MimicBrush/run_gradio3_demo.py
code served (permissive licence) · get_code("0818a167c749d6f4")
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 (512, 341, 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 cv2
import numpy as np

# Create a sample image with distinct height and width
# Using a vertical image (height > width) to test the if branch
image = np.random.randint(0, 256, (480, 320, 3), dtype=np.uint8)

ARGS = {
    "image": image,
    "target_size": 512
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
cv2, numpy — 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 (512, 341, 3) — shape (512, 341, 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
retrieve_latents Ran
ran on a synthesized input
ali-vilab/MimicBrush/models/pipeline_mimicbrush.py
code served (permissive licence) · get_code("b1c3f0a29f2e6e9d")
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 MockLatentDist:
    def sample(self, generator):
        return torch.randn(2, 4)

class MockEncoderOutputWithLatentDist:
    def __init__(self):
        self.latent_dist = MockLatentDist()

class MockEncoderOutputWithLatents:
    def __init__(self):
        self.latents = torch.randn(2, 4)

class MockGenerator:
    pass

encoder_output = MockEncoderOutputWithLatentDist()
generator = MockGenerator()

ARGS = {
    'encoder_output': encoder_output,
    'generator': generator
}
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
torch_dfs Ran
ran; our contract draft was wrong, not the code
ali-vilab/MimicBrush/models/ReferenceNet_attention.py
code served (permissive licence) · get_code("e55f24470648724c")
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. 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 small model with a hierarchical structure
# The function calls model.children(), so we need a model with child modules
class SimpleModel(nn.Module):
    def __init__(self):
        super().__init__()
        self.layer1 = nn.Linear(4, 3)
        self.layer2 = nn.Sequential(
            nn.Linear(3, 2),
            nn.ReLU()
        )
        self.layer3 = nn.Linear(2, 1)
    
    def forward(self, x):
        x = self.layer1(x)
        x = self.layer2(x)
        x = self.layer3(x)
        return x

model = SimpleModel()

ARGS = {
    "model": model
}
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 list — a list 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
prepare_mask_and_masked_image Not yet run
unverified (harvested, no recorded run)
ali-vilab/MimicBrush/models/pipeline_mimicbrush.py
code served (permissive licence) · get_code("a159146ab7ba81f1")
How it ran

no invocation recorded.

Also present in other papers' code

Of 13 samples lifted from this paper's linked repositories, 13 carry a function identity and 0 do not. Of the 13 distinct functions with an identity, 5 are also present in other papers whose code we hold (4 with at least one paper dated earlier, 3 the same month, 5 later) and 8 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
FeedForward 47 other papers
16 dated earlier, 2 the same month, 28 later, 1 same year, order not determinable · 4 only as an assembly brick
2204.14198 (2022-04)
Flamingo: a Visual Language Model for Few-Shot Learning
2308.02463 (2023-08)
Towards Generalist Foundation Model for Radiology by Leveraging Web-scale 2D&3D Medical Data
2308.06721 (2023-08)
IP-Adapter: Text Compatible Image Prompt Adapter for Text-to-Image Diffusion Models
and 44 more not named here
reshape_tensor 30 other papers
10 dated earlier, 1 the same month, 19 later
2308.06721 (2023-08)
IP-Adapter: Text Compatible Image Prompt Adapter for Text-to-Image Diffusion Models
2312.04461 (2023-12)
PhotoMaker: Customizing Realistic Human Photos via Stacked ID Embedding
2312.16693 (2023-12)
I2V-Adapter: A General Image-to-Video Adapter for Diffusion Models
and 27 more not named here
masked_mean 18 other papers
6 dated earlier, 1 the same month, 11 later
2308.06721 (2023-08)
IP-Adapter: Text Compatible Image Prompt Adapter for Text-to-Image Diffusion Models
2312.04461 (2023-12)
PhotoMaker: Customizing Realistic Human Photos via Stacked ID Embedding
2312.16693 (2023-12)
I2V-Adapter: A General Image-to-Video Adapter for Diffusion Models
and 15 more not named here
torch_dfs 9 other papers
6 dated earlier, 3 later
2403.14781 (2024-03)
Champ: Controllable and Consistent Human Image Animation with 3D Parametric Guidance
2403.17694 (2024-03)
AniPortrait: Audio-Driven Synthesis of Photorealistic Portrait Animation
2405.11794 (2024-05)
ViViD: Video Virtual Try-on using Diffusion Models
and 6 more not named here
calc_mean_std 1 other paper
1 later
2408.05939 (2024-08)
UniPortrait: A Unified Framework for Identity-Preserving Single- and Multi-Human Image Personalization

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

Image editing serves as a practical yet challenging task considering the diverse demands from users, where one of the hardest parts is to precisely describe how the edited image should look like. In this work, we present a new form of editing, termed imitative editing, to help users exercise their creativity more conveniently. Concretely, to edit an image region of interest, users are free to directly draw inspiration from some in-the-wild references (e.g., some relative pictures come across online), without having to cope with the fit between the reference and the source. Such a design requires the system to automatically figure out what to expect from the reference to perform the editing. For this purpose, we propose a generative training framework, dubbed MimicBrush, which randomly selects two frames from a video clip, masks some regions of one frame, and learns to recover the masked regions using the information from the other frame. That way, our model, developed from a diffusion prior, is able to capture the semantic correspondence between separate images in a self-supervised manner. We experimentally show the effectiveness of our method under various test cases as well as its superiority over existing alternatives. We also construct a benchmark to facilitate further research.

For agents

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

get_harvested_code_for_paper("2406.07547")
get_code_for_paper("2406.07547")
have("2406.07547")

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

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

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

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

Connect an agent — have() is free.