Nodes/Bit Depth Enhancer/ABCD Bit-Depth Enhancement (8→16)
ComfyUI Node

ABCD Bit-Depth Enhancement (8→16)

Adding back tonal steps your 8-bit image never had

By subraoul·Created 10 months ago·Updated 10 months ago· 3
ABCD Bit-Depth Enhancement (8→16)
  • image
  • enhanced_image
modelSwinIR-ABCD

If you've ever pushed an 8-bit sky into a gradient in Photoshop and watched it fall apart into ugly steps, you know the actual problem: your source only has 256 tonal levels per channel, and no amount of grading can invent the ones between. ABCD tries a smarter answer than the usual dithering noise - it trains a neural network to predict what those missing intermediate levels should be, from the image itself. That's the pitch, and it makes this the most interesting node in the pack.

The catch is up front: this is the heavyweight node. It wants a real GPU, a ~130M+ parameter checkpoint you fetch by hand from a Google Drive link, and it can be picky about where that file lives. Just want "less banding, now, on my laptop"? The pack's classical node gets you 90% of the way with zero downloads. Want the genuinely learned reconstruction - the CVPR 2023 ABCD method from WooKyoungHan's repo? This is the node.

How it works

ABCD is a coordinate-based implicit neural representation - scarier than it behaves. The node builds a normalized coordinate grid over your image, extracts features with a CNN backbone, then queries the network at every pixel to predict the residual tonal detail. In the source you can see the reconstruction formula: the prediction is scaled by a basis value - roughly 256 / 65535 - and added back to the input. So it's not hallucinating new content; it's estimating the fractional step between two 8-bit levels and reinserting it. The result is an image with effectively 16-bit precision in the tonal distribution.

Three backbones, chosen via the model dropdown:

  • SwinIR-ABCD (default) - Swin Transformer, highest quality, 151M params, 130 GPU-hours of training. Use it if your card can hold it and you're not in a hurry.
  • RDN-ABCD - residual dense network, 132M params, the balanced middle child.
  • EDSR-ABCD - the fast one, 141M params, 65 training hours. Use it for quick previews before committing to a SwinIR pass.

It processes the batch image by image, caches the loaded model per device, and falls back to CPU if you OOM (slow - bring a book). And like every ComfyUI node, the enhanced_image output is a float32 tensor in [0, 1]; the "16-bit" lives in the precision of those values, which is exactly what the pack's Save 16-bit TIFF node commits to disk.

The inputs that matter

There are only two, which is refreshing:

  • image - your IMAGE tensor. Anything from a Load Image node works.
  • model - the architecture dropdown above. Default is SwinIR-ABCD; start there.

Output is a single enhanced_image (IMAGE). Wire it into Save16BitTIFF if you want the 16-bit precision to survive - any normal Save Image node will round it back to 8-bit and you've wasted the whole point.

Installing it and getting the weights

The node ships in the Bit Depth Enhancer pack. Either grab it via ComfyUI Manager (search "Bit Depth Enhancer") or:

cd ComfyUI/custom_nodes
git clone https://github.com/subraoul/ComfyUI_Bit-Depth-Enhancer.git
cd ComfyUI_Bit-Depth-Enhancer
pip install -e .

Restart ComfyUI after. The pack needs numpy, opencv-python, scipy, tifffile and torch 2.0+, which pip install -e . handles.

Then the annoying part - the weights are not bundled and not auto-downloaded. From the original ABCD repository's Google Drive:

ComfyUI/models/bit_depth_enhancement/abcd/
├── edsr_abcd.pth
├── rdn_abcd.pth
└── swinir_abcd.pth

Rename to match exactly. One gotcha worth knowing from the source: the ABCD node looks for models at ~/ComfyUI/models/bit_depth_enhancement/abcd/ - a hardcoded home-directory path, not ComfyUI's models_dir. Fine on a standard Linux/macOS install, but on a portable Windows install where ComfyUI lives elsewhere it won't find the weights; a symlink (or junction) from ~/ComfyUI/models to your real models folder sorts it out. (The pack's other DL node, deepDeband, uses the proper folder_paths lookup - the inconsistency is the author's, not yours.)

Common issues

  • "Model checkpoint not found" - almost always the hardcoded-path problem above, or a filename mismatch. Check ~/ComfyUI/models/bit_depth_enhancement/abcd/ literally exists.
  • Tons of debug text in the console - the node prints input ranges, feature shapes, and prediction stats on every run. Cosmetic noise; ignore it.
  • Slow / OOM - SwinIR on a big image is heavy. Drop to EDSR-ABCD for iteration, or upscale after enhancement instead of before.
  • Heavily compressed JPEG in, banding out - ABCD reconstructs tonal steps but it can't un-destroy a source that's already posterized. Garbage in, marginally-better garbage out.

The honest summary: ABCD is the pack's showpiece, the one that's actually doing machine learning instead of math. It needs setup, a GPU, and patience, but for skies, skin tones, and anything destined for print or a color-managed pipeline, it's the difference between "less banding" and "the bands were never there."

Categorybitdepth_enhancement

Inputs (2)

NameTypeDefaultDescription
imageIMAGEInput 8-bit image from ComfyUI. Will be enhanced to true 16-bit with learned intermediate tonal values using deep learning.
modelCOMBOSwinIR-ABCDABCD model architecture (all models fully supported with automatic checkpoint remapping): SwinIR-ABCD (Swin Transformer, highest quality, 151M params) | RDN-ABCD (Residual Dense Network, balanced, 132M params) | EDSR-ABCD (Enhanced Deep Residual, fastest, 141M params). All trained on arbitrary bit-depth conversion.

Outputs (1)

NameTypeDescription
enhanced_imageIMAGE