SYNTOLOGY HomeExplorerAtlasCodeMethodologyAboutDevelopersFeedPricing
Paper · 2403.17064 · 2024

Continuous, Subject-Specific Attribute Control in T2I Models by Identifying Semantic Directions

arXiv · PDF · Open in the Atlas

Code that ran

5 of 5 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, 3 violated it and 0 have no contract verdict; 2 failures of our instrument; 0 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/2403.17064.json · badge: /api/ran/2403.17064.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
compvis/attribute-control canonical (classifier label)
classifier basis: census
5 ran · 0 no recorded run
FunctionStatusWhere it lives
broadcast_trailing_dims Ran
ran, violated the contract we drafted
compvis/attribute-control/attribute_control/utils.py
code served (permissive licence) · get_code("b5f8846a22f22b75")
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 (4, 1, 1) 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)

# Create a tensor with shape (c,) - 1D tensor with 4 elements
tensor = torch.randn(4)

# Create a reference tensor with shape (c, d, e) - 3D tensor
# This has one dimension matching 'c' and two trailing dimensions
reference = torch.randn(4, 3, 5)

ARGS = {
    "tensor": tensor,
    "reference": reference
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
jaxtyping, torch — 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 (4, 1, 1) — shape (4, 1, 1) 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_mask Ran
ran, violated the contract we drafted
compvis/attribute-control/attribute_control/prompt_utils.py
code served (permissive licence) · get_code("e330c01e118b1e7d")
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 re
from typing import List

def get_mask_regex(prompt: str, pattern_target: str, verbose: bool=True) -> List[bool]:
    characterwise_mask = [False] * len(prompt)
    num_matches = 0
    for m in re.finditer(pattern_target, prompt):
        num_matches += 1
        characterwise_mask[m.span()[0]:m.span()[1]] = [True] * len(m.group(0))
    if verbose and (num_matches > 1 or num_matches == 0):
        print(f'Got {num_matches} matches for pattern "{pattern_target}" in prompt "{prompt}". This might indicate a mistake.')
    return characterwise_mask

def get_mask(prompt: str, target: str, verbose: bool=True) -> List[bool]:
    return get_mask_regex(prompt=prompt, pattern_target=re.escape(target), verbose=verbose)

ARGS = {
    "prompt": "The quick brown fox jumps over the lazy dog",
    "target": "brown",
    "verbose": True
}
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 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
get_mask_regex Ran
ran, violated the contract we drafted
compvis/attribute-control/attribute_control/prompt_utils.py
code served (permissive licence) · get_code("b9e9d5671d3a50df")
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 re
from typing import List

def get_mask_regex(prompt: str, pattern_target: str, verbose: bool=True) -> List[bool]:
    characterwise_mask = [False] * len(prompt)
    num_matches = 0
    for m in re.finditer(pattern_target, prompt):
        num_matches += 1
        characterwise_mask[m.span()[0]:m.span()[1]] = [True] * len(m.group(0))
    if verbose and (num_matches > 1 or num_matches == 0):
        print(f'Got {num_matches} matches for pattern "{pattern_target}" in prompt "{prompt}". This might indicate a mistake.')
    return characterwise_mask


ARGS = {
    "prompt": "The quick brown fox jumps over the lazy dog",
    "pattern_target": "fox",
    "verbose": True,
}
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 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
get_string_combinations Ran
ran; our contract draft was wrong, not the code
compvis/attribute-control/attribute_control/utils.py
code served (permissive licence) · get_code("591ac2f8e1e740a1")
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 re
from itertools import product
from typing import Callable, Dict, List, Union, Tuple, Any, Optional

# Test case 1: Simple combination with optional prefix and two options
combination_string_1 = "{,a photo of,a portrait of} a {man,woman}"

# Test case 2: Single braces with empty option
combination_string_2 = "{hello,world}"

# Test case 3: Multiple consecutive braces
combination_string_3 = "{a,b}{1,2}"

# Test case 4: Text before, between, and after braces
combination_string_4 = "prefix {option1,option2} middle {opt_a,opt_b} suffix"

# Test case 5: Empty string between options
combination_string_5 = "{x,,y} test"

ARGS = {
    "combination_string": "{,a photo of,a portrait of} a {man,woman}"
}
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 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
getattr_recursive Ran
ran; our contract draft was wrong, not the code
compvis/attribute-control/attribute_control/utils.py
code served (permissive licence) · get_code("ea59d5891e818a8c")
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 torch
import torch.nn as nn
from typing import Any, Dict

# Set seed for reproducibility
torch.manual_seed(0)

# Create a simple nested object structure to test recursive attribute access
class Level3:
    def __init__(self):
        self.value = "found_it"
        self.tensor_list = [torch.randn(2, 4), torch.randn(3, 5)]

class Level2:
    def __init__(self):
        self.level3 = Level3()
        self.data = [torch.randn(2, 4), torch.randn(2, 3)]

class Level1:
    def __init__(self):
        self.level2 = Level2()
        self.items = torch.randn(4, 2)

# Create test object
obj = Level1()

# Test case 1: Simple nested attribute access
path1 = "level2.level3.value"

# Test case 2: Access with numeric indexing
path2 = "level2.data.0"

# Test case 3: Mixed nested access
path3 = "level2.level3.tensor_list.1"

ARGS = {
    "obj": obj,
    "path": path1
}
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 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

Also present in other papers' code

Of 5 samples lifted from this paper's linked repositories, 5 carry a function identity and 0 do not. Of the 5 distinct functions with an identity, 1 are also present in other papers whose code we hold (0 with at least one paper dated earlier, 0 the same month, 1 later) and 4 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
broadcast_trailing_dims 1 other paper
1 later
2508.10407 (2025-08)
Translation of Text Embedding via Delta Vector to Suppress Strongly Entangled Content in Text-to-Image Diffusion Models

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

Recent advances in text-to-image (T2I) diffusion models have significantly improved the quality of generated images. However, providing efficient control over individual subjects, particularly the attributes characterizing them, remains a key challenge. While existing methods have introduced mechanisms to modulate attribute expression, they typically provide either detailed, object-specific localization of such a modification or full-scale fine-grained, nuanced control of attributes. No current approach offers both simultaneously, resulting in a gap when trying to achieve precise continuous and subject-specific attribute modulation in image generation. In this work, we demonstrate that token-level directions exist within commonly used CLIP text embeddings that enable fine-grained, subject-specific control of high-level attributes in T2I models. We introduce two methods to identify these directions: a simple, optimization-free technique and a learning-based approach that utilizes the T2I model to characterize semantic concepts more specifically. Our methods allow the augmentation of the prompt text input, enabling fine-grained control over multiple attributes of individual subjects simultaneously, without requiring any modifications to the diffusion model itself. This approach offers a unified solution that fills the gap between global and localized control, providing competitive flexibility and precision in text-guided image generation. Project page: https://compvis.github.io/attribute-control. Code is available at https://github.com/CompVis/attribute-control.

For agents

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

get_harvested_code_for_paper("2403.17064")
get_code_for_paper("2403.17064")
have("2403.17064")

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

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

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

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

Connect an agent — have() is free.