ComfyUI Node
MD: VRAM Canary (Memory Guardian)
A ComfyUI node in MD_Nodes/Utility with 6 inputs and 2 outputs.
MD: VRAM Canary (Memory Guardian)
- any_input
- passthrough
- vram_stats
◄vram_threshold_gb2.0►
◄auto_cleanuptrue►
◄gpu_device0►
◄verbose_modefalse►
◄emergency_modefalse►
CategoryMD_Nodes/Utility
Inputs (6)
| Name | Type | Default | Description |
|---|---|---|---|
| any_input | * | UNIVERSAL INPUT • Purpose: The data stream to guard. • Support: Accepts any data type (MODEL, IMAGE, LATENT, etc.). • Effect: Passed through unchanged after the VRAM check completes. ⭐ Recommended: Place immediately before heavy nodes (Upscalers, Samplers). | |
| vram_threshold_gb | FLOAT | 2.00.5–48 | VRAM THRESHOLD (GB) • Purpose: Triggers cleanup when free VRAM drops below this number. • Trade-offs: Higher values = more aggressive cleanup. Lower values = risk OOM errors. ⭐ Guidelines: - 8GB GPU: 1.5 - 2.0 GB - 12GB GPU: 2.0 - 3.0 GB - 24GB GPU: 3.0 - 4.0 GB |
| auto_cleanup | BOOLEAN | true | AUTO CLEANUP • Purpose: Automatically trigger memory cleanup when threshold is breached. • Effect: Executes 'soft_empty_cache' (safe, non-destructive). • Trade-offs: Disable only if actively debugging a suspected memory leak. ⭐ Recommended: Enabled for all production workflows. |
| gpu_deviceopt | INT | 00–7 | GPU DEVICE INDEX • Purpose: Selects which GPU to monitor (0 = Primary). • Note: Only relevant for multi-GPU systems. ⭐ Recommended: 0. |
| verbose_modeopt | BOOLEAN | false | VERBOSE MODE • Purpose: Show detailed memory statistics in the console. • Effect: Prints before/after cleanup byte comparisons. ⭐ Recommended: False, unless profiling a heavy workflow. |
| emergency_modeopt | BOOLEAN | false | EMERGENCY MODE • Purpose: Engages aggressive memory cleanup if triggered. • Effect: Unloads all models from VRAM directly to RAM. • Trade-offs: Slower execution (models must reload), but frees maximum memory. ⭐ Recommended: False, use only for massive 4K+ upscaling. |
Outputs (2)
| Name | Type | Description |
|---|---|---|
| passthrough | * | — |
| vram_stats | STRING | — |