[Inference.Core] OneFormer COCO Segmentor
Segmentation Tuned for Objects, Not Rooms
- image
- IMAGE
This is the sibling to the ADE20K OneFormer node in this same pack, same underlying model architecture, different training data - and the difference in training data is the whole reason to pick one over the other. COCO-Stuff pairs common object categories (person, car, dog, bottle, chair - the everyday-object vocabulary COCO is known for) with "stuff" classes for the background (grass, sky, road, water). ADE20K leans harder into scene structure - walls, floors, architecture. If your source image is object-centric - people and things sitting in a scene - COCO's category set matches what's actually in the frame better than ADE20K's room-and-building bias does.
Segmentation conditioning tells a diffusion model what category each region belongs to, not what it should look like or how far away it is - a flat color-coded map where each color is a semantic class, leaving appearance entirely up to the prompt. It's the layout-control end of the ControlNet spectrum, sitting apart from edge detectors (which fix shape) and depth maps (which fix distance).
What you set: image is required, resolution (default 512) is the only optional parameter - there's nothing else to tune, which is typical of the neural segmentation nodes in this pack versus the classical edge detectors that expose threshold knobs. The single IMAGE output is the color-coded segmentation map, wired into a ControlNet Apply node paired with a Segmentation ControlNet checkpoint loaded separately - this preprocessor only prepares the condition, it doesn't apply the ControlNet itself.
The same honest caveat applies here as with its ADE20K sibling: segmentation conditioning didn't survive the move to newer base models nearly as well as canny, depth, and pose did. SDXL's xinsir union is still the strongest, most complete home for it, and it's one of only two places segmentation conditioning genuinely works well as of 2026 - the other being a community-trained SAM-based model on Z-Image. None of the official unions for Flux.1, Qwen-Image, Flux 2, or Z-Image's own union line ship a segmentation condition. If your project actually needs region-level layout control on a current-generation base, expect to reach back to SDXL for that specific pass rather than finding it natively supported wherever you're currently working.
Because this runs a real transformer model (OneFormer, Swin backbone, COCO-Stuff weights) rather than a classical filter, it needs pretrained weights downloaded on first use - expect that pause and the associated disk usage the first time you run it, distinct from the classical preprocessors elsewhere in this pack that need nothing extra.
Installing it: bundled in LykosAI's ComfyUI-Inference-Core-Nodes - LykosAI also builds Stability Matrix, the meta-installer many people use for managing multiple local SD UIs, so this pack's dependency and install handling is a step more deliberate than a typical solo repo. Install through ComfyUI Manager (search "ComfyUI-Inference-Core-Nodes"), or manually: cd ComfyUI/custom_nodes && git clone https://github.com/LykosAI/ComfyUI-Inference-Core-Nodes, then run install.py against ComfyUI's own Python environment, or pip install -e .[cuda] / .[cuda12] / .[rocm] / .[directml] / .[cpu] matched to your hardware, or a plain pip install -e . without acceleration. Restart ComfyUI when done.
Troubleshooting: the recurring pack-wide issue is ModuleNotFoundError: No module named 'inference_core_nodes', which means the Python install step didn't complete after the git clone - often from install.py running against the wrong interpreter on a portable ComfyUI build, where you need to target python_embeded directly. Specific to this node, a first-run failure or hang is worth checking against the weight download completing successfully before assuming a code bug - a flaky connection on the first call is a more common culprit than the node itself. And if your generation looks confused rather than obviously guided, make sure the ControlNet you loaded is actually trained for segmentation input - this map means nothing to a Canny or Depth checkpoint.
Inputs (2)
| Name | Type | Default | Description |
|---|---|---|---|
| image | IMAGE | — | |
| resolutionopt | INT | 51264–2048 | — |
Outputs (1)
| Name | Type | Description |
|---|---|---|
| IMAGE | IMAGE | — |