Nodes/ComfyUI-TextureAlchemy/Upscale Calculator (Multi-Pass)
ComfyUI Node

Upscale Calculator (Multi-Pass)

Stop guessing at per-pass scale factors

By amtarr·Created 9 months ago·Updated 4 months ago· 58
Upscale Calculator (Multi-Pass)
  • image
  • image
  • scale_per_pass
  • target_width
  • target_height
  • info
target_scale4.000
upscaler_multiplier4.0
number_of_passes2

Here's a problem you've hit if you've ever chained two upscalers: you want a 2x total, but both of your upscalers are 4x models, and 4x then 4x gives you 16x, which blows your VRAM and produces a wall of mush. Multi-pass upscaling math is easy to get wrong, and getting it wrong is expensive in both time and VRAM.

Upscale Calculator is a pocket calculator for exactly that. You tell it your final target scale, the multiplier of each upscaler you're chaining, and how many passes you'll chain, and it returns the scale factor you should set each upscaler to so the chain lands exactly on your target. It's the difference between "4x then 4x" overshooting to 16x and "4x then 0.5x" actually hitting 2x.

There's a big caveat to get out of the way first: this node does not upscale anything. The image output is your input passed through untouched. It's a math helper - you read the numbers off its outputs and dial them into your real upscaler nodes. If you want actual upscaling plus the math, the same pack's UpscaleToResolution is the sibling that takes a target resolution instead of a scale.

How it works

The core formula, straight from the source: scale_per_pass = target_scale^(1/passes) / upscaler_multiplier. Each pass multiplies the image by upscaler_multiplier × scale_per_pass, so after N passes you've scaled by (upscaler × scale_per_pass)^N, which by construction equals target_scale. The node also computes the target width/height and prints a console log walking through each pass with a "perfect match / within 1% / deviation" verdict on the math.

The inputs

  • target_scale (0.125–16) - where you want to end up (4.0 means 512 → 2048).
  • upscaler_multiplier (1–8) - what each of your upscalers does at its native setting.
  • number_of_passes (1–10) - how many upscalers you're chaining.

Outputs: image (passthrough), scale_per_pass (the number to feed each upscaler), target_width and target_height (INTs), and info (a STRING summary you can pipe to a text display node or the console).

Installing it

Upscale Calculator ships in ComfyUI-TextureAlchemy. ComfyUI Manager → search "Texture Alchemy" → install → restart. Manual:

cd ComfyUI/custom_nodes
git clone https://github.com/amtarr/ComfyUI-TextureAlchemy
# restart ComfyUI

No extra dependencies or model files - pure PyTorch. Found under Add Node → Texture Alchemist → Texture. (The README's ComfyUI_PBR_MaterialProcessor copy-the-folder note is stale - pre-rebrand name; use Manager or git clone.)

Using it for real

Know which job you're doing first - the KB's upscaling essay makes the point that "more pixels" and "more detail" are different jobs. These calculator nodes sit in the "more pixels" camp: they size a chain of plain resamplers correctly, which is exactly right for texture work (you generally do not want a generative upscaler inventing detail on a material map). Chain two 4x models, ask for a 2x texture upscale, and the calculator tells you to set each pass to roughly 0.5x after the 4x stage - a genuinely unintuitive number you'd never arrive at by feel. Wire scale_per_pass into your upscaler nodes' scale inputs and you can stop burning VRAM on accidental 16x chains.

CategoryTexture Alchemist/Texture

Inputs (4)

NameTypeDefaultDescription
imageIMAGE
target_scaleFLOAT4.0000.125–16Desired final scale multiplier (e.g., 4.0 for 512→2048)
upscaler_multiplierFLOAT4.01–8The multiplier of each upscaler (e.g., 4.0 for 4× upscaler)
number_of_passesINT21–10How many upscalers will be chained

Outputs (5)

NameTypeDescription
imageIMAGE
scale_per_passFLOAT
target_widthINT
target_heightINT
infoSTRING