Reproducible Diffusers LoRA inference pipelines for adapters trained with ostris/ai-toolkit.
← Docs Home · Model Catalog · HTTP API · Troubleshooting
API model id: omnigen2
URL slug: omnigen2
This page documents the reference Diffusers inference pipeline for omnigen2 (OmniGen2). It is designed for running LoRAs trained with ostris/ai-toolkit while minimizing training preview vs inference mismatch.
If you are trying to reproduce AI Toolkit sample previews, treat the code linked below as the source of truth (scheduler wiring, resolution snapping, LoRA application, and conditioning).
Run in the cloud (optional): If you want to reproduce the examples on this page in a pinned runtime without local CUDA/driver setup (and reduce preview‑vs‑inference drift), run it via RunComfy’s Cloud AI Toolkit (Train + Inference). 👉 You can open it here: Cloud AI Toolkit (Train + Inference)
| Field | Value |
|---|---|
| Pipeline | src/pipelines/omnigen2.py |
| Base checkpoint | OmniGen2/OmniGen2 |
| Defaults | sample_steps=25, guidance_scale=4.0, seed=42 |
| Resolution snapping | Floors width/height to a multiple of 16 |
| Control image | Optional (ctrl_img or ctrl_img_1..3) |
| LoRA scale behavior | Fused into transformer weights at load time; scale is fixed after load. |
| Needs AI Toolkit | Required (needs a local ostris/ai-toolkit checkout via AI_TOOLKIT_PATH) |
src/pipelines/omnigen2.pysrc/pipelines/base.pysrc/schemas/request.pysrc/schemas/models.pysrc/pipelines/__init__.pysrc/tasks/executor.py{
"model": "omnigen2",
"trigger_word": "sks",
"prompts": [
{
"prompt": "[trigger] a photo of a person",
"width": 1024,
"height": 1024,
"seed": 42,
"sample_steps": 25,
"guidance_scale": 4.0,
"neg": ""
}
],
"loras": [
{
"path": "my_lora_job/my_lora.safetensors",
"network_multiplier": 1.0
}
]
}
OmniGen2Transformer2DModel.ctrl_img (single) or ctrl_img_1..3 (multiple reference images).text_guidance_scale (mapped from the API’s guidance_scale) and keeps image_guidance_scale=1.0.diffusion_model. key format supported).loras[].network_multiplier requires pipeline reload.ctrl_img_1..3).sample_steps and the scheduler family (FlowMatch / UniPC / DDPM differences matter).guidance_scale semantics (some pipelines map it to a different internal parameter).loras[].network_multiplier and whether LoRA scale is dynamic vs fused.