SYNTOLOGY HomeExplorerAtlasCodeMethodologyAboutDevelopersFeedPricing
Paper · 2312.02212 · 2023

Portrait Diffusion: Training-free Face Stylization with Chain-of-Painting

arXiv · PDF · Open in the Atlas

Code that ran

2 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 0 have no contract verdict; 1 failure of our instrument; 3 no recorded run), measured 2026-11-23; 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/2312.02212.json · badge: /api/ran/2312.02212.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
liujin112/portraitdiffusion canonical (classifier label)
classifier basis: census
2 ran · 3 no recorded run
FunctionStatusWhere it lives
Fourier_filter Ran
ran; the contract check could not run (RAISES, DEP_MISSING or TIMEOUT)
liujin112/portraitdiffusion/utils/free_lunch_utils.py
code served (permissive licence) · get_code("63e5469c687a88a7")
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 Tensor, ndim 4, dtype family float; no output shape is stated. 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 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.fft as fft

torch.manual_seed(0)

# Create a small input tensor with shape (B, C, H, W)
# B=2 (batch), C=3 (channels), H=4, W=5 (spatial dims - distinct sizes)
x = torch.randn(2, 3, 4, 5, dtype=torch.float32)

# threshold: controls the size of the low-frequency region to scale
threshold = 1

# scale: the scaling factor to apply to the low-frequency mask
scale = 0.5

ARGS = {
    "x": x,
    "threshold": threshold,
    "scale": scale,
}
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 Tensor, ndim 4, dtype family float — no output shape is stated: observe_signature.py could not observe it (call:AssertionError)
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
isinstance_str Ran
ran, violated the contract we drafted
liujin112/portraitdiffusion/utils/free_lunch_utils.py
code served (permissive licence) · get_code("cd5d5067de871c97")
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 bool, 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
import torch.nn as nn

torch.manual_seed(0)

# Create a simple object to test isinstance_str
class CustomClass:
    pass

class DerivedClass(CustomClass):
    pass

# Create an instance of DerivedClass
obj = DerivedClass()

# Test with a class name that exists in the MRO
cls_name_valid = "DerivedClass"

# Test with a class name that exists in parent MRO
cls_name_parent = "CustomClass"

# Test with a class name that doesn't exist
cls_name_invalid = "NonExistentClass"

# Also test with built-in types
tensor = torch.randn(2, 4)
cls_name_tensor = "Tensor"

# Construct ARGS for the function
ARGS = {
    "x": obj,
    "cls_name": cls_name_valid
}
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 bool, 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
register_upblock2d Not yet run
unverified (harvested, no recorded run)
liujin112/portraitdiffusion/utils/free_lunch_utils.py
code served (permissive licence) · get_code("2464a3bfcf2ba82f")
How it ran

no invocation recorded.

regiter_attention_editor_diffusers Not yet run
unverified (harvested, no recorded run)
liujin112/portraitdiffusion/utils/masactrl_utils.py
code served (permissive licence) · get_code("d321812b8f73ef4b")
How it ran

no invocation recorded.

regiter_attention_editor_ldm Not yet run
unverified (harvested, no recorded run)
liujin112/portraitdiffusion/utils/masactrl_utils.py
code served (permissive licence) · get_code("431f768e76ae86fa")
How it ran

no invocation recorded.

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, 4 are also present in other papers whose code we hold (4 with at least one paper dated earlier, 1 the same month, 4 later) and 1 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
isinstance_str 10 other papers
2 dated earlier, 1 the same month, 7 later
2303.17604 (2023-03)
Token Merging for Fast Stable Diffusion
2307.10373 (2023-07)
TokenFlow: Consistent Diffusion Features for Consistent Video Editing
2312.10656 (2023-12)
VidToMe: Video Token Merging for Zero-Shot Video Editing
and 7 more not named here
regiter_attention_editor_ldm 4 other papers
2 dated earlier, 2 later
2304.08465 (2023-04)
MasaCtrl: Tuning-Free Mutual Self-Attention Control for Consistent Image Synthesis and Editing
2311.16491 (2023-11)
$Z^*$: Zero-shot Style Transfer via Attention Rearrangement
2407.17850 (2024-07)
FlexiEdit: Frequency-Aware Latent Refinement for Enhanced Non-Rigid Editing
and 1 more not named here
Fourier_filter 3 other papers
1 dated earlier, 2 later
2306.08645 (2023-06)
Training-free Diffusion Model Adaptation for Variable-Sized Text-to-Image Synthesis
2404.01050 (2024-04)
Drag Your Noise: Interactive Point-based Editing via Diffusion Semantic Propagation
2607.09753 (2026-07)
Unified Backbone Refinement for Diffusion Models via Internal-Latent Analysis
regiter_attention_editor_diffusers 3 other papers
2 dated earlier, 1 later
2304.08465 (2023-04)
MasaCtrl: Tuning-Free Mutual Self-Attention Control for Consistent Image Synthesis and Editing
2311.16491 (2023-11)
$Z^*$: Zero-shot Style Transfer via Attention Rearrangement
2412.12974 (2024-12)
Attentive Eraser: Unleashing Diffusion Model's Object Removal Potential via Self-Attention Redirection 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-23.

Repositories linked to this paper

Some links come from the archived Papers with Code dataset (CC BY-SA 4.0): attribution and licence.

Abstract

Face stylization refers to the transformation of a face into a specific portrait style. However, current methods require the use of example-based adaptation approaches to fine-tune pre-trained generative models so that they demand lots of time and storage space and fail to achieve detailed style transformation. This paper proposes a training-free face stylization framework, named Portrait Diffusion. This framework leverages off-the-shelf text-to-image diffusion models, eliminating the need for fine-tuning specific examples. Specifically, the content and style images are first inverted into latent codes. Then, during image reconstruction using the corresponding latent code, the content and style features in the attention space are delicately blended through a modified self-attention operation called Style Attention Control. Additionally, a Chain-of-Painting method is proposed for the gradual redrawing of unsatisfactory areas from rough adjustments to fine-tuning. Extensive experiments validate the effectiveness of our Portrait Diffusion method and demonstrate the superiority of Chain-of-Painting in achieving precise face stylization. Code will be released at \url{https://github.com/liujin112/PortraitDiffusion}.

For agents

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

get_harvested_code_for_paper("2312.02212")
get_code_for_paper("2312.02212")
have("2312.02212")

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

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

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

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

Connect an agent — have() is free.