😺dz: OmniGen Wrapper
Stitch three photos into one scene — OmniGen, minus the CLI nightmare
- image_1
- image_2
- image_3
- image
You want one picture of three people who were never in the same room. Not a collage, not a photoshop job - a single coherent image of them standing together, with the model figuring out lighting and poses. That's the job OmniGen was built for, and this node is the least painful way to run it in ComfyUI.
OmniGen (from VectorSpaceLab) is a "unified" image model: one ~2.6B-parameter pipeline that does text-to-image and image editing/translation, subject-driven generation, and multi-image compositing. You reference input images as placeholders in the prompt - {image_1} - and the model figures out the rest. Where most ComfyUI workflows stack a mask, a ControlNet, an IP-Adapter, and three LoRAs to pull off the same trick, OmniGen wants one node. Community consensus on the tradeoff is honestly stated: flexibility is high, raw quality is so-so. It's the tool you reach for when the combination is the point, not the tool for pixel-perfect output.
What the wrapper actually is
dzOmniGenWrapper (the "😺dz: OmniGen Wrapper" node) is by chflame163, the same author behind the big dzNodes pack. It bundles OmniGen's pipeline directly into the node, so you don't maintain a separate Python environment - which is where standalone OmniGen usually dies. The wrapper loads the model, handles quantization, downloads weights, and runs inference, all in one box. First run, it downloads the model to ComfyUI/models/OmniGen/Shitao/OmniGen-v1 automatically; the README's manual HuggingFace/BaiduNetdisk steps are only the fallback when that fails. The SDXL VAE gets pulled the same way.
The inputs that actually matter
Only a handful of fields are yours to care about:
- prompt - describe the output, and if you connect reference images, refer to them by placeholder:
a photo of {image_1} and {image_2} standing together. If an image is wired in but never referenced, or a placeholder is typed but no image is connected, you get junk. This is the #1 beginner mistake. - image_1 / image_2 / image_3 - the optional reference inputs. Wire up to three IMAGE tensors (Load Image nodes work fine). Practical note: the source currently has a quirk where the third image reuses the second one's file, so three-way mixes may not behave - plan around one or two.
- dtype -
default(≈12 GB VRAM) orint8(≈7 GB). If you're on an 8 GB card, int8 isn't a compromise, it's the only option. Quality loss is modest. - guidance_scale (default 2.5) and img_guidance_scale (default 1.6) - the first pushes the prompt's conditions, the second the reference images. Raise the former for obedience, expect less freedom.
- width / height - multiples of 16, 16–2048, default 1024².
- separate_cfg_infer (default on) - saves memory on big images at the cost of speed; flip off if you have headroom.
- use_kv_cache - off by default; enabling it speeds inference at the cost of more memory.
- cache_model - off means the model is unloaded after every run (12 GB of VRAM freed, but slow for iterating). On means it stays warm. Turn it on when you're dialing in a prompt, off before you forget.
- steps and seed work like anywhere else.
The single output is image (IMAGE), so it plugs straight into a Preview/Save Image node and anything downstream.
Installing it
Easiest path: ComfyUI Manager → search "OmniGen" (pack title is ComfyUI_OmniGen_Wrapper) → install → restart. Manual route:
cd ComfyUI/custom_nodes
git clone https://github.com/chflame163/ComfyUI_OmniGen_Wrapper.git
python -s -m pip install -r ComfyUI/custom_nodes/ComfyUI_OmniGen_Wrapper/requirements.txt
Then restart ComfyUI and find the node under Add Node → 😺dzNodes → OmniGen Wrapper. The heavy lifting is the model download (~3+ GB on first run) - let it finish, don't kill ComfyUI mid-download and assume it's hung.
Where people get burned
The wrapper's requirements pin numpy<2 and want transformers>=4.45, diffusers>=0.29, accelerate, timm, and peft - OmniGen is picky about these. If you already run other nodes that force newer/older versions, expect conflicts; the classic failure is an accelerate import error (clear_device_cache), fixed by pinning accelerate to 0.26.1. If inference blows up or the image looks scrambled, check your width/height are multiples of 16 and that every placeholder in the prompt has a matching connected image. And remember the honest expectations: OmniGen is fiddly to install and mid-tier on quality - but nothing else in ComfyUI does "merge these photos into one believable scene" in a single node.
Inputs (14)
| Name | Type | Default | Description |
|---|---|---|---|
| dtype | COMBO | 2 options: default, int8 | |
| prompt | STRING | input image as {image_1}, e.g. | — |
| width | INT | 102416–2048 | — |
| height | INT | 102416–2048 | — |
| guidance_scale | FLOAT | 2.51–5 | — |
| img_guidance_scale | FLOAT | 1.61–2 | — |
| steps | INT | 251–100 | — |
| separate_cfg_infer | BOOLEAN | true | Can save memory when generating images of large size at the expense of slower inference |
| use_kv_cache | BOOLEAN | false | Enable kv cache to speed up the inference |
| seed | INT | 00–1000000000000000000 | — |
| cache_model | BOOLEAN | false | Cache model in VRM to save loading time |
| image_1opt | IMAGE | — | |
| image_2opt | IMAGE | — | |
| image_3opt | IMAGE | — |
Outputs (1)
| Name | Type | Description |
|---|---|---|
| image | IMAGE | — |