🪐TTP Inpainting Preprocessor HYDiT
The 'paint the hole black' preprocessor for mask inpainting
- image
- mask
- blackened_image
Despite the space-themed display name, "🪐TTP Inpainting Preprocessor HYDiT" is one of the simplest nodes in the whole TTP pack: it takes your image, takes your mask, and paints the masked area black. That's it. The class is even honest about it - it's called MaskBlackener under the hood.
Why blacking out a mask is a thing
Dedicated inpainting checkpoints from the SD 1.5 era were trained on images where the masked region was blanked out. Feed the model a black hole, and it treats that region as "generate from scratch here," guided by your prompt. It's the same reason the mask is a condition rather than a suggestion: the model knows exactly where it's allowed to invent.
The modern way to inpaint is to leave the masked region's pixels in the latent and let denoising strength decide how much to rewrite - no blacking required. So why keep this trick around? Two reasons. First, if you want the regenerated area to owe nothing to the pixels underneath (a full relight, a completely different object, hiding what was there), a black hole guarantees the old content can't bleed into the result. Second, some SDXL and Illustrious inpainting fine-tunes still behave better when the hole is literally empty, at high denoise. Mask-based inpainting still owns one thing edit models can't give you - bit-identical unmasked pixels - and this node is the old-school way to make the masked side fully blank.
What it takes and gives
Two inputs, one output, zero settings:
image- the base image (IMAGEtensor).mask- aMASKtensor. Semantics matter: white in the mask gets blacked out, black keeps the original. If you've inverted the mask, you get exactly the wrong result, so it's the first thing to check when the output looks bizarre.blackened_image- the output, anIMAGEtensor, same dimensions as the input. Wire it (along with the mask) into the VAE-encode / latent path of your inpainting workflow, or feed it to an inpaint-capable model as its context image.
One caveat from reading the source: it calls image.squeeze(0), which means it assumes a single image. Feed it a batch of more than one and it'll choke. Run it one image at a time and you're fine.
Installing and using it
Same pack as the TTP tile preprocessors, same install:
cd ComfyUI/custom_nodes
git clone https://github.com/TTPlanetPig/Comfyui_TTP_CN_Preprocessor
or use ComfyUI Manager and search "Comfyui_TTP_CN_Preprocessor", then restart. There are no models to download - the whole pack's dependency is just opencv-python-headless, and this node doesn't even need that. It's pure PIL Image.composite, runs in milliseconds on CPU.
The honest take
If you're doing normal object-removal or touch-up inpainting with a modern model, you probably don't need this node - the built-in mask workflow handles it. Reach for it when you specifically want a fully blanked hole: high-denoise regeneration, inpaint fine-tunes that were trained on blacked regions, or forcing the model to rebuild a region from the prompt alone. It's a two-input utility node, and for that one job it does it correctly.
Inputs (2)
| Name | Type | Default | Description |
|---|---|---|---|
| image | IMAGE | — | |
| mask | MASK | — |
Outputs (1)
| Name | Type | Description |
|---|---|---|
| blackened_image | IMAGE | — |