Save 4 hours! We auto-setup your workflow! Free!

Drop your workflow.json — we handle every dependency, custom node, and model. Just open the link and run.

Auto-Setup Workflow Json (Free) Now!
ComfyUI > Nodes > ComfyUI-CustomNodePacks > VAE Latent Inspector (C2C)

ComfyUI Node: VAE Latent Inspector (C2C)

Class Name

VAELatentInspectorMEC

Category
C2C/Diagnostics
Author
Code2Collapse (Account age: 1184days)
Extension
ComfyUI-CustomNodePacks
Latest Updated
2026-07-29
Github Stars
0.05K

How to Install ComfyUI-CustomNodePacks

Install this extension via the ComfyUI Manager by searching for ComfyUI-CustomNodePacks
  • 1. Click the Manager button in the main menu
  • 2. Select Custom Nodes Manager button
  • 3. Enter ComfyUI-CustomNodePacks in the search bar
After installation, click the Restart button to restart ComfyUI. Then, manually refresh your browser to clear the cache and access the updated list of nodes.

Visit ComfyUI Online for ready-to-use ComfyUI environment

  • Free trial available
  • 16GB VRAM to 80GB VRAM GPU machines
  • 400+ preloaded models/nodes
  • Freedom to upload custom models/nodes
  • 200+ ready-to-run workflows
  • 100% private workspace with up to 200GB storage
  • Dedicated Support

Run ComfyUI Online

VAE Latent Inspector (C2C) Description

Diagnostic tool for VAE latent tensor analysis, identifying anomalies and providing detailed statistics for health assessment.

VAE Latent Inspector (C2C):

The VAELatentInspectorMEC is a diagnostic tool designed to inspect latent tensors within Variational Autoencoders (VAEs) for sanity and statistical analysis. This node is particularly useful for identifying potential issues in the latent space, such as anomalies that could arise from VAE merge regressions, broken preprocessing, or blown-out/quantized latents before executing computationally expensive sampling processes. By analyzing the latent tensor, the VAELatentInspectorMEC provides detailed statistics including minimum, maximum, mean, standard deviation, and absolute mean per channel. It also counts occurrences of NaN (Not a Number) and Inf (Infinity) values, evaluates the dynamic range, and delivers an actionable verdict on the tensor's health. The verdict can indicate whether the tensor is "healthy," "low_contrast," "saturated," or "corrupt," helping you to quickly diagnose and address any issues in the latent space.

VAE Latent Inspector (C2C) Input Parameters:

latent

The latent parameter is the primary input for the VAELatentInspectorMEC node, representing the latent tensor that you wish to inspect. This tensor should be a four-dimensional float tensor with dimensions [B, C, H, W], where B is the batch size, C is the number of channels, H is the height, and W is the width. The latent tensor is analyzed to provide statistical insights and a health verdict. There are no specific minimum, maximum, or default values for this parameter, as it depends on the specific VAE model and data being used.

fail_on_corrupt

The fail_on_corrupt parameter is a boolean flag that determines the node's behavior when encountering a corrupt latent tensor. If set to True, the node will raise an error and halt execution if the latent tensor is found to be corrupt, containing NaN or Inf values. This can be useful for ensuring data integrity and preventing further processing of invalid data. The default value for this parameter is False, allowing the node to continue execution and return the verdict even if the tensor is corrupt.

VAE Latent Inspector (C2C) Output Parameters:

latent

The latent output parameter returns the original latent tensor that was inspected. This allows you to pass the tensor to subsequent nodes or processes without modification, ensuring that the inspection process is non-destructive.

info

The info output parameter provides a JSON-formatted string containing detailed statistical information about the latent tensor. This includes per-channel statistics such as minimum, maximum, mean, standard deviation, and absolute mean, as well as counts of NaN and Inf values. This information can be used for further analysis or debugging purposes.

verdict

The verdict output parameter is a string that provides an actionable assessment of the latent tensor's health. Possible verdicts include "healthy," "low_contrast," "saturated," and "corrupt," each indicating a different type of issue or confirmation of the tensor's integrity. This verdict helps you quickly understand the state of the latent tensor and decide on any necessary corrective actions.

nan_count

The nan_count output parameter is an integer representing the number of NaN (Not a Number) values found in the latent tensor. A high count may indicate data corruption or issues in the preprocessing pipeline.

inf_count

The inf_count output parameter is an integer representing the number of Inf (Infinity) values found in the latent tensor. Similar to nan_count, a high count of Inf values can signal potential problems in the data or model.

VAE Latent Inspector (C2C) Usage Tips:

  • Use the fail_on_corrupt parameter set to True during development to catch and address issues with corrupt latent tensors early in the process.
  • Regularly inspect latent tensors using this node to monitor the health of your VAE models, especially after significant changes or merges.
  • Analyze the info output to gain insights into the distribution and characteristics of your latent space, which can inform model tuning and data preprocessing strategies.

VAE Latent Inspector (C2C) Common Errors and Solutions:

LATENT contains NaN=<nan_count>, Inf=<inf_count>; refusing to pass through.

  • Explanation: This error occurs when the fail_on_corrupt parameter is set to True and the latent tensor contains NaN or Inf values, indicating data corruption.
  • Solution: Investigate the source of the NaN or Inf values in your data preprocessing or model pipeline. Ensure that all inputs to the VAE are properly normalized and free of invalid values. Consider setting fail_on_corrupt to False if you wish to bypass this check temporarily, but address the underlying issue to maintain data integrity.

VAE Latent Inspector (C2C) Related Nodes

Go back to the extension to check out more related nodes.
ComfyUI-CustomNodePacks
RunComfy
Copyright 2025 RunComfy. All Rights Reserved.

RunComfy is the premier ComfyUI platform, offering ComfyUI online environment and services, along with ComfyUI workflows featuring stunning visuals. RunComfy also provides AI Models, enabling artists to harness the latest AI tools to create incredible art.

VAE Latent Inspector (C2C)