Nodes/opencv-comfyui/OpenCV pyrUp_1
ComfyUI Node

OpenCV pyrUp_1

An identical twin that needs no intro

By geroldmeisinger·Created about a year ago·Updated about a year ago· 35
OpenCV pyrUp_1
  • src
  • dst
  • nparray
dstsize
borderType

pyrUp_1 is the same node as pyrUp_0. Same function call, same inputs, same 2× upsampled output. OpenCV's Python stubs list two overloads of pyrUp; this pack generates one node per overload, and in this case the two came out identical. So if you already read the pyrUp_0 page, you've read this one. Drag either into your workflow and nothing changes.

For anyone landing here directly: this is OpenCV's pyramid upsampler. It doubles both dimensions by interpolating each output pixel from a 5×5 neighborhood of the input. Smooth, fast, free - but it's interpolation, not super-resolution. Use it to enlarge a small image before a controlnet preprocessor or a compositing step, or to match branch resolutions before you merge them. It's the wrong tool if your actual goal is "add detail" - that needs a real upscale model (ESRGAN-style), which costs VRAM and time but actually invents the texture you want.

What to set

  • src - NPARRAY, BGR after Image2Nparray.
  • dstsize - a string literal parsed by ast.literal_eval. (0, 0) = default = exactly 2×. That's what you want.
  • borderType - int, use 4 (BORDER_DEFAULT). OpenCV only really accepts the default for this operation; other values can trigger a runtime assertion.
  • dst - optional out-parameter, leave unplugged (the README's standing advice).

Output is a single nparray, 2× the size, BGR, so it goes through Nparrays2Image back to a Comfy IMAGE. Remember batch_size==1 only.

Install

No models, no downloads. The pack is auto-generated wrappers around OpenCV:

cd ComfyUI/custom_nodes
git clone https://github.com/geroldmeisinger/opencv-comfyui
pip install opencv-contrib-python

Or search "OpenCV" in ComfyUI Manager and restart - you'll find it under image/OpenCV. The one install headache worth knowing: a Cannot import name 'guidedFilter' from 'cv2.ximgproc' error at load means your OpenCV installs are fighting each other; the README links the fix.

There's a subtle point hidden in the duplicate: this pack is auto-generated from OpenCV's type stubs, so dozens of its nodes come in numbered twins that are sometimes identical (pyrUp_0/_1) and sometimes subtly different overloads (look at recoverPose). Always glance at the inputs before assuming twins are the same - here they are, so pyrUp_0 and pyrUp_1 are interchangeable. Take either.

Categoryimage/OpenCV

Inputs (4)

NameTypeDefaultDescription
srcNPARRAY
dstsizeSTRING
borderTypeINT
dstoptNPARRAY

Outputs (1)

NameTypeDescription
nparrayNPARRAY