SYNTOLOGY HomeExplorerAtlasCodeMethodologyAboutDevelopersFeedPricing
Paper · 2401.07519 · 2024

InstantID: Zero-shot Identity-Preserving Generation in Seconds

arXiv · PDF · Open in the Atlas

Code that ran

9 of 10 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, 0 violated it and 0 have no contract verdict; 9 failures of our instrument; 1 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/2401.07519.json · badge: /api/ran/2401.07519.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
instantid/instantid canonical (classifier label)
classifier basis: census
8 ran · 0 no recorded run
instantx-research/instantid canonical (classifier label)
classifier basis: classifier_2025
1 ran · 0 no recorded run
TheDenk/InstantID-Visual-Prompt community (classifier label)
classifier basis not recorded on the link
0 ran · 1 no recorded run
FunctionStatusWhere it lives
FeedForward Ran
ran; our contract draft was wrong, not the code
instantid/instantid/pipeline_stable_diffusion_xl_instantid_img2img.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.

convert_from_image_to_cv2 Ran
ran; the contract check could not run (RAISES, DEP_MISSING or TIMEOUT)
instantid/instantid/infer_full.py
code served (permissive licence) · get_code("3bd312dba3ae6f7b")
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 ndarray, ndim 3, dtype family int, shape (4, 4, 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 cv2
import numpy as np
from PIL import Image

# Create a small test image as PIL Image
# Create RGB image with distinct dimensions (4x3)
img_array = np.array([
    [[255, 0, 0], [0, 255, 0], [0, 0, 255], [255, 255, 0]],
    [[128, 128, 128], [64, 64, 64], [192, 192, 192], [32, 32, 32]],
    [[255, 128, 64], [100, 150, 200], [50, 75, 100], [200, 100, 50]],
    [[10, 20, 30], [40, 50, 60], [70, 80, 90], [110, 120, 130]]
], dtype=np.uint8)

pil_img = Image.fromarray(img_array, mode='RGB')

ARGS = {
    'img': pil_img
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
PIL, cv2, numpy — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type ndarray, ndim 3, dtype family int, shape (4, 4, 3) — shape (4, 4, 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
create_unet_diffusers_config Ran
ran; our contract draft was wrong, not the code
instantid/instantid/gradio_demo/model_util.py
code served (permissive licence) · get_code("396178580650d8e3")
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
import torch.nn as nn

torch.manual_seed(0)

ARGS = {
    "v2": False,
    "use_linear_projection_in_v2": False,
}
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
draw_kps Ran
ran; our contract draft was wrong, not the code
instantid/instantid/pipeline_stable_diffusion_xl_instantid.py
pointer only (licence: Apache-2.0); the stored copy get_code serves, from kongzhecn/omg, is pointer only (licence: NONE) · get_code("153b62620c0ab2df")
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 kongzhecn/omg, 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.

draw_kps Ran
ran; our contract draft was wrong, not the code
instantid/instantid/pipeline_stable_diffusion_xl_instantid_img2img.py
code served (permissive licence) · get_code("e28d5d3727a93c7c")
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 numpy as np
import PIL.Image

# Create a small test image (100x80 pixels, RGB)
image_array = np.random.randint(0, 256, (80, 100, 3), dtype=np.uint8)
image_pil = PIL.Image.fromarray(image_array)

# Create keypoints: 5 keypoints with (x, y) coordinates
# Each keypoint is a point on the image
kps = np.array([
    [20.5, 30.2],
    [40.1, 35.8],
    [50.0, 40.0],
    [60.3, 38.5],
    [70.2, 45.1]
], dtype=np.float32)

# Default color_list is already defined in the function signature
color_list = [(255, 0, 0), (0, 255, 0), (0, 0, 255), (255, 255, 0), (255, 0, 255)]

ARGS = {
    "image_pil": image_pil,
    "kps": kps,
    "color_list": color_list
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
PIL, cv2, 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
get_canny_image Ran
ran; the contract check could not run (RAISES, DEP_MISSING or TIMEOUT)
instantid/instantid/gradio_demo/controlnet_util.py
code served (permissive licence) · get_code("65d92c19d39b81be")
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 numpy as np
from PIL import Image
import cv2

# Create a small test image (RGB format, 4x3 pixels)
# Using distinct dimensions: 4 height, 3 width, 3 channels
image_array = np.random.randint(0, 256, (4, 3, 3), dtype=np.uint8)
test_image = Image.fromarray(image_array, 'RGB')

ARGS = {
    'image': test_image,
    't1': 100,
    't2': 200,
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
PIL, cv2, 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 2 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
load_checkpoint_with_text_encoder_conversion Ran
ran; our contract draft was wrong, not the code
instantid/instantid/gradio_demo/model_util.py
code served (permissive licence) · get_code("56f84435814478bc")
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 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 tempfile
import os
from safetensors.torch import save_file

torch.manual_seed(0)

# Create a temporary directory for test files
temp_dir = tempfile.mkdtemp()

# Create a mock state dict with text encoder keys that need replacement
state_dict = {
    'cond_stage_model.transformer.embeddings.token_embedding.weight': torch.randn(4, 3),
    'cond_stage_model.transformer.encoder.layer.0.self_attn.q_proj.weight': torch.randn(4, 3),
    'cond_stage_model.transformer.final_layer_norm.weight': torch.randn(4),
    'other_model.layer.weight': torch.randn(3, 2),
}

# Test with .safetensors format
safetensors_path = os.path.join(temp_dir, 'model.safetensors')
save_file(state_dict, safetensors_path)

# Test with .pt format (PyTorch checkpoint)
pt_path = os.path.join(temp_dir, 'model.pt')
torch.save({'state_dict': state_dict}, pt_path)

# Also create a .pt file without 'state_dict' wrapper
pt_path_no_wrapper = os.path.join(temp_dir, 'model_no_wrapper.pt')
torch.save(state_dict, pt_path_no_wrapper)

ARGS = {
    'ckpt_path': safetensors_path,
    'device': 'cpu',
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
safetensors, torch — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type tuple, ndim 1, 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
reshape_tensor Ran
ran; the contract check could not run (RAISES, DEP_MISSING or TIMEOUT)
instantid/instantid/pipeline_stable_diffusion_xl_instantid_img2img.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.

resize_img Ran
ran; our contract draft was wrong, not the code
instantx-research/instantid/infer.py
code served (permissive licence) · get_code("1cfa1fd260c26481")
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 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 numpy as np
from PIL import Image

# Create a small test image
img_array = np.random.randint(0, 255, (480, 640, 3), dtype=np.uint8)
input_image = Image.fromarray(img_array)

ARGS = {
    'input_image': input_image,
    'max_side': 1280,
    'min_side': 1024,
    'size': None,
    'pad_to_max_side': False,
    'mode': Image.BILINEAR,
    'base_pixel_number': 64
}
Setup block drafted by
a language model, Claude Sonnet 4.5, prompt python_fixture_v1
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
retrieve_latents Not yet run
unverified (harvested, no recorded run)
TheDenk/InstantID-Visual-Prompt/pipeline_stable_diffusion_xl_instantid_img2img.py
code served (permissive licence) · get_code("8262566e1ed7239a")
How it ran

no invocation recorded.

Also present in other papers' code

Of 10 samples lifted from this paper's linked repositories, 10 carry a function identity and 0 do not. Of the 9 distinct functions with an identity, 5 are also present in other papers whose code we hold (2 with at least one paper dated earlier, 0 the same month, 5 later) and 4 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
7 dated earlier, 39 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
3 dated earlier, 27 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
retrieve_latents 19 other papers
18 later, 1 undated
2403.14773 (2024-03)
StreamingT2V: Consistent, Dynamic, and Extendable Long Video Generation from Text
2404.06666 (2024-04)
SafeGen: Mitigating Sexually Explicit Content Generation in Text-to-Image Models
2404.14951 (2024-04)
Reconstructing the Image Stitching Pipeline: Integrating Fusion and Rectangling into a Unified Inpainting Model
and 16 more not named here
draw_kps 3 other papers
3 later
2403.10983 (2024-03)
OMG: Occlusion-friendly Personalized Multi-concept Generation in Diffusion Models
Qu_CaricatureBooth_Data-Free_Interactive_Caricature_Generation_in_a_Photo_Booth_CVPR_2025_paper (2025 (year only))
CaricatureBooth: Data-Free Interactive Caricature Generation in a Photo Booth
2505.20292 (2025-05)
OpenS2V-Nexus: A Detailed Benchmark and Million-Scale Dataset for Subject-to-Video Generation
resize_img 3 other papers
3 later
2407.00788 (2024-07)
InstantStyle-Plus: Style Transfer with Content-Preserving in Text-to-Image Generation
Qu_CaricatureBooth_Data-Free_Interactive_Caricature_Generation_in_a_Photo_Booth_CVPR_2025_paper (2025 (year only))
CaricatureBooth: Data-Free Interactive Caricature Generation in a Photo Booth
2505.14671 (2025-05)
UniCTokens: Boosting Personalized Understanding and Generation via Unified Concept Tokens

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

There has been significant progress in personalized image synthesis with methods such as Textual Inversion, DreamBooth, and LoRA. Yet, their real-world applicability is hindered by high storage demands, lengthy fine-tuning processes, and the need for multiple reference images. Conversely, existing ID embedding-based methods, while requiring only a single forward inference, face challenges: they either necessitate extensive fine-tuning across numerous model parameters, lack compatibility with community pre-trained models, or fail to maintain high face fidelity. Addressing these limitations, we introduce InstantID, a powerful diffusion model-based solution. Our plug-and-play module adeptly handles image personalization in various styles using just a single facial image, while ensuring high fidelity. To achieve this, we design a novel IdentityNet by imposing strong semantic and weak spatial conditions, integrating facial and landmark images with textual prompts to steer the image generation. InstantID demonstrates exceptional performance and efficiency, proving highly beneficial in real-world applications where identity preservation is paramount. Moreover, our work seamlessly integrates with popular pre-trained text-to-image diffusion models like SD1.5 and SDXL, serving as an adaptable plugin. Our codes and pre-trained checkpoints will be available at https://github.com/InstantID/InstantID.

For agents

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

get_harvested_code_for_paper("2401.07519")
get_code_for_paper("2401.07519")
have("2401.07519")

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

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

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

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

Connect an agent — have() is free.