From: BAAI <huggingface.co/BAAI>Newsgroups: alt.freeweights.textSubject:

OmniGen2

Date: 2026-11-15Commit: e102b09Signed: 2DC28CC7B26A283B ✓

Any to any model with 4B parameters. Safetensors weights, 31.3 GB in all. Published by BAAI under Apache-2.0.

4B params31.3GBOmniGen2safetensorspermissive
FactsParams4BSize31.3 GBFormatssafetensorsTaskany to anyLicenseApache-2.0From sourcepermissive
$ fw get BAAI/OmniGen2
# manifest sha256 d6c855c69111… · 31.3 GB · 33 files
$ fw verify ./OmniGen2 BAAI/OmniGen2
From sourceHosted (signed)BAAI/OmniGen2Last check: 2026-11-15 04:17 UTC

Get help: custom fine-tune or private deploy. We review your setup before we quote.

Works with

Runs with

Ranked by fit to this model (safetensors), then by GitHub stars.

Overview

Size
31.3 GB
Weights
31.2 GB (safetensors)
Parameters
4B
Formats
safetensors
Task
any to any
License
Apache-2.0 (permissive)
Files
33, each with a sha256
Publisher
BAAI
Added
2026-11-15
Section
alt.freeweights.text
Lineage

Original release from the publisher.

Where these bytes come from
Publisher at the pinned commit→You

Sources are tried in order. A file counts only when its size and sha256 match the manifest. Sources are checked when you ask for them, not on a timer.

Sources
BadgeHostLast checkResult
From sourcehuggingface.co2026-11-15 04:17 UTCpassed

Model card

From the publisher at commit e102b09. Shown as plain text with links; images open at the publisher.

Image: image

project page arxiv demo demo model model model

News | Quick Start | Usage Tips | Limitations | Online Demos | Citation

🔥 News#

  • 2025-06-30: Training code is available, see fine-tuning for details.
  • 2025-06-28: We release OmniContext benchmark. The evaluation code can be found in omnicontext.
  • 2025-06-24: Technical Report is available.
  • 2025-06-23: We’ve updated our code and HF model—OmniGen2 now runs without flash-attn. Users can still install it for optimal performance.
  • 2025-06-20: Updated resource requirements, adding CPU offload support for devices with limited VRAM.
  • 2025-06-16: Gradio and Jupyter is available. Online Gradio Demo: Demo1; Chat-Demo1; see more demo links in gradio section
  • 2025-06-16: We release OmniGen2, a multimodal generation model, model weights can be accessed in huggingface and modelscope.

Introduction#

OmniGen2 is a powerful and efficient generative model. Unlike OmniGen v1, OmniGen2 features two distinct decoding pathways for text and image modalities, utilizing unshared parameters and a decoupled image tokenizer. OmniGen2 has competitive performance across four primary capabilities:

  • Visual Understanding: Inherits the robust ability to interpret and analyze image content from its Qwen-VL-2.5 foundation.
  • Text-to-Image Generation: Creates high-fidelity and aesthetically pleasing images from textual prompts.
  • Instruction-guided Image Editing: Executes complex, instruction-based image modifications with high precision, achieving state-of-the-art performance among open-source models.
  • In-context Generation: A versatile capability to process and flexibly combine diverse inputs—including humans, reference objects, and scenes—to produce novel and coherent visual outputs.

We will release the training code and dataset. Stay tuned!

Some good cases of OmniGen2:

Image: image

Demonstrations.

Image: image

Good demonstrations of OmniGen2's image editing capabilities.

Image: image

Good demonstrations of OmniGen2's in-context generation capabilities.

📌 TODO#

  • [x] Technical report.
  • [x] Support CPU offload and improve inference efficiency.
  • [x] In-context generation benchmark: OmniContext.
  • [ ] Integration of diffusers.
  • [ ] Training datasets.
  • [ ] Training data construction pipeline.
  • [ ] ComfyUI Demo (commuity support will be greatly appreciated!).

🚀 Quick Start#

🛠️ Environment Setup#
# 1. Clone the repo
git clone git@github.com:VectorSpaceLab/OmniGen2.git
cd OmniGen2

# 2. (Optional) Create a clean Python environment
conda create -n omnigen2 python=3.11
conda activate omnigen2

# 3. Install dependencies
# 3.1 Install PyTorch (choose correct CUDA version)
pip install torch==2.6.0 torchvision --extra-index-url https://download.pytorch.org/whl/cu124

# 3.2 Install other required packages
pip install -r requirements.txt

# Note: Version 2.7.4.post1 is specified for compatibility with CUDA 12.4.
# Feel free to use a newer version if you use CUDA 12.6 or they fixed this compatibility issue.
# OmniGen2 runs even without flash-attn, though we recommend install it for best performance.
pip install flash-attn==2.7.4.post1 --no-build-isolation
🌏 For users in Mainland China#
# Install PyTorch from a domestic mirror
pip install torch==2.6.0 torchvision --index-url https://mirror.sjtu.edu.cn/pytorch-wheels/cu124

# Install other dependencies from Tsinghua mirror
pip install -r requirements.txt -i https://pypi.tuna.tsinghua.edu.cn/simple

# Note: Version 2.7.4.post1 is specified for compatibility with CUDA 12.4.
# Feel free to use a newer version if you use CUDA 12.6 or they fixed this compatibility issue.
# OmniGen2 runs even without flash-attn, though we recommend install it for best performance.
pip install flash-attn==2.7.4.post1 --no-build-isolation -i https://pypi.tuna.tsinghua.edu.cn/simple

🧪 Run Examples#
# Visual Understanding
bash example_understanding.sh

# Text-to-image generation
bash example_t2i.sh

# Instruction-guided image editing
bash example_edit.sh

# In-context generation
bash example_in_context_generation.sh

🌐 Gradio Demo#
  • Run Locally: bash # for only generating image pip install gradio python app.py # Optional: Share demo with public link (You need to be able to access huggingface) python app.py --share # for generating image or text pip install gradio python app_chat.py

💡 Usage Tips#

To achieve optimal results with OmniGen2, you can adjust the following key hyperparameters based on your specific use case.

  • text_guidance_scale: Controls how strictly the output adheres to the text prompt (Classifier-Free Guidance).
  • image_guidance_scale: This controls how much the final image should resemble the input reference image.
    • The Trade-off: A higher value makes the output more faithful to the reference image's structure and style, but it might ignore parts of your text prompt. A lower value (~1.5) gives the text prompt more influence.
    • Tip: For image editing task, we recommend to set it between 1.2 and 2.0; for in-context generateion task, a higher image_guidance_scale will maintian more details in input images, and we recommend to set it between 2.5 and 3.0.
  • max_pixels: Automatically resizes images when their total pixel count (width × height) exceeds this limit, while maintaining its aspect ratio. This helps manage performance and memory usage.
    • Tip: Default value is 1024*1024. You can reduce this value if you encounter memory issues.
  • max_input_image_side_length: Maximum side length for input images.
  • negative_prompt: Tell the model what you don't want to see in the image.
    • Example: blurry, low quality, text, watermark
    • Tip: For the best results, try experimenting with different negative prompts. If you're not sure, just use the default negative prompt.
  • enable_model_cpu_offload: Reduces VRAM usage by nearly 50% with a negligible impact on speed.
    • This is achieved by offloading the model weights to CPU RAM when they are not in use.
    • See: Model Offloading
  • enable_sequential_cpu_offload: Minimizes VRAM usage to less than 3GB, but at the cost of significantly slower performance.
    • This works by offloading the model in submodules and loading them onto the GPU sequentially as needed.
    • See: CPU Offloading
  • cfg_range_start, cfg_range_end: Define the timestep range where CFG is applied. Per this paper, reducing cfg_range_end can significantly decrease inference time with a negligible impact on quality.
  • scheduler: Choose between [euler, dpmsolver++]. Default is euler. For potentially better performance with fewer steps, try dpmsolver++.
  • num_inference_step: Number of discretization steps for the ODE solver. Default is 50.

Some suggestions for improving generation quality:

  1. Use High-Quality Images
    • Provide clear images, preferably with a resolution greater than 512×512 pixels.
    • Small or blurry inputs will result in low-quality outputs.
  2. Be Specific with Instructions
    • Clearly describe both what to change and how you want it changed.
  3. Prioritize English

The model currently performs best with English prompts.

  1. Change instructions to enhance subject consistency.

When the generated image does not align well with the input image, you can try the following methods to improve subject consistency:

  • Use images with larger size, as well as images in which people occupy a larger proportion of the frame.
  • Increase the Image Guidance Scale, for example to 3.0. The trade-off may be slight overexposure or a greasy look in the image.
  • When using a single input image, you can try to use the following prompt template: "she/he ..., maintaining her/his facial features, hairstyle, and other attributes."
  • Increase the parameter--Number of images per prompt to generate more outputs, giving you a better chance to find one with stronger subject consistency and a more satisfactory result.
  • Longer prompts generally yield better results than shorter ones. More detailed descriptions of the scene and character interactions can provide additional benefits.
  • For in-context edit (edit based multiple images), we recommend using the following prompt format: "Edit the first image: add/replace (the [object] with) the [object] from the second image. [descripton for your target image]."

For example: "Edit the first image: add the man from the second image. The man is talking with a woman in the kitchen". The descition for your target image should be as detailed as possible.

🎨 Fine-tune#

See fine-tuning for details.

❌ Limitations and Suggestions#

The current model sometimes does not follow instructions. You can increase the "Number of images per prompt" to generate multiple images at once, so you can choose the result you are satisfied with, or try different prompts. In our own experience, being as detailed as possible tends to work better.

The current model cannot decide the output image size by itself; the default size is 1024×1024. You need to set a specific size if you require a different one. When you input an image, we will set the output size to match the input image (this works best for editing tasks). If you want to modify just one image out of several, you should also set the output size to match the image you want to edit; otherwise, it may lead to low-quality outputs.

The in-context generation capability sometimes produces objects that differ from the original ones. Some suggested improvements are: increasing image_guidance_scale (it is recommended to set it to 3) can help alleviate this issue; using high-resolution images, increasing the size of the input image, and ensuring that the object to be used occupies a larger proportion of the image; and modifying the prompt. However, there is still a gap compared to GPT-4o.

Compared to OmniGen 1.0, although OmniGen 2 has made some improvements, many issues still remain. It may take multiple attempts to achieve a satisfactory result.

💻 Resources Requirement#

OmniGen2 natively requires an NVIDIA RTX 3090 or an equivalent GPU with approximately 17GB of VRAM. For devices with less VRAM, you can enable CPU Offload to run the model.

Performance Tip: To improve inference speed, consider decreasing the cfg_range_end parameter. Within a reasonable range, this has a negligible impact on output quality.

The following table details the inference performance of OmniGen2 on an A800 GPU:

Image: image

Inference Efficiency of OmniGen2.

🤝 Community Efforts#

We’re honored and grateful for the support from the open source community. Here are some unofficial implementations contributed by the community(Currently, we have not confirmed whether there are no bugs. Please try to use the our official demo as much as possible.):

❤️ Citing Us#

If you find this repository or our work useful, please consider giving a star ⭐ and citation 🦖, which would be greatly appreciated:

@article{wu2025omnigen2,
  title={OmniGen2: Exploration to Advanced Multimodal Generation},
  author={Chenyuan Wu and Pengfei Zheng and Ruiran Yan and Shitao Xiao and Xin Luo and Yueze Wang and Wanli Li and Xiyan Jiang and Yexin Liu and Junjie Zhou and Ze Liu and Ziyi Xia and Chaofan Li and Haoge Deng and Jiahao Wang and Kun Luo and Bo Zhang and Defu Lian and Xinlong Wang and Zhongyuan Wang and Tiejun Huang and Zheng Liu},
  journal={arXiv preprint arXiv:2506.18871},
  year={2025}
}

Files

33 files · 31.3 GBWeights 31.2 GB (safetensors). Sizes and sha256 from the signed manifest.
Show all 33 files with their sha256
FileSizesha256
.gitattributes1.92 KB8c4e025e0f51374261c1b6ac6ec051659728a1b01400070c708c8f6c895ad828
README.md15.4 KB578501762a45dc4513a048a0c97debc9d9f404fdb01985f699fcf49ec702f978
assets/brand.png337 KBbb22c8bfcc06439e8543cf1f1d3954bf5f306d717a602bb765e3d25d300f25e5
assets/efficiency.png300 KB832a819af7b6585749e33e702c8605f8523a3cd78d199f1b589a7033b3b127c7
assets/examples_edit.png5.68 MB484a5f8afffcb61533acb64cbfb9a841bc31941120887774c16f8348bbc5143d
assets/examples_subject.png7.77 MB07f706c1e3a9c023918738b43e0a7611ebbb4dad3bf0535eb7bacbfd85081c81
assets/teaser.jpg7.20 MB77e7a964152438345d06e77159a4eef42265be3543ee03494ef7e92c312bf566
assets/teaser.png4.44 MB2a9dc726bd62baeba481ad3ad9f51b1582ab3980b5db3c5c944c131359fbcdd9
mllm/config.json1.49 KB04875e977ecc48474285860d4cd35c80597e5bee0d669aac335c01d192c74d08
mllm/generation_config.json291 Bca977734a9d8c7adf17306333a0ab50ea0ffe7e5593d138035fd8297d438fd88
mllm/model-00001-of-00004.safetensors4.97 GBbfe5503539cf9335017bca96cd4409cec234de71af6bbe9a6035c0952e9319c2
mllm/model-00002-of-00004.safetensors4.93 GB09b6f098d029dd4fadcc032d2d9da1914204d098c04a5a38f19bba23beb3039c
mllm/model-00003-of-00004.safetensors4.93 GBfa99a4bf5f586e0f6aa2e941a66283afc98df2a8c726496f717ff7939ec70651
mllm/model-00004-of-00004.safetensors180 MBe9bdab213ea510b2de9805ae054076d804fe578eb052460ed7988c8cc3aee114
mllm/model.safetensors.index.json65.4 KB34632e1890209f39a26e340ac6624e9f66132974edd8554107e2ca2ac6478fb7
model_index.json462 B2dd01ad2614dcac86d3629cdeaaf59370ae4f6049f9d508051d9e9725e2169de
processor/added_tokens.json701 B5d72dd9d5db5de3e9ac73a4a55f84e73ac853deccc42ba62559399aeff14fb37
processor/chat_template.json1.05 KB94174d7176c52a7192f96fc34eb2cf23c7c2059d63cdbfadca1586ba89731fb7
processor/merges.txt1.67 MB8831e4f1a044471340f7c0a83d7bd71306a5b867e95fd870f74d0c5308a904d5
processor/preprocessor_config.json575 B549c158011407dfb750d9ec578047cf76f5bfe365cd0aa069a50137d3f98d9dd
processor/special_tokens_map.json613 B76862e765266b85aa9459767e33cbaf13970f327a0e88d1c65846c2ddd3a1ecd
processor/tokenizer.json11.4 MB69f12bcc978e3d112e092478b218f0161ef3d4bec08792866c99d29830772f08
processor/tokenizer_config.json8.01 KBa01d5ea5b3f2f728c1cd74eeafae34e767e46a96790fbc526d835d2a9f52eec2
processor/vocab.json2.78 MBca10d7e9fb3ed18575dd1e277a2579c16d108e32f27439684afa0e10b1440910
scheduler/scheduler_config.json150 B673012ba86a312d5dcb82f62c57d6db7e3cf2f600aca8398239471fd7fe8a9dc
scheduler/scheduling_flow_match_euler_discrete.py8.97 KB40549fb9b5820dba03a4d46959bf5fff721a8297a907a70ef019a2c657f32a94
transformer/config.json494 B134d3d4f76aef5bcb56964e412a0244345aaec459cb6fb4c1ab4f6d90f7540d1
transformer/diffusion_pytorch_model-00001-of-00002.safetensors10.00 GB4d167d318d9c34833d1522dffb3fdbc424fd4e482eda35faf6b24306317052ba
transformer/diffusion_pytorch_model-00002-of-00002.safetensors5.87 GB844bd3f41ce0879c9f968934e7c7cbbc58d57e46aae2661c23ac9f6478ebd9ba
transformer/diffusion_pytorch_model.safetensors.index.json53.6 KBd874df24701d9b2f028fc6aebf245aee934e88d3f1be85de261038b5784241b6
transformer/transformer_omnigen2.py81.1 KB09c40f75c5237eb189c5f881afa470952c153674c7b3c4dd62350552b2a8a12c
vae/config.json840 B932d26c5e92f1db6ea7d04bf27d748fa2258bd66a3d26a69ab8f9b473e65ce29
vae/diffusion_pytorch_model.safetensors335 MB8c717328c8ad41faab2ccfd52ae17332505c6833cf176aad56e7b58f2c4d4c94
VersionsEach time the pinned upstream commit or file list changed in this repo. Newest first.
Upstream commitDateContents
e102b09cdb pinned now2026-11-15 04:17 UTC33 files · 31.3 GB

Use it

$ fw get BAAI/OmniGen2
# manifest sha256 d6c855c69111… · 31.3 GB · 33 files
$ fw verify ./OmniGen2 BAAI/OmniGen2
fw.pyChecks the signature and every sha256, tries each source in order, resumes.
$ python3 fw.py get https://freeweights.allternit.com/manifests/BAAI/OmniGen2.json --dir ./OmniGen2 $ python3 fw.py verify ./OmniGen2 ./BAAI__OmniGen2.json
hfThe Hugging Face CLI with one setting. Same repo id.
$ HF_ENDPOINT=https://freeweights.allternit.com hf download BAAI/OmniGen2 --revision e102b09cdb24fa20b25b1149638ce28b571c1e97 --local-dir ./OmniGen2

License

Name
Apache License 2.0
Id
Apache-2.0
Class
Permissive
Redistribution
yes
Listing
Hosted (signed)
Decided
License as declared by the publisher. No person read it. 2026-11-15
Text in
README.md
Text sha256
578501762a45dc4513a048a0c97debc9d9f404fdb01985f699fcf49ec702f978
Terms gate
No extra terms beyond the license.

Read the license text

Licenses are checked against the license table. A custom license passes only after a person reads it.

Provenance

From: BAAI <huggingface.co/BAAI>Newsgroups: alt.freeweights.textSubject: OmniGen2Date: 2026-11-15Commit: e102b09Signed: 2DC28CC7B26A283B ✓
Upstream
BAAI/OmniGen2
Pinned commit
e102b09cdb24fa20b25b1149638ce28b571c1e97
Manifest
OmniGen2.json · .minisig
Manifest sha256
d6c855c69111bdfe8e1d7997bb600fa292dd095dd6456430e69fe230dcf7e243
Signature
minisign, Ed25519, key 2DC28CC7B26A283B
Created
2026-11-15 04:17 UTC
Generator
freeweights-manifest/0.1.0
Takedowns
None.

How to verify

$ curl -O https://freeweights.allternit.com/manifests/BAAI/OmniGen2.json $ curl -O https://freeweights.allternit.com/manifests/BAAI/OmniGen2.json.minisig $ minisign -Vm OmniGen2.json -P RWQ7KGqyx4zCLXtUFOqvfv8L3g+8fpKJ1FsuxPyOYMF+4KufbUxKq1Oq $ shasum -a 256 <file> # compare with the Files tab

A manifest whose signature fails must be rejected. A file whose size or sha256 does not match must be discarded. Verify a download

Model tree

No related models in this catalog.Nothing here lists this model as its parent, and it names no parent.
Get it
Download
$ HF_ENDPOINT=https://freeweights.allternit.com hf download BAAI/OmniGen2
Open in Freeweights Studio

Pull, verify and run it in the Allternit app on Desktop, web or phone.

Signed manifest
minisign, key 2DC28CC7B26A283B. OmniGen2.json. Provenance. Takedown history: none.
From: laion <huggingface.co/laion>Subject: a2-rl-e2egit_large-50-32B
From: laion <huggingface.co/laion>Subject: a3-rl-DCAgent_exp_rpt_e2egit-large-15-8B
From: laion <huggingface.co/laion>Subject: a3-rl-DCAgent_exp_rpt_e2egit-v2-10-8B
From: laion <huggingface.co/laion>Subject: a3-rl-DCAgent_exp_rpt_pymethods2test-large-80-8B
From: laion <huggingface.co/laion>Subject: a3-rl-DCAgent_exp_rpt_unitsyn-python-large-10-8B
From: laion <huggingface.co/laion>Subject: a3-rl-DCAgent_mix_h2_language_proportional-65-8B