SYNTOLOGY HomeExplorerAtlasCodeMethodologyAboutDevelopersFeedPricing
Paper · 2506.18871 · 2025

OmniGen2: Towards Instruction-Aligned Multimodal Generation

arXiv · PDF · Open in the Atlas

Code that ran

7 of 9 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; 1 honoured the contract we drafted, 0 violated it and 0 have no contract verdict; 6 failures of our instrument; 2 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/2506.18871.json · badge: /api/ran/2506.18871.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
vectorspacelab/omnigen2 canonical (classifier label)
classifier basis not recorded on the link
7 ran · 2 no recorded run
FunctionStatusWhere it lives
apply_chat_template Ran
ran; our contract draft was wrong, not the code
vectorspacelab/omnigen2/OmniGen2-RL/reward_server/reward_server.py
code served (permissive licence) · get_code("a6ba03fb70bfe8c6")
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 str. 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)

ARGS = {
    "prompt": "What is in these images?",
    "num_images": 2
}
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 str — a str output has no array shape of its own; none is stated — the instrument coerces any output to an array; for a str 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
apply_rotary_emb Ran
ran; the contract check could not run (RAISES, DEP_MISSING or TIMEOUT)
vectorspacelab/omnigen2/omnigen2/models/embeddings.py
code served (permissive licence) · get_code("18b51f2c1d11064b")
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, 3, 4, 8) 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 small query/key tensor [B, H, S, D]
# B=2 (batch), H=3 (heads), S=4 (sequence), D=8 (dim)
x = torch.randn(2, 3, 4, 8, dtype=torch.float32)

# Create precomputed frequency tensors for cos and sin
# Shape [S, D] where S=4 (sequence), D=8 (dim)
cos_freqs = torch.cos(torch.arange(4).unsqueeze(1) * torch.arange(8).unsqueeze(0).float())
sin_freqs = torch.sin(torch.arange(4).unsqueeze(1) * torch.arange(8).unsqueeze(0).float())

freqs_cis = (cos_freqs, sin_freqs)

ARGS = {
    "x": x,
    "freqs_cis": freqs_cis,
    "use_real": True,
    "use_real_unbind_dim": -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 Tensor, ndim 4, dtype family float, shape (2, 3, 4, 8) — shape (2, 3, 4, 8) 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
cache_init Ran
ran; our contract draft was wrong, not the code
vectorspacelab/omnigen2/omnigen2/cache_functions/cache_init.py
code served (permissive licence) · get_code("f8786be3f2b88338")
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 torch.nn as nn

torch.manual_seed(0)

class SimpleTransformerLayer(nn.Module):
    def __init__(self):
        super().__init__()
        self.linear = nn.Linear(4, 4)
    
    def forward(self, x):
        return self.linear(x)

class SimpleTransformer(nn.Module):
    def __init__(self, num_layers=3):
        super().__init__()
        self.layers = nn.ModuleList([SimpleTransformerLayer() for _ in range(num_layers)])
    
    def forward(self, x):
        for layer in self.layers:
            x = layer(x)
        return x

class MockModel(nn.Module):
    def __init__(self):
        super().__init__()
        self.transformer = SimpleTransformer(num_layers=3)
    
    def cache_init(self, num_steps: int):
        """
        Initialization for cache.
        """
        cache_dic = {}
        cache = {}
        cache_index = {}
        cache[-1] = {}
        cache_index[-1] = {}
        cache_index['layer_index'] = {}
        cache[-1]['layers_stream'] = {}
        cache_dic['cache_counter'] = 0
        for j in range(len(self.transformer.layers)):
            cache[-1]['layers_stream'][j] = {}
            cache_index[-1][j] = {}
        cache_dic['Delta-DiT'] = False
        cache_dic['cache_type'] = 'random'
        cache_dic['cache_index'] = cache_index
        cache_dic['cache'] = cache
        cache_dic['fresh_ratio_schedule'] = 'ToCa'
        cache_dic['fresh_ratio'] = 0.0
        cache_dic['fresh_threshold'] = 3
        cache_dic['soft_fresh_weight'] = 0.0
        cache_dic['taylor_cache'] = True
        cache_dic['max_order'] = 4
        cache_dic['first_enhance'] = 5
        current = {}
        current['activated_steps'] = [0]
        current['step'] = 0
        current['num_steps'] = num_steps
        return (cache_dic, current)

model_instance = MockModel()

ARGS = {
    'self': model_instance,
    'num_steps': 10
}
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 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
compute_snr Ran
ran; our contract draft was wrong, not the code
vectorspacelab/omnigen2/omnigen2/training_utils.py
code served (permissive licence) · get_code("60584419d54b85d5")
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 2, dtype family float, shape (2, 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
import numpy as np

torch.manual_seed(0)

class NoiseScheduler:
    """Minimal NoiseScheduler with alphas_cumprod attribute."""
    def __init__(self):
        # Create a small alphas_cumprod tensor with 10 timesteps
        # Values should decrease from 1 towards 0 as timesteps progress
        self.alphas_cumprod = torch.tensor([
            1.0000, 0.9900, 0.9703, 0.9410, 0.9025,
            0.8550, 0.7988, 0.7341, 0.6611, 0.5800
        ], dtype=torch.float32)

# Create noise scheduler instance
noise_scheduler = NoiseScheduler()

# Create timesteps tensor - should be indices into alphas_cumprod
# Using batch size 2 with 3 timestep indices each
timesteps = torch.tensor([
    [1, 3, 5],
    [0, 2, 4]
], dtype=torch.long)

ARGS = {
    "noise_scheduler": noise_scheduler,
    "timesteps": timesteps,
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
numpy, torch — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type Tensor, ndim 2, dtype family float, shape (2, 3) — shape (2, 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
decode_base64_image Ran
ran, honoured the contract we drafted
vectorspacelab/omnigen2/OmniGen2-RL/reward_server/reward_server.py
code served (permissive licence) · get_code("20df7e00382b5e77")
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 PngImageFile. 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 base64
from io import BytesIO
from PIL import Image
import numpy as np

# Create a simple test image
test_image = Image.new('RGB', (10, 10), color='red')
buffer = BytesIO()
test_image.save(buffer, format='PNG')
image_bytes = buffer.getvalue()

# Encode to base64
image_data_b64 = base64.b64encode(image_bytes).decode('utf-8')

ARGS = {
    'image_data': image_data_b64
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
PIL, numpy — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type PngImageFile — a PngImageFile output has no array shape of its own; none is stated — the instrument coerces any output to an array; for a PngImageFile 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
parse_and_validate_request Ran
ran; our contract draft was wrong, not the code
vectorspacelab/omnigen2/OmniGen2-RL/reward_server/reward_server.py
code served (permissive licence) · get_code("d5acc36a2f75002f")
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 json
import base64
from io import BytesIO
from PIL import Image
import numpy as np

# Create a small test image and encode it to base64
def create_test_image(size=(10, 10), color=(255, 0, 0)):
    """Create a small PIL image and return as base64 string."""
    img = Image.new('RGB', size, color=color)
    buffer = BytesIO()
    img.save(buffer, format='PNG')
    img_base64 = base64.b64encode(buffer.getvalue()).decode('utf-8')
    return img_base64

# Create test base64 images
input_image_1 = create_test_image((10, 10), (255, 0, 0))
input_image_2 = create_test_image((10, 10), (0, 255, 0))
output_image = create_test_image((10, 10), (0, 0, 255))

# Build the raw_data as bytes containing JSON
request_data = {
    "input_images": [
        [input_image_1, input_image_2],
        [input_image_1]
    ],
    "output_image": [output_image, output_image],
    "meta_data": [
        {"prompt": "test prompt 1"},
        '{"prompt": "test prompt 2"}'
    ]
}

raw_data = json.dumps(request_data).encode('utf-8')

ARGS = {
    "raw_data": raw_data
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
PIL, 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
prepare_request_data Ran
ran; our contract draft was wrong, not the code
vectorspacelab/omnigen2/OmniGen2-RL/reward_server/reward_proxy.py
code served (permissive licence) · get_code("103f9506653843ee")
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 json
from typing import List, Dict, Any, Tuple

def prepare_request_data(request_body: bytes) -> Tuple[List, List, str, Dict]:
    """Parse request body and add original index to meta data."""
    data = json.loads(request_body)
    if not isinstance(data, dict):
        raise ValueError('Request body must be a JSON object')
    input_images = data['input_images']
    output_image = data['output_image']
    meta_datas = data['meta_datas']
    if not isinstance(input_images, list) or not isinstance(output_image, list):
        raise ValueError("'input_images' and 'output_image' must be lists")
    if not isinstance(meta_datas, list):
        raise ValueError("'meta_datas' must be a list")
    normalized_meta_datas = []
    for meta in meta_datas:
        if isinstance(meta, str):
            normalized_meta_datas.append(json.loads(meta))
        elif isinstance(meta, dict):
            normalized_meta_datas.append(meta)
        else:
            raise ValueError('Each meta_data item must be a dict or JSON string')
    meta_datas = normalized_meta_datas
    for i, meta in enumerate(meta_datas):
        meta['original_index'] = i
    server_type = data.get('server_type', 'geneval')
    return (input_images, output_image, meta_datas, server_type)


# Construct valid request_body as bytes
request_data = {
    "input_images": ["image1.png", "image2.png"],
    "output_image": ["output1.png"],
    "meta_datas": [
        {"name": "meta1", "value": 10},
        '{"name": "meta2", "value": 20}',
        {"name": "meta3"}
    ],
    "server_type": "custom_server"
}

request_body = json.dumps(request_data).encode('utf-8')

ARGS = {
    "request_body": request_body
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
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 — 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
resolve_interpolation_mode Not yet run
unverified (harvested, no recorded run)
vectorspacelab/omnigen2/omnigen2/training_utils.py
code served (permissive licence) · get_code("596bed30be61c6e8")
How it ran

no invocation recorded.

start_server Not yet run
unverified (harvested, no recorded run)
vectorspacelab/omnigen2/OmniGen2-RL/reward_server/start_multi_servers.py
code served (permissive licence) · get_code("20dc3dd57e8a52d6")
How it ran

no invocation recorded.

Also present in other papers' code

Of 9 samples lifted from this paper's linked repositories, 9 carry a function identity and 0 do not. Of the 9 distinct functions with an identity, 9 are also present in other papers whose code we hold (1 with at least one paper dated earlier, 0 the same month, 9 later) and 0 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
compute_snr 9 other papers
6 dated earlier, 2 later, 1 undated
2311.17918 (2023-11)
Driving into the Future: Multiview Visual Forecasting and Planning with World Model for Autonomous Driving
2403.10094 (2024-03)
RangeLDM: Fast Realistic LiDAR Point Cloud Generation
2403.12931 (2024-03)
You Only Sample Once: Taming One-Step Text-To-Image Synthesis by Self-Cooperative Diffusion GANs
and 6 more not named here
resolve_interpolation_mode 2 other papers
2 later
2512.11715 (2025-12)
EditMGT: Unleashing Potentials of Masked Generative Transformers in Image Editing
2605.15196 (2026-05)
REFDECODER: Enhancing Visual Generation with Conditional Video Decoding
apply_chat_template 1 other paper
1 later
2512.11715 (2025-12)
EditMGT: Unleashing Potentials of Masked Generative Transformers in Image Editing
apply_rotary_emb 1 other paper
1 later
2512.11715 (2025-12)
EditMGT: Unleashing Potentials of Masked Generative Transformers in Image Editing
cache_init 1 other paper
1 later
2512.11715 (2025-12)
EditMGT: Unleashing Potentials of Masked Generative Transformers in Image Editing
decode_base64_image 1 other paper
1 later
2512.11715 (2025-12)
EditMGT: Unleashing Potentials of Masked Generative Transformers in Image Editing
parse_and_validate_request 1 other paper
1 later
2512.11715 (2025-12)
EditMGT: Unleashing Potentials of Masked Generative Transformers in Image Editing
prepare_request_data 1 other paper
1 later
2512.11715 (2025-12)
EditMGT: Unleashing Potentials of Masked Generative Transformers in Image Editing
start_server 1 other paper
1 later
2512.11715 (2025-12)
EditMGT: Unleashing Potentials of Masked Generative Transformers in Image Editing

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

In this work, we introduce OmniGen2, a versatile and open-source generative model designed to provide a unified solution for diverse generation tasks, including text-to-image, image editing, and in-context generation. Unlike OmniGen v1, OmniGen2 features two distinct decoding pathways for text and image modalities, utilizing unshared parameters and a decoupled image tokenizer. This design enables OmniGen2 to build upon existing multimodal understanding models without the need to re-adapt VAE inputs, thereby preserving the original text generation capabilities. To facilitate the training of OmniGen2, we developed comprehensive data construction pipelines, encompassing image editing and in-context generation data. Additionally, we introduce a reflection mechanism tailored for image generation tasks and curate a dedicated reflection dataset based on OmniGen2. Despite its relatively modest parameter size, OmniGen2 achieves competitive results on multiple task benchmarks, including text-to-image and image editing. To further evaluate in-context generation, also referred to as subject-driven tasks, we introduce a new benchmark named OmniContext. OmniGen2 achieves state-of-the-art performance among open-source models in terms of consistency. We will release our models, training code, datasets, and data construction pipeline to support future research in this field. Project Page: https://vectorspacelab.github.io/OmniGen2; GitHub Link: https://github.com/VectorSpaceLab/OmniGen2

For agents

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

get_harvested_code_for_paper("2506.18871")
get_code_for_paper("2506.18871")
have("2506.18871")

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

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

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

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

Connect an agent — have() is free.