ObjectClearSampler
The node that deletes the shadow too
- model
- iamge
- mask
- positive
- negative
- vison_emb
- image
This is the whole point of the pack. Plain inpainting removes an object and leaves its shadow, its reflection, the stain where it sat. ObjectClearSampler takes those out too - the paper calls the object plus its traces the "effect," and the model is trained to delete the lot. If you've ever spent three extra inpaint passes chasing a shadow that refuses to die, that's the niche this node owns.
How it works
ObjectClear is a SDXL UNet fine-tuned for removal, and the sampler wires together the pieces that make it tick. The chain before it matters:
- A CLIP vision encoder embeds the masked region of the image - that's the "object" the model is about to remove.
- A postfuse module swaps that visual embedding into the text conditioning, replacing a token slot. Your prompt describes the scene; the embedding identifies the thing.
- During denoising, the model reads its own cross-attention at a specific mid-UNet layer to find the object-effect regions - the thing and its shadow - and steers them toward deletion, then an attention-guided fusion plus a wavelet color fix blends the seam.
That last bit is the real difference from a KSampler-based inpaint: the shadow isn't collateral damage, it's the target. The README's own selling line is that the result "isn't limited to the subject - the object's shadow also gets removed."
Wiring it in
It's a sampler-shaped node that is not a KSampler - no latent, no scheduler. Everything comes in pre-encoded:
- model - from ObjectClearLoader.
- iamge and mask - the photo you're cleaning and its mask (yes, the input is literally spelled "iamge"; that's the pack, not you).
- positive / negative - standard conditioning from a CLIPTextEncode wired to DualCLIPLoader. Positive describes what belongs in the cleaned image ("empty street, no people"), negative what mustn't appear.
- vison_emb - a
CLIP_VISION_OUTPUT, from CLIPVisionEncode fed by ObjectClearVision's masked image. This one's easy to forget, and without it the model has no idea what it's deleting.
The few settings you'll actually touch
- steps / cfg - 20 and 2.5 by default, SDXL-flavored. Bump steps to 30 if edges come back mushy.
- strength - default 0.99. This is full removal, not a light img2img nudge, so unlike other pipelines you rarely drop it. Lower it only if the model is over-writing beyond the mask.
- seed - lock it while you iterate, then vary it to reroll the fill.
- short_size - 512 default and the sweet spot; the model was trained at 512×512. You can push to 2048 in 64-step increments, but expect it to be worse, not better. The image gets resized so its short side lands on this value, and the output comes back at that processed resolution.
The single output, image, goes straight into a SaveImage (or an upscaler if you want the result back at full res).
Install, models, and gotchas
Same shared setup as the rest of the pack: git clone https://github.com/smthemex/ComfyUI_ObjectClear into custom_nodes/, restart, and drop the four model files from jixin0101/ObjectClear into checkpoints/vae/clip_vision/clip (details in the ObjectClearLoader article). Dependencies are light - no exotic pip installs.
Where people get burned: the missing vison_emb red link (forgot the CLIP vision path entirely), and feeding a mask that's too tight. The mask should cover the object plus a bit of its surroundings so the shadow region is inside it. Also worth knowing: this thing runs a full SDXL pass, so it's seconds-to-a-minute per image and a real VRAM bite - but unlike most of the object-removal discourse on reddit, it's genuinely praised: people are using it to generate clean training data where other models leave artifacts.
Inputs (11)
| Name | Type | Default | Description |
|---|---|---|---|
| model | MODEL_ObjectClear | — | |
| iamge | IMAGE | — | |
| mask | MASK | — | |
| positive | CONDITIONING | The conditioning describing the attributes you want to include in the image. | |
| negative | CONDITIONING | The conditioning describing the attributes you want to exclude from the image. | |
| vison_emb | CLIP_VISION_OUTPUT | — | |
| seed | INT | 00–2147483647 | The random seed used for creating the noise. |
| steps | INT | 201–10000 | The number of steps used in the denoising process. |
| cfg | FLOAT | 2.50.1–20 | The Classifier-Free Guidance scale balances creativity and adherence to the prompt. Higher values result in images more closely matching the prompt however too high values will negatively impact quality. |
| strength | FLOAT | 0.990–1 | — |
| short_size | INT | 512512–2048 | — |
Outputs (1)
| Name | Type | Description |
|---|---|---|
| image | IMAGE | — |