ObjectClearVision
The masking prep step that tells the model what to delete
- iamge
- mask
- image
ObjectClear doesn't remove whatever your prompt says - it removes whatever a CLIP vision encoder sees in the masked region of the image. That's the bit everyone misses, and it's exactly what this small node is for. ObjectClearVision takes your photo and your mask, keeps only the pixels inside the mask, and zeroes out everything else. The output is a "here is the thing" image that you feed into CLIPVisionEncode to build the object embedding for the sampler.
Why it exists
Think of it as isolating the suspect. The prompt you write ("empty cafe, no people") describes what the cleaned scene should look like; the vision embedding identifies what's actually being deleted - with its real lighting, angle, and context. Without this step the model is working blind, which is why the example workflow runs image and mask through ObjectClearVision before anything touches the CLIP vision encoder.
The math is as simple as it looks: the image is multiplied by a binary mask (pixels above 0.5 stay, everything else goes to black). Two things follow from that. Your mask needs to be a solid, well-covered blob where the object is - soft feathered edges mean the encoder sees half a thing. And the masked image and the mask must have the same batch size, or the node raises a ValueError rather than guess.
Wiring
The path is short: an ImageToMask (or any segmentation node) → ObjectClearVision → CLIPVisionEncode → the sampler's vison_emb input. In the pack's own example, the same masked image also feeds the sampler's mask input, and the raw photo feeds its iamge input - so the model gets the object both as a visual embedding and as a region to work on.
The single image output is meant for the encoder, not for you. Don't be confused when it comes out looking like a mostly-black photo; that's the point.
Install and context
It's part of the standard ObjectClear install - git clone https://github.com/smthemex/ComfyUI_ObjectClear into custom_nodes/, restart, and grab the four model files from jixin0101/ObjectClear (the clip_vision piece is just clip-vit-large-patch14, which you likely already have - the loader article has the full table). No extra dependencies beyond what the pack ships.
One honest caveat: this node is a convenience wrapper around a two-line tensor multiply. You could replicate it with a math node, but then you'd be fighting batch shapes yourself - the wrapper handles single images and batches, and it's one less thing to wire wrong. For a one-node job, just use it.
Inputs (2)
| Name | Type | Default | Description |
|---|---|---|---|
| iamge | IMAGE | — | |
| mask | MASK | — |
Outputs (1)
| Name | Type | Description |
|---|---|---|
| image | IMAGE | — |