Set Latent Noise Mask node in ComfyUI
Set Latent Noise Mask attaches a MASK to a LATENT so the sampler only changes the white area: inpainting and regional regeneration with any normal checkpoint.
Node pack: ComfyUI core
Category: Masks and inpainting
What Set Latent Noise Mask does
KSampler can restrict denoising to part of a latent when the latent carries a noise mask. Set Latent Noise Mask takes an encoded image and a mask and returns the latent with that mask attached. Everything outside the mask is kept from the original latent at each step, so the result blends naturally with the untouched part.
Because the original pixels are still under the mask, this method works with ordinary checkpoints and at any denoise: 0.4 to repaint while keeping shapes, 0.9 to replace the content entirely. It pairs with Load Image mask editor output, Grow Mask and Feather Mask.
Inputs
Name | Type | What it is |
|---|---|---|
samples | LATENT | The latent from VAE Encode (the full picture). |
mask | MASK | White where the sampler may change pixels. |
Outputs
Name | Type | What it is |
|---|---|---|
LATENT | LATENT | The latent with a noise mask for KSampler. |
AD

Skip the setup: ComfyUI workflows preinstalled on the cloud
BitVector runs ready-made ComfyUI workflows on its own GPUs. No install, no missing nodes, no red boxes. Open it on your phone or laptop and generate in a minute.
How to use Set Latent Noise Mask
- Load Image, paint a mask in the mask editor (right-click, Open in MaskEditor).
- VAE Encode the image.
- Set Latent Noise Mask with the encoded latent and the image MASK output.
- KSampler with denoise 0.5-0.9, then VAE Decode.
Settings and tips
- Grow and feather the mask (GrowMask 8-16, FeatherMask) for invisible seams.
- Describe the whole scene in the prompt, not only the patch; the model still sees the full latent.
- For replacing objects completely, denoise 0.9-1.0 plus a larger mask works better than a tight mask.
- To crop-and-stitch at higher detail use the Inpaint Crop and Stitch nodes or Impact Pack Detailer.
Troubleshooting Set Latent Noise Mask
The whole image changes, not only the masked part
Why it happens
The mask is empty or inverted (black where you painted), or the sampler receives the unmasked latent.
How to fix it
Preview the MASK with a Convert Mask to Image node; invert with InvertMask if needed; wire the Set Latent Noise Mask output into the sampler.
A visible rectangle or outline around the edit
Why it happens
Hard mask edge with no feathering, or the mask was drawn at a different size than the image.
How to fix it
Feather or grow the mask by 8-24 pixels and make sure the mask comes from the same Load Image node as the pixels.
The masked region stays almost identical
Why it happens
denoise is too low for the change requested.
How to fix it
Raise denoise to 0.7-1.0 for new content.
AD

Run this workflow from your phone
Every workflow on this page is preinstalled on BitVector with the models and custom nodes already in place. Pick one, type a prompt, done. Zero setup, nothing to download.
Questions about Set Latent Noise Mask
Set Latent Noise Mask or VAE Encode (for Inpainting)?
Noise mask for normal checkpoints and partial edits; VAE Encode (for Inpainting) for dedicated inpainting checkpoints and full replacement.
Can I use a mask from another image?
Yes, any MASK of the same size works, including masks from segmentation nodes.
Related nodes
VAE Encode and VAE Encode (for Inpainting)
ComfyUI core
VAE Encode converts a pixel IMAGE into a LATENT for img2img; VAE Encode (for Inpainting) does the same while blanking the masked area so an inpainting model can repaint it.
Load Image
ComfyUI core
Load Image reads a picture from the ComfyUI input folder (or an upload) and outputs an IMAGE tensor plus a MASK taken from the alpha channel, the starting point for img2img, inpainting, ControlNet and IP-Adapter graphs.
Load Image (as Mask)
ComfyUI core
Load Image (as Mask) turns one channel of a picture (alpha, red, green or blue) into a MASK, so black-and-white mask files or painted layers can drive inpainting and compositing.
KSampler
ComfyUI core
KSampler runs the denoising loop: it takes the model, prompts and a latent and produces the finished latent image, controlled by seed, steps, cfg, sampler, scheduler and denoise.
AD

Tired of fixing nodes? Let the cloud do it
BitVector keeps hundreds of ComfyUI workflows installed, updated and tested on fast cloud GPUs. No Python, no CUDA errors, no VRAM limits. Works from any browser.
More ComfyUI nodes
CLIP Text Encode (Prompt)
ComfyUI core
CLIP Text Encode turns a text prompt into CONDITIONING using the model text encoder. One node holds the positive prompt, a second one the negative prompt.
ComfyUI Manager
ComfyUI-Manager
ComfyUI Manager is the extension that installs, updates and fixes custom node packs and models from inside the interface, resolves missing nodes in imported workflows and snapshots your setup.
Load Checkpoint
ComfyUI core
Load Checkpoint (CheckpointLoaderSimple) opens a .safetensors or .ckpt model file and hands out the three parts every workflow needs: the diffusion MODEL, the CLIP text encoder and the VAE.
Save Image
ComfyUI core
Save Image writes the IMAGE tensor to ComfyUI/output as a PNG, with the whole workflow embedded in the file metadata so the picture can be dragged back into ComfyUI to restore the graph.
VAE Decode
ComfyUI core
VAE Decode converts the sampled LATENT into a pixel IMAGE with the VAE; VAE Decode (Tiled) does the same in tiles for very large images.
Empty Latent Image
ComfyUI core
Empty Latent Image creates the blank latent canvas (width, height, batch_size) that text-to-image sampling starts from; dimensions must be multiples of 8 and match the model family.

Model
Trends
.ai
© ModelTrends.ai
|
Made in Japan
|
© 2026