Apply ControlNet Inpainting (AliMama)
The inpainting ControlNet that hides a mask in a channel
- positive
- negative
- control_net
- vae
- image
- mask
- positive
- negative
ControlNetInpaintingAliMamaApply is the mask-aware variant of Apply ControlNet Advanced, built for inpainting ControlNets. The "AliMama" in the name - which throws everyone - is just the model family this pattern was designed around: a ControlNet that takes the image and your mask as separate conditioning channels, so the model knows both what the picture looks like and where it's allowed to change it. If you've been doing masked inpainting by feeding a painted image into a regular ControlNet, this is the node that does it properly.
How it works
The mechanism is the interesting part. A regular ControlNet sees a single conditioning image. An inpainting ControlNet wants an extra channel - the mask - and this node builds it for you. It inverts the mask (the code literally computes 1 - mask), upscales it to the image size, and feeds the mask as an extra_concat channel alongside the (masked) image into the ControlNet application. So the network gets the visible pixels where the mask says "keep" and a hole where it says "fill," plus the raw mask geometry as a separate channel.
From there it's the standard controlnet application you already know from ControlNetApplyAdvanced: strength (default 1), start_percent and end_percent (default 0 and 1) control how hard and for which sampling steps the condition bites. Same mental model, same tuning habits.
Inputs that matter
- control_net - your inpainting ControlNet model (from ControlNet Loader). The
concat_maskflag on the model is what triggers the mask-channel path. - image + mask - the source image and the inpaint region.
- vae - needed to encode the image for the ControlNet.
- strength / start_percent / end_percent - the usual control dials.
Outputs are the modified positive and negative conditioning, which go on to your sampler. The node handles both sides of the CFG in one shot.
Where it fits
Ships with ComfyUI core, and it's a somewhat niche classic - inpainting ControlNets never had the ecosystem footprint of depth or pose models. The wider context from the KB is worth keeping in mind: since 2025, instruction-editing models (Qwen-Edit, Kontext) swallowed most inpainting work, but masked inpainting still uniquely owns bit-identical unmasked pixels - nothing else in the frame moves, which matters for compositing and fixing. If your workflow is "keep everything except the region I marked," this node is the correct, official path for that with a ControlNet in front.
Common issues
The usual suspect: feeding a black-on-white mask when the node expects the opposite (or vice versa). It inverts internally, so if your painted region comes out wrong, flip the mask and try again. Second: forgetting the model actually has to be an inpainting ControlNet - a plain ControlNet doesn't have the concat_mask behavior, and this node's extra mask channel quietly does nothing useful. And match the mask resolution to the image; the node upscales it, but starting far apart degrades the edge fidelity you tuned the mask for.
Inputs (9)
| Name | Type | Default | Description |
|---|---|---|---|
| positive | CONDITIONING | — | |
| negative | CONDITIONING | — | |
| control_net | CONTROL_NET | — | |
| vae | VAE | — | |
| image | IMAGE | — | |
| mask | MASK | — | |
| strength | FLOAT | 1.000–10 | — |
| start_percent | FLOAT | 0.0000–1 | — |
| end_percent | FLOAT | 1.0000–1 | — |
Outputs (2)
| Name | Type | Description |
|---|---|---|
| positive | CONDITIONING | — |
| negative | CONDITIONING | — |