Wavelet Layout (2x2)
The Textbook Wavelet Diagram, Minus Any Actual Math
- HH
- HL
- LH
- LL
- signed_image
Every wavelet tutorial you've ever skimmed has the same picture: one image split into a 2x2 grid, the smooth blurry approximation in the top-left, edge detail radiating into the other three quadrants. Wavelet Layout (2x2) is the node that draws that picture, and the tell is in what it doesn't have: no wavelet dropdown, no transform parameters. Because there is no transform happening. This node doesn't do math - it tiles.
If Wavelet Decompose is the engine and Wavelet Reconstruct is the undo button, this is the display: it takes the four LL/LH/HL/HH subbands and arranges them into the classic textbook grid:
LL LH
HL HH
LL (the smoothed approximation) sits top-left, LH top-right, HL bottom-left, HH bottom-right. One node, one output, and you can finally see what a decomposition actually pulled apart - which is half the reason this pack exists. It's from Dr. Nobutaka Kuroki at Kobe University, and the whole pack reads like a lecture series with runnable figures; this is the figure node.
How it works
Pure tiling with a forgiving crop. All four inputs are optional, and an unconnected one is treated as an all-zero subband - which matters more than it sounds: it lets you draw a partial diagram before every band is ready, and it's what makes multi-level pyramids possible. The sample workflows decompose LL again and use this node's own output as a deeper level's LL, building the recursive diagram you see in every textbook.
The forgiving part is the crop. Wavelets with a filter length longer than 2 (like bior4.4) don't split an image into exact halves, so connected subbands can end up with mismatched heights and widths. Where Wavelet Reconstruct treats that as a hard error (it needs matching arrays to invert correctly), Layout quietly center-crops everything down to the smallest common size and tiles anyway. For a diagram that's the right call - display range is what matters, and a couple of cropped pixels you'll never see.
The one rule: at least one of the four inputs must be connected, because that's the only source of batch size, channel count and device. Wire nothing and you get an error.
The inputs and outputs
HH,HL,LH,LL- optionalSIGNED_IMAGEinputs, fed straight from Wavelet Decompose (which outputs them in HH, HL, LH, LL order, so this maps 1:1 with no crossing).- Output
signed_image- a singleSIGNED_IMAGEat 2x the subband size. Feed it toPreview Signed Imagefrom the companion pack, or throughTo Unsigned Imageinto a normalSave Image.
How to install it
ComfyUI Manager, search "comfyui-wavelet-2d", install. Or:
cd ComfyUI/custom_nodes
git clone https://github.com/NobutakaKuroki/comfyui-wavelet-2d
cd comfyui-wavelet-2d
pip install -r requirements.txt
The dependency is one line - PyWavelets - with no model files and no keys. But you must also install the companion pack comfyui-signed-image, which defines the SIGNED_IMAGE type this node speaks and provides the preview/conversion nodes every sample workflow uses. It does not install automatically; this pack will error without it. Restart ComfyUI after both.
Common issues
- The output looks washed out or wrong - it's a
SIGNED_IMAGE(zero-centered, can be negative). A plainPreview Imageexpects 0..1 and will mis-render it. UsePreview Signed Image, or convert withTo Unsigned Imagefirst. - Missing
SIGNED_IMAGEtype / can't connect - the signed-image companion pack isn't installed. This is the pack-wide gotcha; check it before anything else. - You expect the original image back and get a 2x diagram instead - that's the point of this node. For the round-trip, use Wavelet Reconstruct; Layout is for looking, not restoring.
Inputs (4)
| Name | Type | Default | Description |
|---|---|---|---|
| HHopt | SIGNED_IMAGE | — | |
| HLopt | SIGNED_IMAGE | — | |
| LHopt | SIGNED_IMAGE | — | |
| LLopt | SIGNED_IMAGE | — |
Outputs (1)
| Name | Type | Description |
|---|---|---|
| signed_image | SIGNED_IMAGE | — |