ComfyUI Node
MD: Universal Latent Sanitizer (Audio/Video/Image)
A ComfyUI node in MD_Nodes/Maintenance with 8 inputs and 4 outputs.
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)
| Name | Type | Default | Description |
|---|---|---|---|
| samples | LATENT | LATENT INPUT • Purpose: The latent chunks from your KSampler. • Requirement: Connect this BEFORE VAE Decode. | |
| vae | VAE | VAE INPUT (REQUIRED) • Purpose: The VAE used for decoding. • Requirement: Must be passed through this node to apply rate/tiling fixes. | |
| fix_nans | BOOLEAN | true | FIX 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_sigma | FLOAT | 4.51–20 | HARD 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_rate | COMBO | Unchanged | FORCE 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_tiling | BOOLEAN | true | DISABLE 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_mode | COMBO | 1 - Info | LOGGING VERBOSITY • Purpose: Controls console output detail level. • Options: 0 (Production), 1 (Analytics Report), 2 (Full trace). ⭐ Recommended: 1 - Info. |
| enable_profiling | BOOLEAN | false | PERFORMANCE PROFILING • Purpose: Enable detailed operation timing. • Note: Automatically enabled when debug_mode >= 1. |
Outputs (4)
| Name | Type | Description |
|---|---|---|
| sanitized_latents | LATENT | — |
| patched_vae | VAE | — |
| sample_rate_int | INT | — |
| log_info | STRING | — |