Comfy-Org/ComfyUI · error · RuntimeError

SeedVR2PostProcessing: color correction OOM at one frame; co

Error message

SeedVR2PostProcessing: color correction OOM at one frame; color_correction_method={color_correction_method}, shape={tuple(decoded_flat.shape)}.

What it means

_color_transfer_chunked sizes its chunk by free VRAM and halves it on OOM (via raise_non_oom re-raising non-OOM errors). If the transfer still OOMs with chunk_size == 1, no further reduction is possible and this RuntimeError is raised, naming the method and tensor shape for diagnosis.

Source

Thrown at comfy_extras/nodes_seedvr.py:290

                    dtype=output.dtype,
                )
            result[start:start + 1].copy_(output)
        if result is None:
            raise ValueError("SeedVR2PostProcessing: LAB color correction requires at least one frame.")
        return result

    @classmethod
    def _color_transfer_chunked(cls, decoded_flat, reference_flat, output_device, color_correction_method):
        chunk_size = cls._estimate_color_correction_chunk_size(decoded_flat, color_correction_method)
        while True:
            try:
                return cls._run_color_transfer_chunks(
                    decoded_flat, reference_flat, output_device, color_correction_method, chunk_size,
                )
            except Exception as e:
                comfy.model_management.raise_non_oom(e)
                if chunk_size <= 1:
                    raise RuntimeError(
                        "SeedVR2PostProcessing: color correction OOM at one frame; "
                        f"color_correction_method={color_correction_method}, shape={tuple(decoded_flat.shape)}."
                    ) from e
                chunk_size = max(1, chunk_size // SEEDVR2_OOM_BACKOFF_DIVISOR)

    @classmethod
    def _run_color_transfer_chunks(cls, decoded_flat, reference_flat, output_device, color_correction_method, chunk_size):
        result = None
        for start in range(0, decoded_flat.shape[0], chunk_size):
            end = min(start + chunk_size, decoded_flat.shape[0])
            decoded_chunk = decoded_flat[start:end]
            reference_chunk = reference_flat[start:end]
            if color_correction_method == "lab":
                output = cls._lab_color_transfer_on_vae_device(decoded_chunk, reference_chunk, output_device)
            elif color_correction_method == "wavelet":
                output = cls._color_transfer_on_vae_device(
                    decoded_chunk, reference_chunk, output_device, wavelet_color_transfer,
                )

View on GitHub (pinned to 1c6d8d45b3)

Solutions

  1. Free VRAM: restart the run, close other GPU processes, or set color_correction_method='none' to skip the transfer entirely.
  2. Reduce frame resolution or process the video in shorter temporal chunks so fewer/smaller frames are resident.
  3. Move other stages (VAE decode of unrelated tensors) off the GPU first, or run color correction on CPU by unloading the model between stages.
  4. If it recurs, report the shape/method from the message to help tune SEEDVR2_COLOR_MEM_HEADROOM.

Example fix

# before
{"color_correction_method": "lab"}  # OOM at one frame on 4K video

# after
{"color_correction_method": "none"}  # or chunk the video before postprocessing
Defensive patterns

Strategy: fallback

Validate before calling

free = comfy.model_management.get_free_memory('cuda') if torch.cuda.is_available() else None
# rough guard: a frame's lab transfer needs several full-size buffers
need = h * w * 3 * 4 * 8
if free is not None and free < need:
    # unload models or choose 'none' before running

Try / catch

try:
    out = node.execute(...)
except RuntimeError as e:
    if 'OOM at one frame' in str(e):
        out = node_with_method_none.execute(...)  # degrade gracefully
    else:
        raise

Prevention

When it happens

Trigger: Color correction (lab/wavelet/adain) on a very large frame while VRAM is nearly exhausted: even one frame's transfer (which allocates several intermediate buffers per the method's memory multiplier) cannot fit in the free memory on the VAE device.

Common situations: Long-video workflows where the decoded frames already occupy most of VRAM; small-GPU machines (e.g. 6-8 GB) with 4K frames; another process (browser, second Comfy run) consuming VRAM; fragmentation after a long session.

Related errors


AI-assisted analysis of Comfy-Org/ComfyUI@1c6d8d45b3 (2026-08-14). Data as JSON: /api/errors/4b7ef75c38decb33. Report an issue: GitHub.