Nodes/ComfyWarp/MixConsistencyMaps
ComfyUI Node

MixConsistencyMaps

The mask that decides what to trust

By Sxela·Created 3 years ago·Updated 2 months ago· 49
MixConsistencyMaps
  • missed_consistency
  • overshoot_consistency
  • edge_consistency
  • MASK
blur1
dilate2
force_binarytrue
missed_consistency_weight1.00
overshoot_consistency_weight1.00
edges_consistency_weight1.00

Here's the problem ComfyWarp spends most of its brainpower on: when you warp the previous stylized frame forward with optical flow, some of it is trustworthy and some of it isn't. A static wall? Warps perfectly, you want to reuse that style. A hand that just appeared from behind a person's head? There's no previous-frame data for it at all - the warped frame will be garbage there, and blending it in produces ghosting and trails.

ExtractOpticalFlow hands you three masks that each describe one flavor of "don't trust this region": the occlusion mask (content that has no source in the previous frame), the border mask (content pushed off-frame), and the motion-edge mask (sharp changes in motion). This node is the referee. It takes all three, multiplies their vetoes together, and outputs one clean mask that says "blend here, don't blend there."

The inputs that matter

  • missed_consistency, overshoot_consistency, edge_consistency - the three masks from ExtractOpticalFlow, in that order. Wire them up as-is.
  • missed_consistency_weight, overshoot_consistency_weight, edges_consistency_weight (all default 1) - each one scales how much that mask is allowed to veto a pixel. This is your tuning surface: seeing trails on moving objects? The occlusion veto (missed_consistency_weight) is the one to lean on. Seeing smearing at the frame edges? That's the overshoot mask, raise its weight.
  • force_binary (default on) - snaps the result to pure 0 or 1. WarpFusion's classic look is hard-edged: a pixel is either warped-style or current-frame. Turn it off and you get a soft, feathered mask that produces gentle blends instead.
  • blur (default 1) and dilate (default 2) - post-processing on the combined mask. Dilate is your friend here: it fattens the "don't trust" regions slightly so compositing seams don't land exactly on motion boundaries.

How the mixing works

Mechanically, all three masks are multiplied together with their weights as exponents of veto strength - every mask has to give the region a pass before it's considered consistent. force_binary then thresholds the product at 0.5, and blur/dilate clean it up. The single MASK output is what you'd plug into ApplyMask (or the flow-blend compositing chain) to decide how the warped stylized frame and the raw current frame get combined.

The one-liner mental model

Think of it as "confidence × 3." Each mask is a region saying "I don't trust the warp here," and the node returns the intersection of all their distrust. When a shot looks right except for one class of artifact - ghosting on movement, smearing at borders, or seams at motion edges - you now know exactly which weight to turn, and it's the only thing you'll ever need to touch on this node. The rest of the time it sits at defaults and just works.

CategoryWarpFusion

Inputs (9)

NameTypeDefaultDescription
missed_consistencyMASK
overshoot_consistencyMASK
edge_consistencyMASK
blurINT10–100
dilateINT20–100
force_binaryBOOLEANtrue
missed_consistency_weightFLOAT1.000–1
overshoot_consistency_weightFLOAT1.000–1
edges_consistency_weightFLOAT1.000–1

Outputs (1)

NameTypeDescription
MASKMASK