Nodes/MD Nodes/MD: NaN Guardian
ComfyUI Node

MD: NaN Guardian

A ComfyUI node in MD_Nodes/Debugging with 4 inputs and 1 output.

By MDMAchine·Created about a year ago·Updated 2 months ago· 14
MD: NaN Guardian
  • latents
  • latents
actionGraceful Interrupt
debug_mode0 - Silent
enable_profilingfalse
CategoryMD_Nodes/Debugging

Inputs (4)

NameTypeDefaultDescription
latentsLATENTINPUT LATENTS • Purpose: The latent tensor output from a sampler or encoder. • Range: Standard ComfyUI LATENT dictionary. • Trade-offs: Minimal performance overhead to pass through. ⭐ Recommended: Connect immediately after your main KSampler.
actionCOMBOGraceful InterruptDEFENSE ACTION • Purpose: What to do when corrupted math (NaN/Inf) is detected. • Options: - Raise Hard Error: Halts queue and throws red UI error. - Graceful Interrupt: Safely halts (acts like clicking 'Cancel' in UI). - Zero Out (Rescue): Replaces corrupted tensors with zeros. ⭐ Recommended: Graceful Interrupt for unattended batch queues.
debug_modeCOMBO0 - SilentLOGGING VERBOSITY • Purpose: Controls console output detail level. • Options: 0 (Silent), 1 (Basic Stats), 2 (Verbose Tracing). ⭐ Recommended: 0 for standard production runs.
enable_profilingBOOLEANfalsePERFORMANCE PROFILING • Purpose: Enable detailed tensor scan timing. • Note: Automatically enabled if debug_mode is 1 - Info or higher. ⭐ Recommended: False.

Outputs (1)

NameTypeDescription
latentsLATENT