Nodes/ComfyUI-Alimama-ControlNet-compatible/Alimama SD3 Inpaint ControlNet Apply Advanced
ComfyUI Node

Alimama SD3 Inpaint ControlNet Apply Advanced

Where your mask becomes a hole in the image

By zhiselfly·Created 2 years ago·Updated 2 years ago· 18
Alimama SD3 Inpaint ControlNet Apply Advanced
  • positive
  • negative
  • control_net
  • vae
  • image
  • mask
  • positive
  • negative
strength1.00
start_percent0.000
end_percent1.000

The loader in this pack is a boring file-fetcher. This node is the interesting half of the pair, because it's where your painted mask actually becomes part of the generation.

Here's the thing to understand first: the Alimama SD3 inpainting ControlNet isn't conditioned on a preprocessed edge map like a classic ControlNet. It's trained to take the masked image plus the mask itself as extra channels of the latent. So Apply Advanced does the surgery that makes that possible, right before sampling.

What it actually does

Run through the source, the flow is:

  1. Zero out the mask. It clones the image and sets every pixel where the mask is above 0.5 to black, then VAE-encodes the result to a latent.
  2. Append the mask as a channel. It resizes the mask to the latent's resolution, inverts it (mask becomes 1−mask), and concatenates it as an extra channel - that 16+1-channel latent is exactly what the Alimama ControlNet's patch embedding was trained to eat.
  3. Attach to conditioning. It injects the ControlNet into both your positive and negative conditioning with your strength and start/end percentages, and sets control_apply_to_uncond to false, which keeps the negative prompt handling sane.

One nice detail: strength == 0 short-circuits and returns your conditioning untouched. That's a free A/B switch - set strength to 0 and the graph behaves like the ControlNet isn't there, no rewiring.

It also interpolates the mask to match the image and latent sizes automatically, so a low-res mask won't throw a shape error - though it won't blur it for you, and feathered edges are still your job.

The inputs that matter

  • image and mask - your source image and the mask from a mask-drawing node. Feed it a feathered mask or you'll see a seam.
  • vae - the SD3 VAE matching your checkpoint. Get this wrong and colors go weird.
  • control_net - from this pack's loader, specifically. It type-checks: load the ControlNet with anything else and you'll get "Please use SD3AlimamaInpaintControlNetLoader to load the ControlNet."
  • strength - default 1.0, range 0–10. This is the first dial you turn.
  • start_percent / end_percent - when during denoising the condition is active (0.0–1.0). With a structure ControlNet you'd often end at 0.5 and let the model finish freely, but for inpainting the mask defines the region, so most people leave it on for the full sample.

Outputs

Two CONDITIONING streams, positive and negative, wired straight into your sampler. Nothing else.

The reality check

This exact node is redundant on any modern ComfyUI: core ships ControlNetInpaintingAliMamaApply, which does the identical VAE-encode-and-concat-mask dance. Same inputs, same outputs, same defaults. Keep this pack around for old installs or workflows that hard-reference the name - otherwise use the core node and delete a dependency.

Troubleshooting

  • The masked area comes back blank. Classic inpaint-ControlNet behavior when it's active from step 0 on a region the model has no context for. The standing community fix is to rough in a vague shape - a blob of color in the mask area - so the model has something to refine, then let the ControlNet fill it in. Second option: nudge start_percent up so the model sketches the region before the control locks it down.
  • Seam or color mismatch at the boundary. Feather your mask before it reaches this node, and make sure the VAE matches the checkpoint.
  • "Please use SD3AlimamaInpaintControlNetLoader" - you loaded the ControlNet with a different loader. Rebuild that connection.
CategoryAlimamaInpaintControlNetCompatible

Inputs (9)

NameTypeDefaultDescription
positiveCONDITIONING
negativeCONDITIONING
control_netCONTROL_NET
vaeVAE
imageIMAGE
maskMASK
strengthFLOAT1.000–10
start_percentFLOAT0.0000–1
end_percentFLOAT1.0000–1

Outputs (2)

NameTypeDescription
positiveCONDITIONING
negativeCONDITIONING