SYNTOLOGY HomeExplorerAtlasCodeMethodologyAboutDevelopersFeedPricing
Paper · 2203.15799 · CVPR · 2022

StyleT2I: Toward Compositional and High-Fidelity Text-to-Image Synthesis

Kai Li, Chenliang Xu, Zhiheng Li, Martin Min, Nec America

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, 1 violated it and 2 have no contract verdict; 2 failures of our instrument; 0 no recorded run), measured 2026-11-22; 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/2203.15799.json · badge: /api/ran/2203.15799.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
zhihengli-UR/StyleT2I canonical (classifier label)
classifier basis not recorded on the link
5 ran · 0 no recorded run
FunctionStatusWhere it lives
d_logistic_loss Ran
ran; our contract draft was wrong, not the code
zhihengli-UR/StyleT2I/pretrain_stylegan2.py
code served (permissive licence) · get_code("3651db4e5ae8d189")
How it ran

Ran in Syntology's sandbox on this synthesized input (drafted by a language model, Claude Sonnet 4.5, prompt python_fixture_v1) and returned Tensor, ndim 0, dtype family float, 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

torch.manual_seed(0)

# Create predictions from discriminator for real and fake samples
# These are typically logits (unbounded real values)
# Shape: (batch_size,) or (batch_size, 1) - using (batch_size,) for simplicity
real_pred = torch.randn(2)  # batch size 2
fake_pred = torch.randn(2)  # batch size 2

ARGS = {
    'real_pred': real_pred,
    'fake_pred': fake_pred
}
Setup block drafted by
a language model, Claude Sonnet 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 Tensor, ndim 0, dtype family float, 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
data_sampler Ran
ran; our contract draft was wrong, not the code
zhihengli-UR/StyleT2I/pretrain_stylegan2.py
code served (permissive licence) · get_code("dbb756dcd778f52f")
How it ran

Ran in Syntology's sandbox on this synthesized input (drafted by a language model, Claude Sonnet 4.5, prompt python_fixture_v1) and returned RandomSampler. 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 torch.utils import data

torch.manual_seed(0)

# Create a simple dataset
class SimpleDataset(data.Dataset):
    def __init__(self, size=10):
        self.size = size
        self.data = torch.randn(size, 4)
        self.labels = torch.randint(0, 2, (size,))
    
    def __len__(self):
        return self.size
    
    def __getitem__(self, idx):
        return self.data[idx], self.labels[idx]

dataset = SimpleDataset(size=10)
shuffle = True
distributed = False

ARGS = {
    'dataset': dataset,
    'shuffle': shuffle,
    'distributed': distributed
}
Setup block drafted by
a language model, Claude Sonnet 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 RandomSampler — a RandomSampler output has no array shape of its own; none is stated — the instrument coerces any output to an array; for a RandomSampler 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
differentiable_clip_preprocess_from_stylegan Ran
ran on a synthesized input
zhihengli-UR/StyleT2I/utils.py
code served (permissive licence) · get_code("00b4f73801b989bc")
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, 3, 224, 224) 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 torchvision.transforms.functional as tvf

torch.manual_seed(0)

# Create a small image tensor
# StyleGAN outputs images in range [-1, 1], so we create a tensor in that range
# Shape: (batch=2, channels=3, height=4, width=4)
img = torch.randn(2, 3, 4, 4)

# CLIP visual size - a common size is 224x224
clip_visual_size = 224

ARGS = {
    "img": img,
    "clip_visual_size": clip_visual_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 Tensor, ndim 4, dtype family float, shape (2, 3, 224, 224) — shape (2, 3, 224, 224) 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
make_kernel Ran
ran, violated the contract we drafted
zhihengli-UR/StyleT2I/model/stylegan2/model.py
pointer only (licence: BSD-2-Clause); the stored copy get_code serves, from dkn16/multi-fidel-gan-21cm, is pointer only (licence: NOASSERTION) · get_code("6f65e378a4313f87")
How it ran

The body of this sample is withheld: this paper's link allows the body inline (BSD-2-Clause), but get_code serves the stored copy, first harvested from dkn16/multi-fidel-gan-21cm, 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.

pad_text_seq_collate Ran
ran on a synthesized input
zhihengli-UR/StyleT2I/dataset/data_utils.py
code served (permissive licence) · get_code("ce190032cd9b11db")
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 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
from torch.utils.data._utils.collate import default_collate

torch.manual_seed(0)

# Create sample data dictionaries with word_embeds
dict_lst = [
    {
        'word_embeds': torch.randn(5, 4),  # sequence length 5, embedding dim 4
        'label': torch.tensor(1),
        'filename': 'file1.txt'
    },
    {
        'word_embeds': torch.randn(3, 4),  # sequence length 3, embedding dim 4
        'label': torch.tensor(0),
        'filename': 'file2.txt'
    }
]

ARGS = {
    'dict_lst': dict_lst
}
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 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

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, 3 are also present in other papers whose code we hold (3 with at least one paper dated earlier, 3 the same month, 3 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
make_kernel 40 other papers
19 dated earlier, 4 the same month, 17 later · 10 only as an assembly brick
1812.04948 (2018-12)
A Style-Based Generator Architecture for Generative Adversarial Networks
1912.04958 (2019-12)
Analyzing and Improving the Image Quality of StyleGAN
2007.06600 (2020-07)
Closed-Form Factorization of Latent Semantics in GANs
and 37 more not named here
data_sampler 13 other papers
6 dated earlier, 3 the same month, 4 later
1912.04958 (2019-12)
Analyzing and Improving the Image Quality of StyleGAN
2001.04296 (2020-01)
High-Fidelity Synthesis with Disentangled Representation
2008.00951 (2020-08)
Encoding in Style: a StyleGAN Encoder for Image-to-Image Translation
and 10 more not named here
d_logistic_loss 12 other papers
5 dated earlier, 4 the same month, 3 later
1910.05852 (2019-10)
Implicit competitive regularization in GANs
1912.04958 (2019-12)
Analyzing and Improving the Image Quality of StyleGAN
2001.04296 (2020-01)
High-Fidelity Synthesis with Disentangled Representation
and 9 more not named here

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

Although progress has been made for text-to-image synthesis, previous methods fall short of generalizing to unseen or underrepresented attribute compositions in the input text. Lacking compositionality could have severe implications for robustness and fairness, e.g., inability to synthesize the face images of underrepresented demographic groups. In this paper, we introduce a new framework, StyleT2I, to improve the compositionality of text-to-image synthesis. Specifically, we propose a CLIP-guided Contrastive Loss to better distinguish different compositions among different sentences. To further improve the compositionality, we design a novel Semantic Matching Loss and a Spatial Constraint to identify attributes' latent directions for intended spatial region manipulations, leading to better disentangled latent representations of attributes. Based on the identified latent directions of attributes, we propose Compositional Attribute Adjustment to adjust the latent code, resulting in better compositionality of image synthesis. In addition, we leverage the ℓ 2 -norm regularization of identified latent directions (norm penalty) to strike a nice balance between image-text alignment and image fidelity. In the experiments, we devise a new dataset split and an evaluation metric to evaluate the compositionality of text-to-image synthesis models. The results show that StyleT2I outperforms previous approaches in terms of the consistency between the input text and synthesized images and achieves higher fidelity.

For agents

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

get_harvested_code_for_paper("2203.15799")
get_code_for_paper("2203.15799")
have("2203.15799")

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

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

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

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

Connect an agent — have() is free.