OpenCV pyrDown_1
PyrDown_1 — build a real image pyramid without leaving your graph
- src
- dst
- nparray
pyrDown_1 is the twin of pyrDown_0 - same cv2.pyrDown, same blur-then-half-size Gaussian pyramid downsampling, generated twice because OpenCV's stubs list two overloads. There's no behavioral difference to hunt for. So rather than re-litigate what it does, let's talk about how to actually use a pyramid in ComfyUI, because that's where most people's eyes glaze over and where the real value is.
What a pyramid is for
One pyrDown gives you a half-size image. Chain a few and you get a pyramid: full res → half → quarter → eighth. That stack is the workhorse of a bunch of classic algorithms:
- Multiscale matching/alignment. Match at the smallest level first (fewer pixels, less ambiguity, cheap), then refine your way up the pyramid. It's the standard coarse-to-fine trick, and it's dramatically faster and more robust than matching at full res.
- Pyramid blending. Blur-and-blend two images at every scale, then add the levels back together - that's how you get a composite with no visible seam. If you've ever seen a "laplacian pyramid blend" tutorial,
pyrDown(with itspyrUpcounterpart) is the machinery. - Progressive detail analysis. Compare features across scales to tell "fine detail" from "texture" - genuinely useful if you're doing masking or detail-preservation work and want to know what's real at each resolution.
In each case the discipline matters: because every stage is exactly half the previous one and uses OpenCV's canonical 5×5 Gaussian, the pyramid is consistent - each level is precisely what the textbook expects, not an approximation from a general resize node.
The input to get right
The one that bites: dstsize is a STRING field holding a Python literal. Enter (0, 0) and OpenCV computes the correct half-size automatically. That's the safe move, and for 99% of pyramid work it's the right move - hand-specifying a size that doesn't satisfy the pyramid constraints (width ≤ src.width/2 + 1, etc.) throws an assertion with no friendly explanation. Also required: src (NPARRAY) and borderType (INT) - use 4 (BORDER_REFLECT_101, OpenCV's default) or 1 (BORDER_REPLICATE). The optional dst is an out-parameter; leave it unconnected.
And a practical reminder from the pack's README: Image2Nparray only handles batch_size==1. If you're building a pyramid over a batch of frames and get the batch error, insert an ImageFromBatch with length 1.
Install
Standard pack install, nothing special:
cd ComfyUI/custom_nodes
git clone https://github.com/geroldmeisinger/opencv-comfyui
restart, then pip install opencv-contrib-python - or search "opencv-comfyui" in ComfyUI Manager.
The verdict
If your only goal is "make it smaller," ComfyUI's standard resize is simpler and gives you more control. pyrDown_1 earns its place the moment you're doing multiscale or pyramid-blend work, where exact half-steps and the canonical kernel are the whole ballgame. The pack's author - who released opencv-comfyui on r/comfyui in April 2025 with an "expect dragons" warning - would probably agree this is one of the pack's more respectable nodes: it's a textbook function, faithfully wrapped, and the only dragon is a literal (0, 0) you type into a text box.
Inputs (4)
| Name | Type | Default | Description |
|---|---|---|---|
| src | NPARRAY | — | |
| dstsize | STRING | — | |
| borderType | INT | — | |
| dstopt | NPARRAY | — |
Outputs (1)
| Name | Type | Description |
|---|---|---|
| nparray | NPARRAY | — |