Nodes/DOGMA Nodes/DOGMA v39 Global Detail Donor
ComfyUI Node

DOGMA v39 Global Detail Donor

DOGMA v39 Global Detail Donor

By axior·Created 4 months ago·Updated 3 days ago· 1
DOGMA v39 Global Detail Donor
  • generated
  • source
  • image
  • detail_weight
  • info
mid_strength0.28
detail_strength0.82
drift_start0.035
drift_end0.105
support_floor0.24

Every tile-based detail pass gives you a generated image that is sharper and, somewhere, wrong. The sharpness is why you ran it. The wrongness is a building that moved four pixels, a texture that resolved into a shape that isn't there, a sky that decided to grow a tower.

This node takes the sharpness and refuses the wrongness, and the way it decides is the interesting part: it measures how much the generated tile drifted from the source, and where drift is large it stops importing structure.

What it is

It's the "detail donor" in the pack's v39 vocabulary - a whole-frame pass, run after tiles are combined, that enriches a source image with detail from a generated one. It's the deliberate counterpart to DOGMAGlobalLowFreqLockFastV24: that node takes the low frequencies from the source and keeps everything else from the generated image, this one keeps the source's structure and imports only the generated micro-detail.

Placed sensibly, the pair gives you a frame that is tonally the original photograph and texturally new. Which, for restoration work, is the whole goal.

How it works

Both generated and source are split into three frequency bands using two area-downsample-and-upsample round trips - one at 1/16 scale for the low band, one at 1/4 for the low+mid band. So low is the over-16 blur, mid is the 4-vs-16 residual, and high is what's left above the 1/4 band. Source bands get a b prefix, generated bands a p prefix.

Two guards then modulate what may be transplanted.

The drift guard compares the low bands: drift = mean(|p_low - b_low|). When generated and source disagree a lot at low frequency, that's not detail, that's invention, and guard falls from 1 toward 0 as drift rises between drift_start (0.035) and drift_end (0.105). At high drift the node effectively declines to import anything.

The support map asks where the source actually has something to sharpen. It builds an edge/deviation estimate from the source's luminance - horizontal and vertical gradients plus deviation from a local mean - normalises it against a threshold of 0.045, blurs it, and blends it with support_floor so that flat regions aren't fully locked out. The floor is what allows genuine deblurring of soft areas while keeping "nothing here" from becoming "something here." The two multiply into weight.

The final composite rebuilds the image band by band: the source's low and mid bands, plus the generated mid and high residuals each blended in by mid_strength * weight and detail_strength * weight. Nothing from the generated low band survives. That is why the node can add texture without relocating your building.

Inputs and outputs

Six inputs. generated and source are IMAGE; the node resamples the source if the sizes differ and reuses the first source frame for a batch. mid_strength (0–1, default 0.28) and detail_strength (0–1.2, default 0.82) set how much generated mid and high frequency goes in - the identical names and defaults as DOGMAGlobalControlsV39 emits, so you can fan them from one controls node to every donor in the graph. drift_start and drift_end (0.035 / 0.105 by default, with drift_end forced above drift_start) set the drift curve. support_floor (0–1, default 0.24) is the dial for how much flat area is allowed to receive detail.

Three outputs: image (IMAGE), detail_weight (MASK) and info (STRING). The mask is the real diagnostic - it's the per-pixel weight map, so a preview of it shows you exactly where the node decided to trust the generated image. Mostly bright means it imported nearly everything; mostly black means it protected nearly everything. And info reports the mean weight and mean drift, which is the fastest "did this do anything?" check in the whole pack. If mean weight comes back 0.02, you ran a node for nothing.

Install

ComfyUI Manager → search DOGMA Nodes (publisher axior), install, restart. Manual:

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

No pip installs - requirements.txt is a one-line "no external dependencies" note - and the repository contains no model weights. It's tensor arithmetic in torch.

Common issues

The honest caveat first: this node's dials are empirical, not principled. drift_start 0.035 and support_floor 0.24 are values the author tuned on their own material, and "drift" is a mean absolute difference in a normalised colour space, so a high-contrast source and a flat scanned plate will not sit in the same place on that curve. Tune them against detail_weight, not against intuition.

The failure that actually looks broken is banding or a haloed look at strong edges, and there are two ways to get it: detail_strength pushed past 1.0 (the range allows up to 1.2 and it will amp the generated high band above a straight copy), or a support_floor high enough that flat regions get invented texture - a sky that starts to grain, a wall that grows a pattern. If the result looks "over-sharpened but not wrong," that's usually the floor.

And the ordering constraint: this is a global pass on the assembled master. Run it per-tile and each tile gets its own local frequency decomposition, which is exactly the tile-divergence problem the whole crop-and-stitch approach exists to avoid.

CategoryDOGMA/v39

Inputs (7)

NameTypeDefaultDescription
generatedIMAGE
sourceIMAGE
mid_strengthFLOAT0.280–1
detail_strengthFLOAT0.820–1.2
drift_startFLOAT0.0350–0.3
drift_endFLOAT0.1050.01–0.5
support_floorFLOAT0.240–1

Outputs (3)

NameTypeDescription
imageIMAGE
detail_weightMASK
infoSTRING