Nodes/ComfyUI_deepDeband/deepDeband Inference
ComfyUI Node

deepDeband Inference

Debanding with deepDeband

By Anze-·Created 2 years ago·Updated 2 years ago· 4
deepDeband Inference
  • img_batch
  • debanded_image

You know the artifact: a smooth gradient - sky, a lit wall, a dark studio backdrop - breaks into visible concentric stripes. That's banding, a.k.a. false contouring, and it's the calling card of low-bitrate video encodes and 8-bit pipelines. DeepDeband Inference runs a trained neural network on your frames to scrub those stripes out, and right now it's the best-known model-based debanding option inside ComfyUI.

It comes from a research model, not a ComfyUI celebrity. deepDeband is a CycleGAN-style network from an ICIP 2022 paper ("Deep Image Debanding") trained on 51,490 pairs of banded and pristine image patches. Anze- wrapped the original repo as a single node and called it a day. It's an experimental, one-person pack - the README literally warns you to expect bugs and to not trust it in production. There's exactly one node, with one input and one output. Zero impressions on comfy.icu says basically nobody has tried it yet.

What it actually does

The post-processing layer is almost all deterministic pixel math - gamma curves, blur, grain - as our post-processing notes hammer home. deepDeband is the rare exception: it's a learned filter, a UNet-256 generator that has seen tens of thousands of real banded/gradient pairs and learned what a clean gradient should look like. That's both its strength and its cost. It's genuinely better than a dithering pass on hard banding, and genuinely slower than anything deterministic.

The mechanism is honest old-school. The node saves every frame as a PNG to a temp folder on disk, then spawns a separate Python process (python deepDeband_batch.py) that pads each image to a multiple of 256 with mirrored edges, runs the CycleGAN test.py script, crops the result back, and reads the output PNGs into a tensor. Disk round-trip, subprocess overhead, sequential per-batch inference - all on top of the model. The author only partially fixed the original implementation's disk-piping inefficiencies. Translation: this is not a real-time node. Feed it a few frames, go make tea.

The input and output (all of them)

The whole schema, no hidden knobs:

  • img_batch (IMAGE, required) - "Provide an image to be debanded." Feed a single image, or a batch of frames from a video decode.
  • debanded_image (IMAGE, output) - wire into a Save Image or a video-combine node.

That's it. No strength slider, no denoise amount, no per-channel controls. You get what the model gives you.

Installing it

Two installs, and the second one is the trap. First, the node itself - via ComfyUI Manager (search "ComfyUI_deepDeband") or:

cd ComfyUI/custom_nodes
git clone https://github.com/Anze-/ComfyUI_deepDeband

Then restart ComfyUI and install the pack's Python dependencies, because "at the moment some dependencies are not automatically installed":

pip install -r custom_nodes/ComfyUI_deepDeband/requirements.txt

That pulls torch, torchvision, dominate, and visdom. But here's where people get burned: the model weights are not in the repo. The upstream deepDeband repo blew through its GitHub LFS bandwidth quota, so the .pth files in your clone are just 133-byte LFS pointers, not 217 MB weights. git lfs pull will not save you. Download the checkpoints manually from the Zenodo archive (10.5281/zenodo.7523437), extract, and drop the deepDeband-f folder so you end up with:

ComfyUI/custom_nodes/ComfyUI_deepDeband/deepDeband/pytorch-CycleGAN-and-pix2pix/checkpoints/deepDeband-f/

...containing latest_net_G.pth and latest_net_D.pth. (The README's path has a typo - it says "ComfyUP_deepDeband"; the real folder is ComfyUI_deepDeband.) Total footprint with weights is roughly 300 MB. Skip this step and the node fails fast with an assert error telling you exactly this.

Gotchas worth knowing

  • The folder name is load-bearing. The node hardcodes paths against custom_nodes/ComfyUI_deepDeband/... relative to ComfyUI's working directory, so rename the folder and everything breaks.
  • It shells out to bare python, not your ComfyUI environment's interpreter. If you run from a venv or conda env where python isn't that env, the subprocess can fail or use a different torch. Worth knowing before you chase phantom import errors.
  • Scope is limited. The model was trained for light debanding - gentle stripe removal, not rescuing a crushed 4:2:0 encode. The author's own note: it works best on video encodings, and GIF debanding "isn't outstanding." If you have truly aggressive banding, temper expectations.
  • It's slow. Disk I/O plus a full subprocess per batch. Fine for a handful of frames; miserable as a per-frame video loop.

For heavy lifting the classic alternative is a VapourSynth-style debander like neo_f3kdb (the author points at it), but that's outside ComfyUI. If you want a trained debander in the graph without leaving the UI, this is the one - warts, subprocesses, and all.

Categorydebanding

Inputs (1)

NameTypeDefaultDescription
img_batchIMAGEProvide an image to be debanded

Outputs (1)

NameTypeDescription
debanded_imageIMAGE