Nodes/MD Nodes/MD: Universal Latent Sanitizer (Audio/Video/Image)
ComfyUI Node

MD: Universal Latent Sanitizer (Audio/Video/Image)

A ComfyUI node in MD_Nodes/Maintenance with 8 inputs and 4 outputs.

By MDMAchine·Created about a year ago·Updated 2 months ago· 14
MD: Universal Latent Sanitizer (Audio/Video/Image)
  • samples
  • vae
  • sanitized_latents
  • patched_vae
  • sample_rate_int
  • log_info
fix_nanstrue
clamp_sigma4.5
vae_sample_rateUnchanged
disable_tilingtrue
debug_mode1 - Info
enable_profilingfalse
CategoryMD_Nodes/Maintenance

Inputs (8)

NameTypeDefaultDescription
samplesLATENTLATENT INPUT • Purpose: The latent chunks from your KSampler. • Requirement: Connect this BEFORE VAE Decode.
vaeVAEVAE INPUT (REQUIRED) • Purpose: The VAE used for decoding. • Requirement: Must be passed through this node to apply rate/tiling fixes.
fix_nansBOOLEANtrueFIX NANS / INFINITIES • Purpose: Replaces broken numerical values with 0.0. • Effect: Prevents 'Black Hole' audio/video and silent outputs. • Trade-offs: None (broken values are useless anyway). ⭐ Recommended: Enabled
clamp_sigmaFLOAT4.51–20HARD CLAMP LIMIT (SIGMA) • Purpose: Limits the maximum loudness/variance of the latent data. • Audio Use: Prevents VAE 'blowout' (digital clipping/crackle). • Video Use: Prevents 'flickering' frames. • Range: 3.0 (Strict) to 6.0 (Loose). ⭐ Recommended: 3.0 to 4.5 if hearing crackle.
vae_sample_rateCOMBOUnchangedFORCE VAE SAMPLE RATE (Audio Only) • Purpose: Patches the VAE metadata to expected Hz to fix 'Drift'. • Effect: Prevents pitch shifting or high-pitched aliasing/whine. • Note: Ignored for Image/Video VAEs. ⭐ Recommended: Unchanged (unless correcting a known issue).
disable_tilingBOOLEANtrueDISABLE VAE TILING • Purpose: Forces the VAE to decode the whole file at once. • Audio: Eliminates 'seam crackle' every few seconds. • Image: Eliminates 'grid lines' in high-res upscales. • Trade-offs: Uses significantly more VRAM when enabled. ⭐ Recommended: Enabled (fixes boundary artifacts).
debug_modeCOMBO1 - InfoLOGGING VERBOSITY • Purpose: Controls console output detail level. • Options: 0 (Production), 1 (Analytics Report), 2 (Full trace). ⭐ Recommended: 1 - Info.
enable_profilingBOOLEANfalsePERFORMANCE PROFILING • Purpose: Enable detailed operation timing. • Note: Automatically enabled when debug_mode >= 1.

Outputs (4)

NameTypeDescription
sanitized_latentsLATENT
patched_vaeVAE
sample_rate_intINT
log_infoSTRING