SYNTOLOGY HomeExplorerAtlasCodeMethodologyAboutDevelopersFeedPricing
Paper · 2408.05939 · 2024

UniPortrait: A Unified Framework for Identity-Preserving Single- and Multi-Human Image Personalization

arXiv · PDF · Open in the Atlas

Code that ran

10 of 13 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; 2 honoured the contract we drafted, 0 violated it and 0 have no contract verdict; 8 failures of our instrument; 3 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/2408.05939.json · badge: /api/ran/2408.05939.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
junjiehe96/UniPortrait canonical (classifier label)
classifier basis: census
10 ran · 3 no recorded run
FunctionStatusWhere it lives
FeedForward Ran
ran; our contract draft was wrong, not the code
junjiehe96/UniPortrait/uniportrait/resampler.py
pointer only (licence: Apache-2.0); the stored copy get_code serves, from rainbowluocs/openomni, is pointer only (licence: NONE) · get_code("5105747c2711b1cb")
How it ran

The body of this sample is withheld: this paper's link allows the body inline (Apache-2.0), but get_code serves the stored copy, first harvested from rainbowluocs/openomni, and GitHub detected no licence in that repository when it was checked. 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.

calc_mean_std Ran
ran; our contract draft was wrong, not the code
junjiehe96/UniPortrait/uniportrait/uniportrait_attention_processor.py
code served (permissive licence) · get_code("8199644cda7be3f8")
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, ndim 4, 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)

# The function calc_mean_std takes a tensor 'feat' and an optional eps parameter.
# It computes variance and mean along dim=-2 with keepdims=True.
# We need a tensor with at least 2 dimensions where dim=-2 makes sense.

# Create a small tensor: shape (2, 4, 3) so dim=-2 has size 4
feat = torch.randn(2, 4, 3)

# eps is a float with default value 1e-05
eps = 1e-05

ARGS = {
    "feat": feat,
    "eps": eps,
}
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, ndim 4, dtype family float — a tuple 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
concat_first Ran
ran; our contract draft was wrong, not the code
junjiehe96/UniPortrait/uniportrait/uniportrait_attention_processor.py
code served (permissive licence) · get_code("c4afd0b290a76c97")
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, 4, 6, 3) 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 small feature tensor with shape (batch=2, channels=4, height=3, width=3)
# This satisfies the function's needs:
# - feat.shape[0] = 2 (batch size)
# - feat[0] and feat[b//2] access first and middle elements
# - The function reshapes to feat.shape at the end
feat = torch.randn(2, 4, 3, 3)

ARGS = {
    "feat": feat,
    "dim": 2,
    "scale": 1.0,
}
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, 4, 6, 3) — shape (2, 4, 6, 3) 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
conv1x1 Ran
ran; our contract draft was wrong, not the code
junjiehe96/UniPortrait/uniportrait/curricular_face/backbone/model_resnet.py
code served (permissive licence) · get_code("85a6d411e524efe4")
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 Conv2d. 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.nn import Conv2d

torch.manual_seed(0)

ARGS = {
    "in_planes": 3,
    "out_planes": 64,
    "stride": 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 Conv2d — a Conv2d output has no array shape of its own; none is stated — the instrument coerces any output to an array; for a Conv2d 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
conv3x3 Ran
ran; our contract draft was wrong, not the code
junjiehe96/UniPortrait/uniportrait/curricular_face/backbone/model_resnet.py
code served (permissive licence) · get_code("6ccc5338f47a440c")
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 Conv2d. 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.nn import Conv2d

torch.manual_seed(0)

ARGS = {
    "in_planes": 3,
    "out_planes": 64,
    "stride": 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 Conv2d — a Conv2d output has no array shape of its own; none is stated — the instrument coerces any output to an array; for a Conv2d 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
expand_first Ran
ran; our contract draft was wrong, not the code
junjiehe96/UniPortrait/uniportrait/uniportrait_attention_processor.py
code served (permissive licence) · get_code("5801f24662e9253a")
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, 4, 3, 3) 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 small feature tensor with batch size 2 and feature dimensions
# The function expects:
# - feat.shape[0] to be the batch dimension (b)
# - feat to be indexable and support stack/expand/repeat operations
# - The function uses feat[0], feat[b//2], and feat.shape[1:]

feat = torch.randn(2, 4, 3, 3)  # batch=2, channels=4, spatial=3x3

ARGS = {
    "feat": feat,
    "scale": 1.0
}
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, 4, 3, 3) — shape (2, 4, 3, 3) 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_block Ran
ran, honoured the contract we drafted
junjiehe96/UniPortrait/uniportrait/curricular_face/backbone/model_irse.py
code served (permissive licence) · get_code("ad5dbf57f3ea2633")
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 list, ndim 2, dtype family int; 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
from collections import namedtuple

torch.manual_seed(0)

# The function get_block takes in_channel, depth, num_units, and stride
# It returns a list of Bottleneck namedtuples

ARGS = {
    'in_channel': 64,
    'depth': 128,
    'num_units': 3,
    'stride': 2
}
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 list, ndim 2, dtype family int — 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_blocks Ran
ran, honoured the contract we drafted
junjiehe96/UniPortrait/uniportrait/curricular_face/backbone/model_irse.py
pointer only (licence: Apache-2.0); the stored copy get_code serves, from Armxyz1/Results-on-RFW, is pointer only (licence: NONE) · get_code("e82dfb7d2386721b")
How it ran

The body of this sample is withheld: this paper's link allows the body inline (Apache-2.0), but get_code serves the stored copy, first harvested from Armxyz1/Results-on-RFW, and GitHub detected no licence in that repository when it was checked. 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_np_bgr_image Ran
ran; the contract check could not run (RAISES, DEP_MISSING or TIMEOUT)
junjiehe96/UniPortrait/gradio_app.py
code served (permissive licence) · get_code("faa0bfdfc22e317b")
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. 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 numpy as np
import cv2

# Create a small BGR image (numpy array with 3 channels for BGR)
# Using a small 10x8 image to keep it tiny
np_image = np.random.randint(0, 256, (10, 8, 3), dtype=np.uint8)

ARGS = {
    'np_image': np_image,
    'scale': 1.25
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
cv2, numpy — 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
reshape_tensor Ran
ran; the contract check could not run (RAISES, DEP_MISSING or TIMEOUT)
junjiehe96/UniPortrait/uniportrait/resampler.py
pointer only (licence: Apache-2.0); the stored copy get_code serves, from Minyeol/MIDAS, is pointer only (licence: NONE) · get_code("4cb2e2a2ca0bec9f")
How it ran

The body of this sample is withheld: this paper's link allows the body inline (Apache-2.0), but get_code serves the stored copy, first harvested from Minyeol/MIDAS, and GitHub detected no licence in that repository when it was checked. 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.

IR_18 Not yet run
unverified (harvested, no recorded run)
junjiehe96/UniPortrait/uniportrait/curricular_face/backbone/model_irse.py
code served (permissive licence) · get_code("23fbd627704303f2")
How it ran

no invocation recorded.

ResNet_50 Not yet run
unverified (harvested, no recorded run)
junjiehe96/UniPortrait/uniportrait/curricular_face/backbone/model_resnet.py
code served (permissive licence) · get_code("d6583b15d8a7722f")
How it ran

no invocation recorded.

inference Not yet run
unverified (harvested, no recorded run)
junjiehe96/UniPortrait/uniportrait/curricular_face/inference.py
code served (permissive licence) · get_code("6524b18732973287")
How it ran

no invocation recorded.

Also present in other papers' code

Of 13 samples lifted from this paper's linked repositories, 13 carry a function identity and 0 do not. Of the 13 distinct functions with an identity, 10 are also present in other papers whose code we hold (8 with at least one paper dated earlier, 1 the same month, 9 later) and 3 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
FeedForward 47 other papers
22 dated earlier, 1 the same month, 23 later, 1 same year, order not determinable · 4 only as an assembly brick
2204.14198 (2022-04)
Flamingo: a Visual Language Model for Few-Shot Learning
2308.02463 (2023-08)
Towards Generalist Foundation Model for Radiology by Leveraging Web-scale 2D&3D Medical Data
2308.06721 (2023-08)
IP-Adapter: Text Compatible Image Prompt Adapter for Text-to-Image Diffusion Models
and 44 more not named here
reshape_tensor 30 other papers
15 dated earlier, 15 later
2308.06721 (2023-08)
IP-Adapter: Text Compatible Image Prompt Adapter for Text-to-Image Diffusion Models
2312.04461 (2023-12)
PhotoMaker: Customizing Realistic Human Photos via Stacked ID Embedding
2312.16693 (2023-12)
I2V-Adapter: A General Image-to-Video Adapter for Diffusion Models
and 27 more not named here
get_block 27 other papers
22 dated earlier, 4 later, 1 same year, order not determinable
1804.07573 (2018-04)
MobileFaceNets: Efficient CNNs for Accurate Real-Time Face Verification on Mobile Devices
1903.08527 (2019-03)
Accurate 3D Face Reconstruction with Weakly-Supervised Learning: From Single Image to Image Set
1907.10830 (2019-07)
U-GAT-IT: Unsupervised Generative Attentional Networks with Adaptive Layer-Instance Normalization for Image-to-Image Translation
and 24 more not named here
conv3x3 9 other papers
6 dated earlier, 2 later, 1 same year, order not determinable
2001.06838 (2020-01)
Towards Stabilizing Batch Statistics in Backward Propagation of Batch Normalization
2004.00288 (2020-04)
CurricularFace: Adaptive Curriculum Learning Loss for Deep Face Recognition
2107.08621 (2021-07)
Face.evoLVe: A High-Performance Face Recognition Library
and 6 more not named here
conv1x1 8 other papers
7 dated earlier, 1 later
2001.06838 (2020-01)
Towards Stabilizing Batch Statistics in Backward Propagation of Batch Normalization
2004.00288 (2020-04)
CurricularFace: Adaptive Curriculum Learning Loss for Deep Face Recognition
2008.04115 (2020-08)
T-GD: Transferable GAN-generated Images Detection Framework
and 5 more not named here
ResNet_50 4 other papers
3 dated earlier, 1 later
2004.00288 (2020-04)
CurricularFace: Adaptive Curriculum Learning Loss for Deep Face Recognition
2107.08621 (2021-07)
Face.evoLVe: A High-Performance Face Recognition Library
2210.10090 (2022-10)
How to Boost Face Recognition with StyleGAN?
and 1 more not named here
get_blocks 3 other papers
2 dated earlier, 1 later
2204.00964 (2022-04)
AdaFace: Quality Adaptive Margin for Face Recognition
2405.15020 (2024-05)
AdjointDEIS: Efficient Gradients for Diffusion Models
2501.01790 (2025-01)
Ingredients: Blending Custom Photos with Video Diffusion Transformers
IR_18 1 other paper
1 later
2501.01790 (2025-01)
Ingredients: Blending Custom Photos with Video Diffusion Transformers
calc_mean_std 1 other paper
1 dated earlier
2406.07547 (2024-06)
Zero-shot Image Editing with Reference Imitation
pad_np_bgr_image 1 other paper
1 later
2505.20292 (2025-05)
OpenS2V-Nexus: A Detailed Benchmark and Million-Scale Dataset for Subject-to-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-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

This paper presents UniPortrait, an innovative human image personalization framework that unifies single- and multi-ID customization with high face fidelity, extensive facial editability, free-form input description, and diverse layout generation. UniPortrait consists of only two plug-and-play modules: an ID embedding module and an ID routing module. The ID embedding module extracts versatile editable facial features with a decoupling strategy for each ID and embeds them into the context space of diffusion models. The ID routing module then combines and distributes these embeddings adaptively to their respective regions within the synthesized image, achieving the customization of single and multiple IDs. With a carefully designed two-stage training scheme, UniPortrait achieves superior performance in both single- and multi-ID customization. Quantitative and qualitative experiments demonstrate the advantages of our method over existing approaches as well as its good scalability, e.g., the universal compatibility with existing generative control tools. The project page is at https://aigcdesigngroup.github.io/UniPortrait-Page/ .

For agents

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

get_harvested_code_for_paper("2408.05939")
get_code_for_paper("2408.05939")
have("2408.05939")

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

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

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

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

Connect an agent — have() is free.