Nodes/ComfyUI-DeepStereo/DeepStereo: Image Resize and Transform
ComfyUI Node

DeepStereo: Image Resize and Transform

Getting your depth map and texture to the same size is half the Magic Eye battle

By SanDiegoDude·Created about a year ago·Updated about a year ago· 3
DeepStereo: Image Resize and Transform
  • image
  • upscale_model
  • processed_image
  • width
  • height
operationresize_only
target_megapixels0.0
target_width0
target_height0
maintain_aspecttrue
resample_methodLANCZOS
rotation_degrees90
upscale_factor2.0

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), or target_width / target_height (0 = auto from the other dimension or from megapixels). maintain_aspect (default on) stops you from accidentally squashing, and resample_method defaults to LANCZOS with BICUBIC/BILINEAR/NEAREST as fallbacks.
  • resize_with_upscaler - the same resize, but it takes an upscale_model (wire in from the core Load Upscale Model node) and an upscale_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_aspect means the node has to guess; set at least one explicit target.
  • resize_with_upscaler does nothing useful without the upscale model wired in, so don't forget that input exists.
  • The pack's MiDaS node has its own process_width for 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.

CategoryDeepStereo/Utility

Inputs (10)

NameTypeDefaultDescription
imageIMAGE
operationCOMBOresize_only5 options: resize_only, resize_with_upscaler, rotate, flip_horizontal, flip_vertical
target_megapixelsoptFLOAT0.00–50Target MP (0 = use width/height instead)
target_widthoptINT00–8192Target width (0 = auto from height or MP)
target_heightoptINT00–8192Target height (0 = auto from width or MP)
maintain_aspectoptBOOLEANtrue
resample_methodoptCOMBOLANCZOS4 options: LANCZOS, BICUBIC, BILINEAR, NEAREST
rotation_degreesoptINT900–359
upscale_modeloptUPSCALE_MODELConnect from Load Upscale Model node
upscale_factoroptFLOAT2.01–8

Outputs (3)

NameTypeDescription
processed_imageIMAGE
widthINT
heightINT