SYNTOLOGY HomeExplorerAtlasCodeMethodologyAboutDevelopersFeedPricing
Paper · 2305.11147 · NeurIPS · 2023

UniControl: A Unified Diffusion Model for Controllable Visual Generation In the Wild

Stefano Ermon, Huan Wang, Caiming Xiong, Silvio Savarese, Yihao Feng, Xinyi Yang, Yingbo Zhou, Yun Fu, Ning Yu, Zhang, Juan Niebles, Ran Xu, and 2 more

arXiv · PDF · Open in the Atlas

Code that ran

4 of 7 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 1 has no contract verdict; 2 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/2305.11147.json · badge: /api/ran/2305.11147.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
salesforce/unicontrol canonical (classifier label)
classifier basis: census
4 ran · 3 no recorded run
FunctionStatusWhere it lives
get_node_name Ran
ran; our contract draft was wrong, not the code
salesforce/unicontrol/tool_add_control.py
code served (permissive licence) · get_code("0dbf855dab1ab575")
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 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.

# Analyzing the function get_node_name
# It takes two string parameters: name and parent_name
# It performs string operations: len(), slicing, comparison
# Returns a tuple of (bool, str)

ARGS = {
    'name': 'parent_module.child_layer',
    'parent_name': 'parent_module.'
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1
Imports
none outside the standard library — 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
get_state_dict Ran
ran; our contract draft was wrong, not the code
salesforce/unicontrol/cldm/model.py
code served (permissive licence) · get_code("cfc17707f35e7ec4")
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

torch.manual_seed(0)

def get_state_dict(d):
    return d.get('state_dict', d)

# The function calls .get() on the parameter 'd', so it must be a dict-like object.
# It tries to get 'state_dict' key, and if not found, returns the dict itself.

ARGS = {
    'd': {'state_dict': {'layer1.weight': torch.randn(4, 3), 'layer1.bias': torch.randn(4)}}
}
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
numpy_to_pil Ran
ran, violated the contract we drafted
salesforce/unicontrol/utils.py
pointer only (licence: Apache-2.0); the stored copy get_code serves, from vicgalle/stable-diffusion-aesthetic-gradients, is pointer only (licence: NOASSERTION) · get_code("1e63d588563eb90a")
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 vicgalle/stable-diffusion-aesthetic-gradients, 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.

put_watermark Ran
ran on a synthesized input
salesforce/unicontrol/utils.py
code served (permissive licence) · get_code("81718137a49d87b1")
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 torch
import numpy as np
from PIL import Image
import cv2

class MockWatermarkEncoder:
    """Stand-in watermark encoder with encode method"""
    def encode(self, img, method):
        # img is BGR numpy array, return encoded BGR numpy array
        # Add a simple watermark effect (e.g., slight modification)
        return (img.astype(np.float32) * 0.99).astype(np.uint8)

# Create a small test image (4x3 RGB)
img_array = np.random.randint(0, 256, (4, 3, 3), dtype=np.uint8)
test_img = Image.fromarray(img_array)

# Create watermark encoder
wm_encoder = MockWatermarkEncoder()

ARGS = {
    "img": test_img,
    "wm_encoder": wm_encoder
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
PIL, cv2, numpy, torch — 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
load_replacement Not yet run
unverified (harvested, no recorded run)
salesforce/unicontrol/utils.py
code served (permissive licence) · get_code("d044cb7f97b33225")
How it ran

no invocation recorded.

load_state_dict Not yet run
unverified (harvested, no recorded run)
salesforce/unicontrol/cldm/model.py
code served (permissive licence) · get_code("df733a879693145d")
How it ran

no invocation recorded.

modulated_conv2d Not yet run
unverified (harvested, no recorded run)
salesforce/unicontrol/cldm/cldm_unicontrol.py
code served (permissive licence) · get_code("6f66e41f8b1a278d")
How it ran

no invocation recorded.

Also present in other papers' code

Of 7 samples lifted from this paper's linked repositories, 7 carry a function identity and 0 do not. Of the 7 distinct functions with an identity, 4 are also present in other papers whose code we hold (4 with at least one paper dated earlier, 2 the same month, 4 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
get_state_dict 29 other papers
1 dated earlier, 2 the same month, 26 later
2304.04269 (2023-04)
HumanSD: A Native Skeleton-Guided Diffusion Model for Human Image Generation
2305.02034 (2023-05)
SAMRS: Scaling-up Remote Sensing Segmentation Dataset with Segment Anything Model
2305.16322 (2023-05)
Uni-ControlNet: All-in-One Control to Text-to-Image Diffusion Models
and 26 more not named here
load_state_dict 25 other papers
1 dated earlier, 2 the same month, 22 later
2304.04269 (2023-04)
HumanSD: A Native Skeleton-Guided Diffusion Model for Human Image Generation
2305.02034 (2023-05)
SAMRS: Scaling-up Remote Sensing Segmentation Dataset with Segment Anything Model
2305.16322 (2023-05)
Uni-ControlNet: All-in-One Control to Text-to-Image Diffusion Models
and 22 more not named here
numpy_to_pil 23 other papers
8 dated earlier, 15 later
2106.14490 (2021-06)
Making Images Real Again: A Comprehensive Survey on Deep Image Composition
2112.10752 (2021-12)
High-Resolution Image Synthesis with Latent Diffusion Models
2209.12330 (2022-09)
Personalizing Text-to-Image Generation via Aesthetic Gradients
and 20 more not named here
get_node_name 15 other papers
1 dated earlier, 14 later
2304.04269 (2023-04)
HumanSD: A Native Skeleton-Guided Diffusion Model for Human Image Generation
2306.07280 (2023-06)
Controlling Text-to-Image Diffusion by Orthogonal Finetuning
2309.03453 (2023-09)
SyncDreamer: Generating Multiview-consistent Images from a Single-view Image
and 12 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

Achieving machine autonomy and human control often represent divergent objectives in the design of interactive AI systems. Visual generative foundation models such as Stable Diffusion show promise in navigating these goals, especially when prompted with arbitrary languages. However, they often fall short in generating images with spatial, structural, or geometric controls. The integration of such controls, which can accommodate various visual conditions in a single unified model, remains an unaddressed challenge. In response, we introduce UniControl, a new generative foundation model that consolidates a wide array of controllable condition-to-image (C2I) tasks within a singular framework, while still allowing for arbitrary language prompts. UniControl enables pixel-level-precise image generation, where visual conditions primarily influence the generated structures and language prompts guide the style and context. To equip UniControl with the capacity to handle diverse visual conditions, we augment pretrained text-to-image diffusion models and introduce a task-aware HyperNet to modulate the diffusion models, enabling the adaptation to different C2I tasks simultaneously. Trained on nine unique C2I tasks, UniControl demonstrates impressive zero-shot generation abilities with unseen visual conditions. Experimental results show that UniControl often surpasses the performance of single-task-controlled methods of comparable model sizes. This control versatility positions UniControl as a significant advancement in the realm of controllable visual generation.

For agents

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

get_harvested_code_for_paper("2305.11147")
get_code_for_paper("2305.11147")
have("2305.11147")

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

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

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

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

Connect an agent — have() is free.