SYNTOLOGY HomeExplorerAtlasCodeMethodologyAboutDevelopersFeedPricing
Paper · 2510.14553 · ICLR · 2025

Consistent text-to-image generation via scene de-contextualization

Mao Ye, Boyu Wang, Xiatian Zhu, Jianwei Zhang, Song Tang, Kai Guo, Peihao Gong, Kunyu Li

arXiv · PDF · Open in the Atlas

Code that ran

17 of 18 samples (functions and classes) lifted from this paper's linked repositories executed on a synthesized input in Syntology's jail (1 of them constructed an object rather than computing a result; 1 honoured the contract we drafted, 0 violated it and 1 has no contract verdict; 15 failures of our instrument; 1 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/2510.14553.json · badge: /api/ran/2510.14553.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
HVision-NKU/StoryDiffusion canonical (classifier label)
classifier basis: census
7 ran · 0 no recorded run
NVlabs/consistory canonical (classifier label)
classifier basis: census
5 ran · 0 no recorded run
byliutao/1Prompt1Story community
Papers with Code archive
5 ran · 1 no recorded run
FunctionStatusWhere it lives
UNetController Ran
ran on a synthesized input · constructed an object; no result was computed
byliutao/1Prompt1Story/unet/utils.py
code served (permissive licence) · get_code("e50934b785284e12")
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, UNetController: the run constructed the object and did not call it, so no result was computed. The image it ran in was not recorded. The code mentions cuda, and the harness aliases cuda to the CPU for every sample; whether this run needed that is 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)

class UNetController:
    Is_freeu_enabled = False
    Freeu_parm = {'s1': 0.6, 's2': 0.4, 'b1': 1.1, 'b2': 1.2}
    Use_ipca = True
    Ipca_position = ['down0', 'down1', 'down2', 'mid', 'up0', 'up1', 'up2']
    Ipca_start_step = 0
    Ipca_dropout = 0.0
    Use_embeds_mask = True
    Alpha_weaken = 0.01
    Beta_weaken = 0.05
    Alpha_enhance = -0.01
    Beta_enhance = 1.0
    Prompt_embeds_mode = 'svr'
    Remove_pool_embeds = False
    Prompt_embeds_start_step = 0
    Store_qkv = True
    Use_same_latents = True
    Use_same_init_noise = True
    Save_story_image = True

    def __init__(self):
        self._variables = {}
        self.device = 'cpu'
        self.current_unet_position = 'down'
        self.torch_dtype = torch.float32
        self.prompts = None
        self.negative_prompt = None
        self.id_prompt = None
        self.frame_prompt_express = None
        self.frame_prompt_suppress = None
        self.frame_prompt_express_list = None
        self.frame_prompt_suppress_list = None
        self.tokenizer = None
        self.result_save_dir = None
        self.current_time_step = None
        self.do_classifier_free_guidance = None
        self.q_store = {}
        self.k_store = {}
        self.v_store = {}
        self.do_classifier_free_guidance = None
        self.current_unet_position = None
        self.ipca2_index = -1
        self.ipca_time_step = -1

    def print_attributes(self):
        """
        Prints all attributes and their values of the object.
        """
        for attr, value in vars(self).items():
            print(f'{attr}: {value}')


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 UNetController — 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 UNetController 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
add_caption Ran
ran; the contract check could not run (RAISES, DEP_MISSING or TIMEOUT)
HVision-NKU/StoryDiffusion/utils/utils.py
code served (permissive licence) · get_code("293847aedbd19e46")
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 torch
from PIL import Image, ImageDraw, ImageFont
import numpy as np

# Create a small test image (100x100 pixels, RGB mode)
test_image = Image.new('RGB', (100, 100), color='white')

# Create a simple font - using default font
try:
    font = ImageFont.load_default()
except Exception:
    font = None

# Define the ARGS dictionary with all parameters for add_caption
ARGS = {
    'image': test_image,
    'text': 'This is a test caption with multiple words',
    'position': 'bottom-mid',
    'font': font,
    'text_color': 'black',
    'bg_color': (255, 255, 255),
    'bg_opacity': 200
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
PIL, numpy, torch — 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
add_white_border Ran
ran; our contract draft was wrong, not the code
HVision-NKU/StoryDiffusion/utils/utils.py
code served (permissive licence) · get_code("fbe121fea006a44e")
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.

from PIL import Image
import numpy as np

# Create a small test image
img_array = np.random.randint(0, 256, (50, 60, 3), dtype=np.uint8)
test_image = Image.fromarray(img_array, mode='RGB')

ARGS = {
    'input_image': test_image,
    'border_width': 10
}
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
attn_map_to_binary Ran
ran; our contract draft was wrong, not the code
NVlabs/consistory/utils/general_utils.py
pointer only (licence: NOASSERTION) · get_code("5c36037d32ef030e")
How it ran

The body of this sample is withheld: GitHub could not classify the licence of this paper's repository, NVlabs/consistory (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.

cal_attn_indice_xl_effcient_memory Ran
ran; our contract draft was wrong, not the code
HVision-NKU/StoryDiffusion/utils/gradio_utils.py
code served (permissive licence) · get_code("b109efdd314c37ba")
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. The code mentions cuda, and the harness aliases cuda to the CPU for every sample; whether this run needed that is 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)

ARGS = {
    "total_length": 2,
    "id_length": 1,
    "sa32": 0.5,
    "sa64": 0.3,
    "height": 64,
    "width": 32,
    "device": "cpu",
    "dtype": torch.float16,
}
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 — 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
cal_attn_mask Ran
ran; our contract draft was wrong, not the code
HVision-NKU/StoryDiffusion/utils/gradio_utils.py
code served (permissive licence) · get_code("2bf55a5e0aed32ff")
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. The code mentions cuda, and the harness aliases cuda to the CPU for every sample; whether this run needed that is 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)

ARGS = {
    'total_length': 2,
    'id_length': 1,
    'sa16': 0.5,
    'sa32': 0.5,
    'sa64': 0.5,
    'device': 'cpu',
    'dtype': torch.float16
}
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 — 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
cal_attn_mask_xl Ran
ran; our contract draft was wrong, not the code
HVision-NKU/StoryDiffusion/utils/gradio_utils.py
code served (permissive licence) · get_code("1c16defbfcfd003b")
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. The code mentions cuda, and the harness aliases cuda to the CPU for every sample; whether this run needed that is 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)

# Analyze the function:
# - total_length: int, used in loops and arithmetic
# - id_length: int, used in arithmetic
# - sa32: float, used in comparison with torch.rand
# - sa64: float, used in comparison with torch.rand
# - height: int, used in division (height // 32, height // 16)
# - width: int, used in division (width // 32, width // 16)
# - device: str, passed to torch functions
# - dtype: torch dtype, passed to torch.rand

# Choose reasonable dimensions that satisfy the arithmetic:
# height and width should be divisible by 32 and 16
height = 64
width = 96

# total_length and id_length for reasonable matrix sizes
total_length = 4
id_length = 2

# Attention probabilities (between 0 and 1)
sa32 = 0.5
sa64 = 0.3

ARGS = {
    'total_length': total_length,
    'id_length': id_length,
    'sa32': sa32,
    'sa64': sa64,
    'height': height,
    'width': width,
    'device': 'cpu',
    'dtype': torch.float32
}
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 — 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
create_anchor_mapping Ran
ran; our contract draft was wrong, not the code
NVlabs/consistory/consistory_cache.py
pointer only (licence: NOASSERTION) · get_code("b9bc58f981bca9d7")
How it ran

The body of this sample is withheld: GitHub could not classify the licence of this paper's repository, NVlabs/consistory (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.

create_token_indices Ran
ran, honoured the contract we drafted
NVlabs/consistory/consistory_cache.py
pointer only (licence: NOASSERTION) · get_code("aa081efafe522f87")
How it ran

The body of this sample is withheld: GitHub could not classify the licence of this paper's repository, NVlabs/consistory (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.

find_sublist_index Ran
ran; the contract check could not run (RAISES, DEP_MISSING or TIMEOUT)
byliutao/1Prompt1Story/unet/utils.py
code served (permissive licence) · get_code("e3db6e3a013fcf3d")
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 int, ndim 0, dtype family int, 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

# find_sublist_index takes two list parameters
# It iterates through list1 and checks if any slice equals list2
# Both parameters should be lists that support slicing and equality comparison

list1 = [1, 2, 3, 4, 5, 6]
list2 = [3, 4, 5]

ARGS = {
    "list1": list1,
    "list2": list2
}
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 int, ndim 0, dtype family int, 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
gaussian_smooth Ran
ran; our contract draft was wrong, not the code
NVlabs/consistory/utils/general_utils.py
pointer only (licence: NOASSERTION) · get_code("333c7d79c6682d84")
How it ran

The body of this sample is withheld: GitHub could not classify the licence of this paper's repository, NVlabs/consistory (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.

gen_dropout_mask Ran
ran; our contract draft was wrong, not the code
byliutao/1Prompt1Story/unet/utils.py
code served (permissive licence) · get_code("efd2a5bc21534924")
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 (2, 4, 5) as a later run recorded it. The image it ran in was not recorded. The code mentions cuda, and the harness aliases cuda to the CPU for every sample; whether this run needed that is 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)

class UNetController:
    Is_freeu_enabled = False
    Freeu_parm = {'s1': 0.6, 's2': 0.4, 'b1': 1.1, 'b2': 1.2}
    Use_ipca = True
    Ipca_position = ['down0', 'down1', 'down2', 'mid', 'up0', 'up1', 'up2']
    Ipca_start_step = 0
    Ipca_dropout = 0.0
    Use_embeds_mask = True
    Alpha_weaken = 0.01
    Beta_weaken = 0.05
    Alpha_enhance = -0.01
    Beta_enhance = 1.0
    Prompt_embeds_mode = 'svr'
    Remove_pool_embeds = False
    Prompt_embeds_start_step = 0
    Store_qkv = True
    Use_same_latents = True
    Use_same_init_noise = True
    Save_story_image = True

    def __init__(self):
        self._variables = {}
        self.device = 'cpu'
        self.current_unet_position = 'down'
        self.torch_dtype = torch.float32
        self.prompts = None
        self.negative_prompt = None
        self.id_prompt = None
        self.frame_prompt_express = None
        self.frame_prompt_suppress = None
        self.frame_prompt_express_list = None
        self.frame_prompt_suppress_list = None
        self.tokenizer = None
        self.result_save_dir = None
        self.current_time_step = None
        self.do_classifier_free_guidance = None
        self.q_store = {}
        self.k_store = {}
        self.v_store = {}
        self.do_classifier_free_guidance = None
        self.current_unet_position = None
        self.ipca2_index = -1
        self.ipca_time_step = -1

    def print_attributes(self):
        """
        Prints all attributes and their values of the object.
        """
        for attr, value in vars(self).items():
            print(f'{attr}: {value}')

controller = UNetController()

out_shape = (2, 3, 4, 5)

drop_out = 0.1

ARGS = {
    'out_shape': out_shape,
    'unet_controller': controller,
    'drop_out': drop_out,
}
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 3, dtype family float, shape (2, 4, 5) — shape (2, 4, 5) 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_dynamic_threshold Ran
ran; our contract draft was wrong, not the code
NVlabs/consistory/utils/general_utils.py
pointer only (licence: NOASSERTION) · get_code("6980c2a0a68bc7d7")
How it ran

The body of this sample is withheld: GitHub could not classify the licence of this paper's repository, NVlabs/consistory (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.

get_image_path_list Ran
ran; our contract draft was wrong, not the code
HVision-NKU/StoryDiffusion/gradio_app_sdxl_specific_id_low_vram.py
code served (permissive licence) · get_code("4397f62f7d8c4e57")
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 os
import tempfile

# Create a temporary directory with some test image files
temp_dir = tempfile.mkdtemp()

# Create some dummy image files
test_image_names = ["image1.jpg", "image2.png", "image3.jpg"]
for image_name in test_image_names:
    image_path = os.path.join(temp_dir, image_name)
    with open(image_path, 'w') as f:
        f.write("dummy image content")

ARGS = {
    "folder_name": temp_dir
}
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
ipca Ran
ran; the contract check could not run (RAISES, DEP_MISSING or TIMEOUT)
byliutao/1Prompt1Story/unet/utils.py
code served (permissive licence) · get_code("d8a734b4027a6ccf")
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 4, dtype family float, shape (2, 2, 8, 4) as a later run recorded it. The image it ran in was not recorded. The code mentions cuda, and the harness aliases cuda to the CPU for every sample; whether this run needed that is 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 MockTokenizer:
    def __init__(self):
        self.model_max_length = 77
        self.decoder = {
            0: '<|startoftext|>',
            1: 'a',
            2: 'dog',
            3: 'running',
            4: '<|endoftext|>',
        }
    
    def __call__(self, prompt, padding=None, max_length=None, truncation=None, return_tensors=None):
        input_ids = torch.tensor([[0, 1, 2, 3, 4] + [4] * 72])
        return {'input_ids': input_ids}

class MockUNetController:
    def __init__(self):
        self.device = 'cpu'
        self.torch_dtype = torch.float32
        self.Ipca_dropout = 0.1
        self.Use_embeds_mask = False
        self.prompts = ['a dog running']
        self.id_prompt = 'dog'
        self.tokenizer = MockTokenizer()

# Create test tensors
batch_size = 2
seq_len = 8
head_dim = 4
num_heads = 2

# q: (batch_size, num_heads, seq_len, head_dim)
q = torch.randn(batch_size, num_heads, seq_len, head_dim, dtype=torch.float32)
# k: (batch_size, num_heads, seq_len, head_dim)
k = torch.randn(batch_size, num_heads, seq_len, head_dim, dtype=torch.float32)
# v: (batch_size, num_heads, seq_len, head_dim)
v = torch.randn(batch_size, num_heads, seq_len, head_dim, dtype=torch.float32)
# scale: float
scale = 1.0 / (head_dim ** 0.5)

unet_controller = MockUNetController()

ARGS = {
    'q': q,
    'k': k,
    'v': v,
    'scale': scale,
    'unet_controller': unet_controller,
}
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 4, dtype family float, shape (2, 2, 8, 4) — shape (2, 2, 8, 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
process_mulline_text Ran
ran; our contract draft was wrong, not the code
HVision-NKU/StoryDiffusion/utils/utils.py
code served (permissive licence) · get_code("ac2390fc5e5bbe10")
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.

from PIL import Image, ImageDraw, ImageFont

# Create a simple image and drawing context
image = Image.new('RGB', (800, 600), color='white')
draw = ImageDraw.Draw(image)

# Use default font (available on all systems)
try:
    font = ImageFont.load_default()
except:
    font = ImageFont.load_default()

# Sample text with multiple words
text = "The quick brown fox jumps over the lazy dog and continues with more words"

# Maximum width for wrapping (in pixels)
max_width = 200

ARGS = {
    'draw': draw,
    'text': text,
    'font': font,
    'max_width': max_width
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
PIL — 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
prompt2tokens Ran
ran; our contract draft was wrong, not the code
byliutao/1Prompt1Story/unet/utils.py
code served (permissive licence) · get_code("b0b3e07f83915937")
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 torch
import torch.nn as nn

torch.manual_seed(0)

class MockTokenizer:
    def __init__(self):
        self.model_max_length = 10
        # Create a simple decoder mapping token IDs to token strings
        self.decoder = {
            0: "[PAD]",
            1: "hello",
            2: "world",
            3: "test",
            4: "token",
            5: "[UNK]",
            6: "foo",
            7: "bar",
            8: "baz",
            9: "qux",
        }
    
    def __call__(self, prompt, padding=None, max_length=None, truncation=None, return_tensors=None):
        # Return a simple mock object with input_ids tensor
        # Create a batch of token IDs
        token_ids = torch.tensor([[1, 2, 3, 0, 0, 0, 0, 0, 0, 0]])
        
        class TokenizerOutput:
            def __init__(self, ids):
                self.input_ids = ids
        
        return TokenizerOutput(token_ids)

tokenizer = MockTokenizer()
prompt = "hello world test"

ARGS = {
    "tokenizer": tokenizer,
    "prompt": prompt,
}
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, 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
apply_embeds_mask Not yet run
unverified (harvested, no recorded run)
byliutao/1Prompt1Story/unet/utils.py
code served (permissive licence) · get_code("3d5030270e5e8fbc")
How it ran

no invocation recorded.

Also present in other papers' code

Of 18 samples lifted from this paper's linked repositories, 18 carry a function identity and 0 do not. Of the 18 distinct functions with an identity, 7 are also present in other papers whose code we hold (7 with at least one paper dated earlier, 0 the same month, 0 later) and 11 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
add_caption 1 other paper
1 dated earlier
2405.01434 (2024-05)
StoryDiffusion: Consistent Self-Attention for Long-Range Image and Video Generation
add_white_border 1 other paper
1 dated earlier
2405.01434 (2024-05)
StoryDiffusion: Consistent Self-Attention for Long-Range Image and Video Generation
cal_attn_indice_xl_effcient_memory 1 other paper
1 dated earlier
2405.01434 (2024-05)
StoryDiffusion: Consistent Self-Attention for Long-Range Image and Video Generation
cal_attn_mask 1 other paper
1 dated earlier
2405.01434 (2024-05)
StoryDiffusion: Consistent Self-Attention for Long-Range Image and Video Generation
cal_attn_mask_xl 1 other paper
1 dated earlier
2405.01434 (2024-05)
StoryDiffusion: Consistent Self-Attention for Long-Range Image and Video Generation
get_image_path_list 1 other paper
1 dated earlier
2405.01434 (2024-05)
StoryDiffusion: Consistent Self-Attention for Long-Range Image and Video Generation
process_mulline_text 1 other paper
1 dated earlier
2405.01434 (2024-05)
StoryDiffusion: Consistent Self-Attention for Long-Range Image and Video Generation

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

Consistent text-to-image (T2I) generation seeks to produce identity-preserving images of the same subject across diverse scenes, yet it often fails due to a phenomenon called identity (ID) shift. Previous methods have tackled this issue, but typically rely on the unrealistic assumption of knowing all target scenes in advance. This paper reveals that a key source of ID shift is the native correlation between subject and scene context, called scene contextualization, which arises naturally as T2I models fit the training distribution of vast natural images. We formally prove the near-universality of this scene-ID correlation and derive theoretical bounds on its strength. On this basis, we propose a novel, efficient, training-free prompt embedding editing approach, called Scene De-Contextualization (SDeC), that imposes an inversion process of T2I's built-in scene contextualization. Specifically, it identifies and suppresses the latent scene-ID correlation within the ID prompt's embedding by quantifying SVD directional stability to adaptively re-weight the corresponding eigenvalues. Critically, SDeC allows for per-scene use (one scene per prompt) without requiring prior access to all target scenes. This makes it a highly flexible and general solution well-suited to real-world applications where such prior knowledge is often unavailable or varies over time. Experiments show that SDeC markedly enhances identity preservation while maintaining scene diversity.

For agents

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

get_harvested_code_for_paper("2510.14553")
get_code_for_paper("2510.14553")
have("2510.14553")

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

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

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

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

Connect an agent — have() is free.