Nodes/Reference-Based Video Colorization/Deep Exemplar Image Colorization (Original)
ComfyUI Node

Deep Exemplar Image Colorization (Original)

Deep Exemplar for Still Images

By jonstreeter·Created 10 months ago·Updated 9 months ago· 25
Deep Exemplar Image Colorization (Original)
  • image_to_colorize
  • reference_image
  • colorized_image
  • performance_report
target_width768
target_height432
use_torch_compilefalse
use_sage_attentionfalse

DeepExColorImageNode is the quiet one in the Reference-Based Video Colorization pack: the single-image version of the Deep Exemplar method, and the least-downloaded node of the four. Don't read the impression count as a quality signal. This is the simplest, most predictable colorizer in the pack - a 2019 CVPR pipeline that has been doing reference-based photo colorization for years, and it still holds up on a single still.

The mechanism is the same exemplar engine the video version uses, minus the temporal parts. A VGG19 network extracts multi-scale features from your grayscale image and your color reference, a non-local attention module finds "this gray patch corresponds to that colored patch," and the color gets transferred - then a WLS (weighted least squares) filter smooths away the patchy artifacts that plague naive exemplar methods. For one image you don't need frame_propagate or half-resolution processing, so they're simply not there.

The inputs

  • image_to_colorize - your grayscale (or recolor-me) image.
  • reference_image - the color palette source. Same rule as every node in this pack: choose semantically similar, mood-matching references. A war-era portrait wants a reference with matching skin tones and film-era color, not a neon modern shot.
  • target_width / target_height - output size, rounded up to a multiple of 32 because VGG19 demands it. The 768x432 default is conservative; single images are cheap enough that you can go bigger without worry.
  • use_torch_compile - the one optimization that genuinely helps on this pack's Deep Exemplar nodes. It compiles the VGG, non-local, and color networks; expect a 30-60 second warmup on first use, then a real 10-25% speedup.
  • use_sage_attention - a bigger speedup on the non-local attention if you have sageattention installed (pip install sageattention). It falls back gracefully to standard attention if the package isn't there, so toggling it is harmless either way.

Outputs: colorized_image (IMAGE) and performance_report (STRING) - timing text that's mostly irrelevant for a single frame.

Install and context

Same pack, so same install:

cd ComfyUI/custom_nodes/
git clone https://github.com/jonstreeter/ComfyUI-Reference-Based-Video-Colorization.git
cd ComfyUI-Reference-Based-Video-Colorization/
pip install -r requirements.txt

Deep Exemplar weights (VGG19 plus the color and non-local networks) download automatically on first use. The model comes from the original project's release and carries its original license, not the pack's MIT wrapper.

Where this node fits: people tend to reach for Deep Exemplar not as a standalone "colorize my photo" button but as the recolor engine inside a bigger restoration workflow - reimagine the image in color with a diffusion model, then let Deep Exemplar transfer that palette back onto the original grayscale so you keep the genuine structure instead of the diffusion model's reconstruction. It's the less glamorous node in the pack, but it's also the one that gives you a predictable, artifact-light result on the first try, with zero VRAM drama. If you just want a photo colored reliably, that's worth a lot more than another new-model buzzword.

CategoryDeepExemplar/Image

Inputs (6)

NameTypeDefaultDescription
image_to_colorizeIMAGEGrayscale or color image to be colorized
reference_imageIMAGEColor reference image that provides the color palette
target_widthINT76816–4096Output width (will be adjusted to nearest multiple of 32)
target_heightINT43216–4096Output height (will be adjusted to nearest multiple of 32)
use_torch_compileBOOLEANfalseEnable torch.compile optimization for 10-25% speedup (may increase first-run compilation time)
use_sage_attentionBOOLEANfalseEnable SageAttention for faster attention computation (requires sageattention package)

Outputs (2)

NameTypeDescription
colorized_imageIMAGE
performance_reportSTRING