h4 : Debug-a-Tron-3000 (v2.1.0)
A tap node that actually tells you what's in the wires
- model_in
- clip_in
- clip_vision_in
- vae_in
- conditioning_in
- conditioning_positive_in
- conditioning_negative_in
- latent_in
- image_in
- mask_in
- Model
- CLIP
- CLIP_Vision
- VAE
- Conditioning
- Positive
- Negative
- Latent
- Image
- Mask
Every ComfyUI user eventually hits the same wall: the graph ran, nothing errored, and the image is wrong, but you have no idea what your conditioning or latent actually looked like mid-pipeline. There are reroute nodes, there are primitive viewers, and then there's the Debug-a-Tron 3000 - a node whose whole personality is "let me look at that wire for you." It sits inline in your graph, mirrors every payload type it can accept, and writes a structured log to the console describing what came through: tensor shapes, dtype, device, min/max/mean/std, and conditioning previews.
It's part of the h4 ToolKit, a small pack with zero search impressions that the author has openly shelved in favor of a successor. Don't let that scare you off - the debug tools are the pack's best-written code, and the README documents them to an almost unreasonable depth. You're an early adopter; file a GitHub issue if something bites.
Monitor vs passthrough
The one required widget is mode, and it's the first thing to understand:
monitor- logs everything but outputsNoneon every slot. Perfect for tapping into a pipeline without disturbing it.passthrough- clones each inbound payload (type-aware deep copies, so upstream data never gets mutated) and forwards it downstream while logging.
Start in monitor to validate a graph, then flip to passthrough once you want the debugger living in the live path.
The slots
Everything is optional and typed: model_in, clip_in, clip_vision_in, vae_in, generic conditioning_in plus separated conditioning_positive_in/conditioning_negative_in, latent_in, image_in, mask_in. Leave a slot unconnected and it stays quiet - no noise. If you don't wire a VAE, the node tries to harvest one from the connected model, which is a nice touch when you just want a preview.
The ten outputs mirror the inputs - Model, CLIP, CLIP_Vision, VAE, Conditioning, Positive, Negative, Latent, Image, Mask - so the node is genuinely inline, not a dead-end probe.
GO PLUS ULTRA?!
The personality comes out when you flip go_ultra. The UI literally renames it " GO PLUS ULTRA?! " and physically removes the advanced widgets until you enable it. That toggle gates:
- Latent snapshots (
ultra_capture_first_step,_mid_step,_last_step) plus optional preview image decode when a VAE is present (ultra_preview_images). - Anomaly checks (
ultra_latent_anomaly_checks) - scans for NaN/Inf and suspicious variance spikes. This is the one that catches a broken run before you stare at the output for ten minutes. - Conditioning gap warnings (
ultra_highlight_missing_conditioning) - flags branches that are absent, the silent killer of CFG. - Model fingerprinting (
ultra_model_diff_tracking) - hashes model/LoRA signatures so you can prove which weights were active. - A watch expression (
ultra_watch_expression) - evaluate a Python expression against the payloads withtorchandnpavailable, e.g.torch.sqrt(latent_in['samples'].var()). It runs in a restricted sandbox with builtins blocked, so keep it boring.
Artifacts (JSON logs, previews) land under ComfyUI/temp/h4_debugatron_ultra/; ultra_cache_artifacts decides whether they survive or get treated as disposable diagnostics.
Install
Manager → search "h4 ToolKit", or:
cd ComfyUI/custom_nodes
git clone https://github.com/m3rr/h4_ToolKit
Restart. Deps are colorama and numpy, auto-installed on startup; no models to download.
Troubleshooting
- Previews missing - you need a VAE reachable, either wired or harvestable from the model. If artifact caching is off, expect previews to be ephemeral.
- Watch expression errors - the sandbox blocks
__builtins__; the exception gets echoed to the console. - Warning noise about conditioning - that's the feature doing its job; check upstream wiring rather than silencing it.
Inputs (23)
| Name | Type | Default | Description |
|---|---|---|---|
| mode | COMBO | passthrough | 2 options: monitor, passthrough |
| model_inopt | MODEL | Connect any diffusion model blob to inspect or forward downstream. | |
| clip_inopt | CLIP | Attach a CLIP text encoder payload for logging and pass-through. | |
| clip_vision_inopt | CLIP_VISION | Optional CLIP vision encoder payload. | |
| vae_inopt | VAE | Supply a VAE instance for inspection or passthrough. | |
| conditioning_inopt | CONDITIONING | Generic conditioning list or bundle. | |
| conditioning_positive_inopt | CONDITIONING | Positive conditioning branch when separated upstream. | |
| conditioning_negative_inopt | CONDITIONING | Negative conditioning branch when separated upstream. | |
| latent_inopt | LATENT | Latent dictionary (samples / noise etc.). | |
| image_inopt | IMAGE | Images or batches headed into the debugger. | |
| mask_inopt | MASK | Mask tensor payloads to monitor or route. | |
| go_ultraopt | BOOLEAN | false | Flip the switch marked GO PLUS ULTRA?! to open deep-dive logging, previews, and artefact capture. |
| ultra_capture_first_stepopt | BOOLEAN | true | Capture analytics for the earliest latent frame observed (or current latent when history is unavailable). |
| ultra_capture_mid_stepopt | BOOLEAN | false | When latent history is provided, also analyse the midpoint frame for drift checks. |
| ultra_capture_last_stepopt | BOOLEAN | true | Capture analytics for the most recent latent frame to spot end-of-run anomalies. |
| ultra_preview_imagesopt | BOOLEAN | true | Attempt to decode the analysed latent into a quick preview image when a VAE is connected. |
| ultra_json_logopt | BOOLEAN | true | Serialise the captured diagnostics to a JSON file under ComfyUI's temp directory for later comparison. |
| ultra_highlight_missing_conditioningopt | BOOLEAN | true | Warn when positive/negative or auxiliary conditioning branches are absent to prevent silent misconfigurations. |
| ultra_token_previewopt | BOOLEAN | false | Attempt to echo prompt fragments and key embedding stats for the first few conditioning entries. |
| ultra_latent_anomaly_checksopt | BOOLEAN | true | Scan tensors for NaN/Inf values and suspicious variance spikes to surface stability issues early. |
| ultra_model_diff_trackingopt | BOOLEAN | false | Hash model and LoRA parameter signatures so you can verify which weights were active this run. |
| ultra_watch_expressionopt | STRING | Evaluate a Python expression against the inbound payloads (available globals: torch, np, slot names). Leave blank to disable. | |
| ultra_cache_artifactsopt | BOOLEAN | true | Keep generated preview images and JSON logs on disk instead of treating them as temporary diagnostics. |
Outputs (10)
| Name | Type | Description |
|---|---|---|
| Model | MODEL | — |
| CLIP | CLIP | — |
| CLIP_Vision | CLIP_VISION | — |
| VAE | VAE | — |
| Conditioning | CONDITIONING | — |
| Positive | CONDITIONING | — |
| Negative | CONDITIONING | — |
| Latent | LATENT | — |
| Image | IMAGE | — |
| Mask | MASK | — |