Preview Bridge Ext. Latent (DazzleNodes)
Edit the Noise Mask Right on the Latent Preview
- latent
- vae
- mask_opt
- dazzle_signal
- latent
- mask
- preview
- info
The image version of Preview Bridge Extended shows you pixels. This one is the sibling for latent-space inpainting, and it solves the awkward bit of that workflow: you're working with a LATENT you can't see, but the mask lives in pixel space. Preview Bridge Ext. Latent decodes the latent with a VAE so you can actually look at it and draw on it, edits your noise mask, and hands the original, untouched latent back out the other side.
The important word there is "untouched." Feed it latent and vae, and the latent output is the same tensor that went in - the VAE decode is only for the preview you paint on. Nothing about your sampling state gets degraded by a round-trip through the VAE, which is exactly the failure mode the inpainting community has been warning about for years (every encode/decode cycle shifts pixels; people build whole composite workflows just to avoid it).
What it does with your mask
Because the node lives in latent space, it does one thing the image version can't: it reads the noise_mask straight out of the LATENT dict (that's the mask KSampler carries around), upscales it to pixel space for editing, and ORs it together with any mask_opt you wire in. So the mask you see and edit is genuinely the one the sampler would have used - no separate mask node, no guessing which mask is "the" mask.
The one widget unique to this variant is inject_noise_mask. Default no means the edited mask comes out the mask slot and it's your job to apply it (classically with SetLatentNoiseMask). Set it to yes and the edited mask is written back into LATENT.noise_mask automatically, so the latent output is fully inpaint-ready on its own.
Everything else carries over from the image version, and the tooltips are the spec:
- mask_output - what the output mask carries:
combined,mask_editor, orinput_mask. - editor_target - what the editor may touch, with red = input mask and orange = editor drawings.
- restore_mask - keep your mask across image changes (never / always / if_same_size).
- block - halt execution if the output mask is empty or nothing's drawn;
alwaysas a debugging backstop. - dazzle_signal - optional hookup to Dazzle Command for play/pause gating.
The four outputs are latent (passthrough), mask (your edited result), preview (the decoded image), and info (a status string). There's also a small image string field on the node that's the frontend's preview-filename slot - the extension manages it, you don't type in it.
Typical setup
Connect KSampler's latent to this node, add a VAE, paint the region you want regenerated, and route the latent output back to a second KSampler pass - or straight to decoding if you've already edited the noise mask and want to see the result. With inject_noise_mask on yes, that's a two-node inpainting edit: this node plus the sampler.
Installing it
Same pack, same story: search DazzleNodes in ComfyUI Manager, or:
cd ComfyUI/custom_nodes
git clone --recursive https://github.com/DazzleNodes/DazzleNodes.git
Restart, find it under DazzleNodes → Preview Bridge Ext. Latent. No models, no extra deps. The only real gotcha is the empty-mask shape bug that afflicts all preview-bridge-style nodes - an empty mask can come out as [H, W] instead of [B, H, W] and confuse downstream crop nodes. Set block to if_empty_mask while you're getting the hang of it and it can't silently reach your sampler.
Inputs (10)
| Name | Type | Default | Description |
|---|---|---|---|
| latent | LATENT | — | |
| vae | VAE | — | |
| image | STRING | — | |
| mask_optopt | MASK | — | |
| mask_outputopt | COMBO | combined | Controls what goes to the OUTPUT mask slot. combined: OR combine input_mask + mask_editor drawings mask_editor: Only output the editor mask layer input_mask: Only output the input mask layer Preview displays the selected output mode (WYSIWYG). |
| editor_targetopt | COMBO | combined | Controls WHAT is editable in MaskEditor. Display always shows: red=input mask, orange=editor mask. combined: Edit both input + editor masks together (default) mask_editor: Only edit editor mask (input mask shown as red, locked) input_mask: Only edit input mask (editor mask shown as orange, locked) |
| restore_maskopt | COMBO | never | if_same_size: Restore cached mask if new image has same dimensions always: Always restore cached mask (resized if needed) never: Do not restore cached masks Note: restore_mask has higher priority than block |
| blockopt | COMBO | never | never: Never block execution if_empty_mask: Block if the OUTPUT mask is empty if_empty_editor: Block if user hasn't drawn in MaskEditor always: Always block execution (debugging backstop) |
| inject_noise_maskopt | COMBO | no | Controls whether the edited mask is injected into the LATENT output as noise_mask. no: LATENT passes through unchanged. Use MASK output with SetLatentNoiseMask. yes: Edited mask is written into LATENT.noise_mask automatically. |
| dazzle_signalopt | DAZZLE_SIGNAL | Orchestration signal from Dazzle Command node. Controls block behavior based on workflow state (playing/paused). Optional -- no effect without connection. |
Outputs (4)
| Name | Type | Description |
|---|---|---|
| latent | LATENT | — |
| mask | MASK | — |
| preview | IMAGE | — |
| info | STRING | — |