Content Mask Latent
A1111's masked-content dropdown, ported into ComfyUI
- init_image
- mask
- vae
- latents
- original_preview
- latent_noise_preview
- latent_nothing_preview
If you ever used Automatic1111's inpainting tab, you'll recognize this instantly: the "Masked content" dropdown - original, fill, latent noise, latent nothing - that decided what went under your mask before the model started denoising. This node ports three of those four options straight into ComfyUI (there's no fill mode here, just the other three), and adds something A1111 never gave you: a preview of what each mode would actually produce, before you commit to one.
The three modes, and what each one is actually for
original- starts from your init image's existing pixels inside the mask. The gentlest option, best when you're making a subtle change and want the model anchored to what's already there.latent_noise- fills the masked region with random noise before encoding. The right pick when you want the model to generate something genuinely new in that area rather than a variation on what's currently there.latent_nothing- fills it with a zero latent. Rarely the mode you actually want; it's here mostly for completeness and experimentation rather than as a go-to.
Inputs
content_mask is the mode picker above (defaults to original). init_image is your source image, mask is the region to treat as editable - and here's a gotcha worth flagging before it costs you time: despite the name, mask is typed IMAGE, not MASK. If you're feeding it from this same pack's MaskExpansion node (also typed IMAGE, conveniently) they'll connect fine; feeding it from a node that outputs a real MASK type means you'll need a conversion node in between. vae does the pixel-to-latent encode, so it needs to match your checkpoint's family. width/height set the working resolution, and seed feeds whichever randomness latent_noise mode needs.
Outputs
latents carries whichever mode you actually selected via content_mask - that's the one to wire into your KSampler. The other three outputs - original_preview, latent_noise_preview, and latent_nothing_preview - appear to compute and expose all three modes regardless of which one you picked, so you (or, in the Photoshop-bridge context this pack was built for, the plugin's own UI) can eyeball all three side by side before deciding which one to actually run with.
The take
Of everything in this pack, this is the node most worth using outside the Photoshop plugin entirely. It doesn't depend on any API-bridge machinery - it's a genuinely self-contained "prep my masked latent for inpainting" node, and the three-preview design is a small but real usability win over how most ComfyUI inpainting setups make you guess.
Installing it
ComfyUI Manager: search "Comfy-Photoshop-SD", install, restart. Or:
cd ComfyUI/custom_nodes
git clone https://github.com/AbdullahAlfaraj/Comfy-Photoshop-SD
Where people get burned
The IMAGE-typed mask input above is the first trap - a connection that ComfyUI's type checker will simply refuse if you're coming from an actual MASK socket. Second, make sure vae matches your checkpoint's architecture - an SDXL VAE handed an SD 1.5 latent (or vice versa) produces garbage without necessarily throwing a hard error. Third, general inpainting advice applies here same as anywhere: fix at your model's native resolution first and upscale afterward rather than setting width/height to something oversized up front - inpainting at an inflated resolution burns VRAM for no quality benefit and often looks worse, not better.
Inputs (7)
| Name | Type | Default | Description |
|---|---|---|---|
| content_mask | COMBO | original | 3 options: original, latent_noise, latent_nothing |
| init_image | IMAGE | — | |
| mask | IMAGE | — | |
| width | INT | 5120–16384 | — |
| height | INT | 5120–16384 | — |
| vae | VAE | — | |
| seed | INT | 00–18446744073709550000 | — |
Outputs (4)
| Name | Type | Description |
|---|---|---|
| latents | LATENT | — |
| original_preview | IMAGE | — |
| latent_noise_preview | IMAGE | — |
| latent_nothing_preview | IMAGE | — |