SYNTOLOGY HomeExplorerAtlasCodeMethodologyAboutDevelopersFeedPricing
Paper · 2306.14435 · 2023

DragDiffusion: Harnessing Diffusion Models for Interactive Point-based Image Editing

arXiv · PDF · Open in the Atlas

Code that ran

4 of 6 samples (functions and classes) lifted from this paper's linked repositories executed on a synthesized input in Syntology's jail (0 of them constructed an object rather than computing a result; 2 honoured the contract we drafted, 0 violated it and 1 has no contract verdict; 1 failure of our instrument; 2 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/2306.14435.json · badge: /api/ran/2306.14435.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
Yujun-Shi/DragDiffusion canonical (classifier label)
classifier basis: classifier_2025
1 ran · 1 no recorded run
HimariO/DragDiffusion-diffusers community (classifier label)
classifier basis not recorded on the link
3 ran · 1 no recorded run
FunctionStatusWhere it lives
backward_ddim Ran
ran, honoured the contract we drafted
HimariO/DragDiffusion-diffusers/drag_pipeline.py
code served (permissive licence) · get_code("a3379285d38d5ba2")
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)

# Construct valid arguments for backward_ddim
x_t = torch.randn(2, 4)  # batch_size=2, dim=4
alpha_t = torch.tensor(0.9)  # scalar tensor for alpha_t
alpha_tm1 = torch.tensor(0.8)  # scalar tensor for alpha_{t-1}
eps_xt = torch.randn(2, 4)  # batch_size=2, dim=4, same shape as x_t

ARGS = {
    "x_t": x_t,
    "alpha_t": alpha_t,
    "alpha_tm1": alpha_tm1,
    "eps_xt": eps_xt
}
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
collate_fn Ran
ran; our contract draft was wrong, not the code
Yujun-Shi/DragDiffusion/lora/train_dreambooth_lora.py
code served (permissive licence) · get_code("256040ccde7473f2")
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 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)

# Create example data structures that match what collate_fn expects
example_with_mask = {
    'instance_prompt_ids': torch.randint(0, 100, (5,)),
    'instance_images': torch.randn(3, 4, 4),
    'instance_attention_mask': torch.ones(5),
    'class_prompt_ids': torch.randint(0, 100, (5,)),
    'class_images': torch.randn(3, 4, 4),
    'class_attention_mask': torch.ones(5),
}

example_without_mask = {
    'instance_prompt_ids': torch.randint(0, 100, (5,)),
    'instance_images': torch.randn(3, 4, 4),
    'class_prompt_ids': torch.randint(0, 100, (5,)),
    'class_images': torch.randn(3, 4, 4),
}

# Test case 1: with prior preservation and attention masks
examples_with_prior = [example_with_mask, example_with_mask]

# Test case 2: without prior preservation, with attention masks
examples_no_prior = [example_with_mask, example_with_mask]

# Test case 3: without attention masks
examples_no_mask = [example_without_mask, example_without_mask]

ARGS = {
    'examples': examples_with_prior,
    'with_prior_preservation': True,
}
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 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
forward_ddim Ran
ran, honoured the contract we drafted
HimariO/DragDiffusion-diffusers/drag_pipeline.py
code served (permissive licence) · get_code("85fd2e71002a15f4")
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)

# Construct arguments for forward_ddim
# The function takes: x_t, alpha_t, alpha_tp1, eps_xt
# All appear to be tensors used in mathematical operations

x_t = torch.randn(2, 4)  # batch size 2, dimension 4
alpha_t = torch.tensor(0.9)  # scalar tensor for alpha_t
alpha_tp1 = torch.tensor(0.85)  # scalar tensor for alpha_{t+1}
eps_xt = torch.randn(2, 4)  # batch size 2, dimension 4, same shape as x_t

ARGS = {
    "x_t": x_t,
    "alpha_t": alpha_t,
    "alpha_tp1": alpha_tp1,
    "eps_xt": eps_xt,
}
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
load_img Ran
ran on a synthesized input
HimariO/DragDiffusion-diffusers/drag_pipeline.py
code served (permissive licence) · get_code("acae03ffff4ba768")
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 3, dtype family float, shape (3, 512, 512) 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 PIL
import torch
import numpy as np
from io import BytesIO
from torchvision import transforms

# Create a small dummy image and save it to a BytesIO object
# We'll create it as a PIL Image in memory
dummy_image = PIL.Image.new('RGB', (256, 256), color=(73, 109, 137))

# Save to BytesIO
img_bytes = BytesIO()
dummy_image.save(img_bytes, format='PNG')
img_bytes.seek(0)

# Create a temporary path-like object that PIL can read from
# Since we can't do real file I/O, we'll create a minimal mock
class MockImagePath:
    def __init__(self, pil_image):
        self.pil_image = pil_image
    
    def __str__(self):
        return "mock_image_path"

# Actually, PIL.Image.open() requires a real file or file-like object
# Let's use a different approach - monkey patch for testing
import tempfile
import os

# Create a temporary directory and file
temp_dir = tempfile.gettempdir()
temp_path = os.path.join(temp_dir, 'test_image_temp.png')
dummy_image.save(temp_path)

ARGS = {
    'path': temp_path,
    'target_size': 512
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
PIL, numpy, torch, torchvision — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type Tensor, ndim 3, dtype family float, shape (3, 512, 512) — shape (3, 512, 512) 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
parse_args Not yet run
unverified (harvested, no recorded run)
Yujun-Shi/DragDiffusion/lora/train_dreambooth_lora.py
code served (permissive licence) · get_code("ce6abf8518e8fd67")
How it ran

no invocation recorded.

prepare_mask_and_masked_image Not yet run
unverified (harvested, no recorded run)
HimariO/DragDiffusion-diffusers/drag_inpaint_pipeline.py
code served (permissive licence) · get_code("564d1e2f74eb0245")
How it ran

no invocation recorded.

Also present in other papers' code

Of 6 samples lifted from this paper's linked repositories, 6 carry a function identity and 0 do not. Of the 6 distinct functions with an identity, 4 are also present in other papers whose code we hold (0 with at least one paper dated earlier, 0 the same month, 4 later) and 2 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
collate_fn 5 other papers
5 later
2311.18815 (2023-11)
IMMA: Immunizing text-to-image Models against Malicious Adaptation
2312.00084 (2023-12)
Can Protective Perturbation Safeguard Personal Data from Being Exploited by Stable Diffusion?
2401.06442 (2024-01)
RotationDrag: Point-based Image Editing with Rotated Diffusion Features
and 2 more not named here
parse_args 2 other papers
2 later
2401.06442 (2024-01)
RotationDrag: Point-based Image Editing with Rotated Diffusion Features
2404.01050 (2024-04)
Drag Your Noise: Interactive Point-based Editing via Diffusion Semantic Propagation
backward_ddim 1 other paper
1 later
2307.14352 (2023-07)
General Image-to-Image Translation with One-Shot Image Guidance
forward_ddim 1 other paper
1 later
2307.14352 (2023-07)
General Image-to-Image Translation with One-Shot Image Guidance

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

Accurate and controllable image editing is a challenging task that has attracted significant attention recently. Notably, DragGAN is an interactive point-based image editing framework that achieves impressive editing results with pixel-level precision. However, due to its reliance on generative adversarial networks (GANs), its generality is limited by the capacity of pretrained GAN models. In this work, we extend this editing framework to diffusion models and propose a novel approach DragDiffusion. By harnessing large-scale pretrained diffusion models, we greatly enhance the applicability of interactive point-based editing on both real and diffusion-generated images. Our approach involves optimizing the diffusion latents to achieve precise spatial control. The supervision signal of this optimization process is from the diffusion model's UNet features, which are known to contain rich semantic and geometric information. Moreover, we introduce two additional techniques, namely LoRA fine-tuning and latent-MasaCtrl, to further preserve the identity of the original image. Lastly, we present a challenging benchmark dataset called DragBench -- the first benchmark to evaluate the performance of interactive point-based image editing methods. Experiments across a wide range of challenging cases (e.g., images with multiple objects, diverse object categories, various styles, etc.) demonstrate the versatility and generality of DragDiffusion. Code: https://github.com/Yujun-Shi/DragDiffusion.

For agents

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

get_harvested_code_for_paper("2306.14435")
get_code_for_paper("2306.14435")
have("2306.14435")

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

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

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

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

Connect an agent — have() is free.