山竹VAE深度解码器
The other 'depth' node — a VAE decode with a whisper of optional noise
- samples
- vae
- decoded_image
Same naming caveat as its encode sibling: ShanzhuDepthVAEDecoder is not a depth decoder. It's a VAE decoder with one extra dial. You feed it a LATENT (samples) and a vae, and it runs the standard vae.decode, forces the result to float32, and - if you want - adds a tiny amount of gaussian noise to the decoded pixels before clamping back to 0–1. The output is decoded_image, a plain IMAGE you can wire into anything downstream.
The dial is noise_strength, an optional FLOAT from 0.000 to 0.1 with a default of 0.001. The author's own docstring calls this a "depth-enhancement" decoder, and the range is deliberately tiny: even at the maximum of 0.1 the noise is mild, and at the default it's barely perceptible - more of a film-grain whisper than a visible effect. Think of it as a de-banding or dithering nudge for flat gradient areas, not a creative tool. If you want a plain decode, just leave it at default; the difference between 0.000 and 0.001 is basically invisible.
The theory behind it: banding shows up as quantized steps in smooth gradients (skies, walls, soft lighting), and a little per-pixel noise breaks those steps up. It's the same philosophy as the pack's ShanzhuVAEDecodeSmooth and its 16-bit TIFF savers, just applied as a pixel-space nudge instead of a bit-depth change. In practice, if banding is your actual problem, the 16-bit TIFF route does more; the noise dial is a nice-to-have.
One grounding note from the troubleshooting canon: if your decoded output looks gray and washed, this dial won't fix it - that's a wrong or missing VAE, and you need the VAE that matches your checkpoint. This node uses whatever VAE you wire in, so it inherits that rule exactly. On the plus side, the implementation clamps after adding noise, so you won't get black/white blowout from the additive noise - the pixel range stays 0–1.
Install is the shared pack story: ComfyUI Manager search "ComfyUI_SZtools", or git clone https://github.com/Rocky-Lee-001/ComfyUI_SZtools into custom_nodes/, restart. The extra deps (imageio, tifffile) only matter for the pack's TIFF savers; this node needs nothing beyond what ComfyUI ships. It's a modest drop-in replacement for the core VAEDecode if you want the optional dither, and nothing more - which is a fine way to use it.
Inputs (3)
| Name | Type | Default | Description |
|---|---|---|---|
| samples | LATENT | 待解码的潜在空间张量 | |
| vae | VAE | VAE解码模型 | |
| noise_strengthopt | FLOAT | 0.0010–0.1 | 噪声强度 (0.000-0.1) |
Outputs (1)
| Name | Type | Description |
|---|---|---|
| decoded_image | IMAGE | — |