Nodes/DOGMA Nodes/DOGMA v35 Local Preserve Gate
ComfyUI Node

DOGMA v35 Local Preserve Gate

The gate that keeps your original crop

By axior·Created 4 months ago·Updated 3 days ago· 1
DOGMA v35 Local Preserve Gate
  • edited
  • original
  • image
  • info
prompt

The disclaimers on these node names are usually a joke. This one isn't. DOGMALocalResultGateV35 implements a single rule - if the prompt says preserve, the original crop is what continues down the graph - and the node's name exists because people keep wiring around it.

The rule, exactly

prompt comes in. If it starts with PRESERVE (case-insensitive, leading whitespace ignored), the image output is original, byte for byte, and edited is discarded. Otherwise image is edited.

Two IMAGE inputs, one STRING, one IMAGE out plus an info string that reads either exact preserve: Klein result discarded or repair active. Nothing to configure.

Why "byte for byte" is the interesting part

Detailing pipelines mostly blend. You composite a refined crop back with a feathered mask, or you colour-match it to the surroundings, or you alpha over it. All of that is fine when the crop was genuinely improved and quietly harmful when it wasn't - a feathered blend of an unimproved crop is just a slightly different unimproved crop, with a seam to go with it.

This gate doesn't blend. The preserve branch returns the original tensor, so when the stitch node composites that crop the pixels are identical to what was already there. No seam, no VAE round-trip damage, no colour drift. The crop that "shouldn't have been touched" is provably untouched.

Which is the actual argument for masked workflows over whole-frame editing in the first place: an edit model re-encodes and regenerates everything, so unmasked pixels shift a little on every pass and degrade across a chain of passes. Masked compositing touches nothing else. This gate is that promise enforced per crop.

Making it survive an unattended run

The failure mode isn't the node, it's the wire. The gate keys off the literal first word of the prompt, so:

  • feed prompt from the same prompt node that drives the sampling pass - not from a text node you edited
  • don't prepend anything, including a comment
  • don't pass it through a node that adds whitespace before the text and strips after, if that node uppercases or reflows

And check the info string when a run finishes. If you see repair active on every single group, either your image really is damaged everywhere or your VLM is over-eager. If you see exact preserve everywhere, you spent a GPU pass on nothing and your VLM instruction needs fixing. That's the diagnostic this node gives you for free, and it's the reason I'd rather have it in the graph than not.

Inputs and outputs

edited, original, prompt in; image, info out.

Install

ComfyUI Manager → search DOGMA Nodes, or:

cd ComfyUI/custom_nodes
git clone https://github.com/axior/ComfyUI-DOGMA-Nodes

Restart ComfyUI and look under DOGMA/Semantic Detailer. No pip installs, no model files - the pack's only dependencies are PyTorch and ComfyUI's own APIs.

Which gate should you actually use?

There are three in this pack and they're a ladder, not duplicates.

DOGMALocalResultGateV35 and DOGMALocalResultGateV34 are the same gate - same condition, same output behaviour, different wording in the info line. Take whichever matches the version of the prompt nodes you're running so your logs read consistently.

DOGMALocalSafetyGateV36 is the interesting one: it still returns the original on a preserve prompt, but on a repair prompt it measures how far the edit drifted from the source and blends the edit back toward the original by an amount that grows with that distance. In other words: you can accept an edit and cap it. Use the plain gate when you trust your prompt and mask; use the safety gate when you're running unattended and would rather have a slightly undercooked repair than a confident wrong one.

CategoryDOGMA/Semantic Detailer

Inputs (3)

NameTypeDefaultDescription
editedIMAGE
originalIMAGE
promptSTRING

Outputs (2)

NameTypeDescription
imageIMAGE
infoSTRING