SYNTOLOGY HomeExplorerAtlasCodeMethodologyAboutDevelopersFeedPricing
Paper · 2103.17249 · ICCV · 2021

StyleCLIP: Text-Driven Manipulation of StyleGAN Imagery

Eli Shechtman, Dani Lischinski, Zongze Wu, Or Patashnik, Daniel Cohen-Or

arXiv · PDF · Open in the Atlas

Code that ran

7 of 11 samples (functions and classes) lifted from this paper's linked repositories executed on a synthesized input in Syntology's jail (6 of them constructed an object rather than computing a result; 0 honoured the contract we drafted, 0 violated it and 6 have no contract verdict; 1 failure of our instrument; 4 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/2103.17249.json · badge: /api/ran/2103.17249.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
futscdav/Chunkmogrify community
Papers with Code archive
4 ran · 0 no recorded run
orpatashnik/StyleCLIP marked official in Papers with Code
Papers with Code archive
2 ran · 4 no recorded run
copy not recorded community
not in the paper's declared repositories
1 ran · 0 no recorded run
FunctionStatusWhere it lives
EqualLinear Ran
ran on a synthesized input · constructed an object; no result was computed
orpatashnik/StyleCLIP/mapper/styleclip_mapper.py
code served (permissive licence) · get_code("4f91f5287f2bccb5")
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, EqualLinear: 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
from torch import nn

torch.manual_seed(0)

ARGS = {
    "in_dim": 4,
    "out_dim": 3,
    "bias": True,
    "bias_init": 0.0,
    "lr_mul": 1.0,
    "activation": None,
}
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 EqualLinear — 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 EqualLinear 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
LevelsMapper Ran
ran on a synthesized input · constructed an object; no result was computed
futscdav/Chunkmogrify/styleclip_mapper.py
code served (permissive licence) · get_code("5af8549bf22e22cd")
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, LevelsMapper: the run constructed the object and did not call it, so no result was computed. 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 math
from torch import nn

torch.manual_seed(0)

# Define the helper function and classes needed
def fused_leaky_relu(input, bias, negative_slope=0.2, scale=2 ** 0.5):
    rest_dim = [1] * (input.ndim - bias.ndim - 1)
    if input.ndim == 3:
        return nn.functional.leaky_relu(input + bias.view(1, *rest_dim, bias.shape[0]), negative_slope=negative_slope) * scale
    else:
        return nn.functional.leaky_relu(input + bias.view(1, bias.shape[0], *rest_dim), negative_slope=negative_slope) * scale

class PixelNorm(nn.Module):
    def __init__(self):
        super().__init__()

    def forward(self, input):
        return input * torch.rsqrt(torch.mean(input ** 2, dim=1, keepdim=True) + 1e-08)

class EqualLinear(nn.Module):
    def __init__(self, in_dim, out_dim, bias=True, bias_init=0, lr_mul=1, activation=None):
        super().__init__()
        self.weight = nn.Parameter(torch.randn(out_dim, in_dim).div_(lr_mul))
        if bias:
            self.bias = nn.Parameter(torch.zeros(out_dim).fill_(bias_init))
        else:
            self.bias = None
        self.activation = activation
        self.scale = 1 / math.sqrt(in_dim) * lr_mul
        self.lr_mul = lr_mul

    def forward(self, input):
        if self.activation:
            out = nn.functional.linear(input, self.weight * self.scale)
            out = fused_leaky_relu(out, self.bias * self.lr_mul)
        else:
            out = nn.functional.linear(input, self.weight * self.scale, bias=self.bias * self.lr_mul)
        return out

    def __repr__(self):
        return f'{self.__class__.__name__}({self.weight.shape[1]}, {self.weight.shape[0]})'

class Mapper(nn.Module):
    def __init__(self, opts):
        super(Mapper, self).__init__()
        self.opts = opts
        layers = [PixelNorm()]
        for i in range(4):
            layers.append(EqualLinear(512, 512, lr_mul=0.01, activation='fused_lrelu'))
        self.mapping = nn.Sequential(*layers)

    def forward(self, x):
        x = self.mapping(x)
        return x

class LevelsMapper(nn.Module):
    def __init__(self, opts):
        super(LevelsMapper, self).__init__()
        self.opts = opts
        if not opts.no_coarse_mapper:
            self.course_mapping = Mapper(opts)
        if not opts.no_medium_mapper:
            self.medium_mapping = Mapper(opts)
        if not opts.no_fine_mapper:
            self.fine_mapping = Mapper(opts)

    def forward(self, x):
        x_coarse = x[:, :4, :]
        x_medium = x[:, 4:8, :]
        x_fine = x[:, 8:, :]
        if not self.opts.no_coarse_mapper:
            x_coarse = self.course_mapping(x_coarse)
        else:
            x_coarse = torch.zeros_like(x_coarse)
        if not self.opts.no_medium_mapper:
            x_medium = self.medium_mapping(x_medium)
        else:
            x_medium = torch.zeros_like(x_medium)
        if not self.opts.no_fine_mapper:
            x_fine = self.fine_mapping(x_fine)
        else:
            x_fine = torch.zeros_like(x_fine)
        out = torch.cat([x_coarse, x_medium, x_fine], dim=1)
        return out

# Create a simple options object
class SimpleOpts:
    def __init__(self):
        self.no_coarse_mapper = False
        self.no_medium_mapper = False
        self.no_fine_mapper = False

opts = SimpleOpts()

ARGS = {
    'opts': opts
}
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 LevelsMapper — 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 LevelsMapper 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
Mapper Ran
ran on a synthesized input · constructed an object; no result was computed
futscdav/Chunkmogrify/styleclip_mapper.py
code served (permissive licence) · get_code("d125a9b4a7b263b1")
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, Mapper: the run constructed the object and did not call it, so no result was computed. 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 torch.nn import Module

torch.manual_seed(0)

# Define a minimal opts class/dict that the Mapper uses
class OptsStandIn:
    def __init__(self):
        pass

opts = OptsStandIn()

# Create ARGS dict with the single parameter that Mapper.__init__ expects
ARGS = {
    'opts': opts
}
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 Mapper — 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 Mapper 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
ModulatedConv2d Ran
ran on a synthesized input · constructed an object; no result was computed
orpatashnik/StyleCLIP/mapper/styleclip_mapper.py
code served (permissive licence) · get_code("b398ec20195c1d95")
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, ModulatedConv2d: 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
from torch import nn
import math

torch.manual_seed(0)

ARGS = {
    'in_channel': 3,
    'out_channel': 4,
    'kernel_size': 3,
    'style_dim': 8,
    'demodulate': True,
    'upsample': False,
    'downsample': False,
    'blur_kernel': [1, 3, 3, 1]
}
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 ModulatedConv2d — 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 ModulatedConv2d 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
SingleMapper Ran
ran on a synthesized input · constructed an object; no result was computed
futscdav/Chunkmogrify/styleclip_mapper.py
code served (permissive licence) · get_code("74dccf57f42f8ea1")
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, SingleMapper: the run constructed the object and did not call it, so no result was computed. 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
import math

torch.manual_seed(0)

class MockOpts:
    def __init__(self):
        self.latent_dim = 512
        self.n_mlp = 4

ARGS = {
    "opts": MockOpts()
}
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 SingleMapper — 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 SingleMapper 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
StyleCLIPMapper Ran
ran on a synthesized input · constructed an object; no result was computed
futscdav/Chunkmogrify/styleclip_mapper.py
code served (permissive licence) · get_code("c77809a5b3af62c6")
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, StyleCLIPMapper: the run constructed the object and did not call it, so no result was computed. 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 torch.nn import Module

torch.manual_seed(0)

class SimpleOpts:
    def __init__(self):
        self.mapper_type = 'SingleMapper'
        self.no_coarse_mapper = False
        self.no_medium_mapper = False
        self.no_fine_mapper = False
        self.checkpoint_path = None

opts = SimpleOpts()

ARGS = {
    'opts': opts
}
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 StyleCLIPMapper — 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 StyleCLIPMapper 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
get_keys Ran
ran; our contract draft was wrong, not the code
this paper's copy was not recorded; identical code first harvested from futscdav/Chunkmogrify
pointer only · get_code("29b9a890f149a3a6")
How it ran

The body of this sample is withheld: this paper's copy of the code was not recorded (its link names no repository or source path), so no licence was read for it. 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.

Generator Not yet run
unverified (harvested, no recorded run)
orpatashnik/StyleCLIP/mapper/styleclip_mapper.py
code served (permissive licence) · get_code("ebb80a3f61cb7a50")
How it ran

no invocation recorded.

StyleCLIPMapper Not yet run
unverified (harvested, no recorded run)
orpatashnik/StyleCLIP/mapper/styleclip_mapper.py
code served (permissive licence) · get_code("7a9530e00278c641")
How it ran

no invocation recorded.

StyledConv Not yet run
unverified (harvested, no recorded run)
orpatashnik/StyleCLIP/mapper/styleclip_mapper.py
code served (permissive licence) · get_code("8f3b9dd81d86b5eb")
How it ran

no invocation recorded.

ToRGB Not yet run
unverified (harvested, no recorded run)
orpatashnik/StyleCLIP/mapper/styleclip_mapper.py
code served (permissive licence) · get_code("bc13e5e23103e209")
How it ran

no invocation recorded.

Also present in other papers' code

Of 11 samples lifted from this paper's linked repositories, 11 carry a function identity and 0 do not. Of the 11 distinct functions with an identity, 6 are also present in other papers whose code we hold (6 with at least one paper dated earlier, 0 the same month, 6 later) and 5 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
get_keys
brick of this paper's assembly: helper
14 other papers
2 dated earlier, 12 later
2008.00951 (2020-08)
Encoding in Style: a StyleGAN Encoder for Image-to-Image Translation
2011.12799 (2020-11)
StyleSpace Analysis: Disentangled Controls for StyleGAN Image Generation
2112.05142 (2021-12)
HairCLIP: Design Your Hair by Text and Reference Image
and 11 more not named here
EqualLinear
brick of this paper's assembly: helper, model
8 other papers
2 dated earlier, 6 later
1812.04948 (2018-12)
A Style-Based Generator Architecture for Generative Adversarial Networks
2101.02477 (2021-01)
GAN-Control: Explicitly Controllable GANs
2104.02699 (2021-04)
ReStyle: A Residual-Based StyleGAN Encoder via Iterative Refinement
and 5 more not named here
Generator
brick of this paper's assembly: helper
2 other papers
1 dated earlier, 1 later
1812.04948 (2018-12)
A Style-Based Generator Architecture for Generative Adversarial Networks
2306.13091 (2023-06)
Evading Forensic Classifiers with Attribute-Conditioned Adversarial Faces
ModulatedConv2d
brick of this paper's assembly: helper
2 other papers
1 dated earlier, 1 later
1812.04948 (2018-12)
A Style-Based Generator Architecture for Generative Adversarial Networks
2306.13091 (2023-06)
Evading Forensic Classifiers with Attribute-Conditioned Adversarial Faces
StyledConv
brick of this paper's assembly: helper
2 other papers
1 dated earlier, 1 later
1812.04948 (2018-12)
A Style-Based Generator Architecture for Generative Adversarial Networks
2306.13091 (2023-06)
Evading Forensic Classifiers with Attribute-Conditioned Adversarial Faces
ToRGB
brick of this paper's assembly: helper
2 other papers
1 dated earlier, 1 later
1812.04948 (2018-12)
A Style-Based Generator Architecture for Generative Adversarial Networks
2306.13091 (2023-06)
Evading Forensic Classifiers with Attribute-Conditioned Adversarial Faces

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

Mohawk hairstyle" "Without makeup" "Cute cat" "Lion" "Gothic church" Figure 1. Examples of text-driven manipulations using StyleCLIP. Top row: input images; Bottom row: our manipulated results. The text prompt used to drive each manipulation appears under each column.

For agents

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

get_harvested_code_for_paper("2103.17249")
get_code_for_paper("2103.17249")
have("2103.17249")

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

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

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

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

Connect an agent — have() is free.