DeepStereo: Image Resize and Transform
Getting your depth map and texture to the same size is half the Magic Eye battle
- image
- upscale_model
- processed_image
- width
- height
Stereograms are picky about sizes in a way normal image pipelines aren't. The output image comes out at whatever dimensions the depth map has, the texture gets tiled across it, and a texture that's way bigger or smaller than the separation value quietly sabotages fusion. This node is the pack's answer to "make everything the right size," plus a bonus rotate/flip and an optional model-based upscale.
How it works
One required image input and an operation enum that picks what you're doing:
resize_only- the everyday one. You can target size three ways:target_megapixels(0 = use width/height instead), ortarget_width/target_height(0 = auto from the other dimension or from megapixels).maintain_aspect(default on) stops you from accidentally squashing, andresample_methoddefaults toLANCZOSwithBICUBIC/BILINEAR/NEARESTas fallbacks.resize_with_upscaler- the same resize, but it takes anupscale_model(wire in from the core Load Upscale Model node) and anupscale_factor(1–8). Real model-based upscaling, not just interpolation.rotate-rotation_degrees(0–359, default 90).flip_horizontal/flip_vertical- one-click mirrors.
Three outputs: processed_image, plus width and height as integers. Those last two are quietly useful - you can feed them into another node's INT inputs to make downstream nodes size themselves to match.
Why you care here specifically
Two reasons, both about the stereogram math. First, the texture's repeat width wants to be in the neighborhood of the stereogram's max_separation - the README's rule of thumb is keep the pattern consistent with separation. If your texture is 2048px wide and your separation is 100, you're wasting most of it. Second, if you're mixing a hand-made or externally generated depth map with a pack-generated texture, they often arrive at different sizes; a quick resize_only pass with maintain_aspect brings them into agreement. target_megapixels is the "give me a 2 MP version" lever - handy for pre-shrinking a huge photo before it hits the stereogram generator, where every pixel costs generation time.
Gotchas
- All zeros and
maintain_aspectmeans the node has to guess; set at least one explicit target. resize_with_upscalerdoes nothing useful without the upscale model wired in, so don't forget that input exists.- The pack's MiDaS node has its own
process_widthfor depth generation - you don't need this node for that, only for textures and external maps.
Installing it
Standard pack install:
cd ComfyUI/custom_nodes
git clone https://github.com/SanDiegoDude/ComfyUI-DeepStereo
cd ComfyUI-DeepStereo
pip install -r requirements.txt
Restart ComfyUI, or search ComfyUI-DeepStereo in ComfyUI Manager. Pure image processing, no downloads on first run.
Inputs (10)
| Name | Type | Default | Description |
|---|---|---|---|
| image | IMAGE | — | |
| operation | COMBO | resize_only | 5 options: resize_only, resize_with_upscaler, rotate, flip_horizontal, flip_vertical |
| target_megapixelsopt | FLOAT | 0.00–50 | Target MP (0 = use width/height instead) |
| target_widthopt | INT | 00–8192 | Target width (0 = auto from height or MP) |
| target_heightopt | INT | 00–8192 | Target height (0 = auto from width or MP) |
| maintain_aspectopt | BOOLEAN | true | — |
| resample_methodopt | COMBO | LANCZOS | 4 options: LANCZOS, BICUBIC, BILINEAR, NEAREST |
| rotation_degreesopt | INT | 900–359 | — |
| upscale_modelopt | UPSCALE_MODEL | Connect from Load Upscale Model node | |
| upscale_factoropt | FLOAT | 2.01–8 | — |
Outputs (3)
| Name | Type | Description |
|---|---|---|
| processed_image | IMAGE | — |
| width | INT | — |
| height | INT | — |