Nodes/ComfyUI-PBRFusion4/Conditional Upscale (using Model)
ComfyUI Node

Conditional Upscale (using Model)

A bypass switch around a model upscaler — nothing more, and that's the point

By Night1099·Created 7 months ago·Updated 4 months ago· 19
Conditional Upscale (using Model)
  • upscale_model
  • image
  • image
enabletrue

Conditional Upscale (using Model) (AIXPOLY_ConditionalUpscale) is a gate wrapped around a model upscaler. Feed it an image and an upscale model, and if enable is true it upscales with the model; if false, the image passes through completely untouched. One input, one output, nothing hidden.

That sounds almost too simple to be worth a node - ComfyUI already ships ImageUpscaleWithModel. But the whole reason this pack includes it is the workflow shape the other nodes build toward. This pack's utility nodes are "resolution plumbing": the Smart Upscale Calculator computes target sizes, Clamp Resolution caps them, and this node is the switch that decides whether the expensive model step actually runs. When your source is already 2K and your target is 2K, you don't want an upscaler chewing VRAM for nothing - you want it skipped without rewiring the graph.

How it works

Mechanically it's the same tiled upscale path ComfyUI uses internally: comfy.utils.tiled_scale with 512px tiles and 32px overlap, so a big 4K texture won't blow up your VRAM by processing all at once. It also frees memory before starting, and if it still hits an out-of-memory error it automatically halves the tile size, down to a floor of 128px, before giving up. Tiles halving means a giant image degrades into slower, not broken - a genuinely nice property for a node meant to run at multiple output sizes.

The upscaler itself is a plain pixel upscaler, the same ESRGAN-family .pth/.safetensors models you load with ComfyUI's Load Upscale Model node (4x-UltraSharp, Remacri, and friends). It adds pixels, not invented detail - which for PBR texture work is exactly what you want. You don't want a generative upscaler hallucinating new surface detail into a material map you're about to bake.

Inputs and outputs

Three inputs, all required:

  • upscale_model - the UPSCALE_MODEL output of a Load Upscale Model node.
  • image - what you're upscaling.
  • enable (default true) - the gate. A plain boolean, not a menu.

The single output is image - either the upscaled result or the input untouched, and you can't tell which from the wire. The classic wiring is to drive enable from the Smart Upscale Calculator's needs_upscale output, so the whole resolution stage turns itself on and off based on whether your source actually needs it.

Install

This is part of the ComfyUI-PBRFusion4 pack, so install is the shared dance: search "ComfyUI-PBRFusion4" in ComfyUI Manager and restart, or:

cd ComfyUI/custom_nodes
git clone https://github.com/Night1099/COMFYUI-PBRFusion4

Then restart ComfyUI. Good news: this node doesn't need the pack's 4.1 GB PBRFusion4 model - that only downloads when you run the depth/normal generator. You just need the upscale model you already use.

Gotchas

  • You can't tell from the wire whether it ran. If you're debugging why a texture didn't get bigger, check the enable value first - it's the most common cause.
  • Dependency install matters. The pack imports OpenCV (opencv-python-headless) at load time, so if that's missing the whole pack fails to appear - utility nodes included. Install the pack's requirements if anything shows as missing.
  • It's a pixel upscaler, not a restorer. If you're expecting SUPIR-style detail reconstruction, this isn't that tool. It's the cheap, fast, faithful rung of the upscaling ladder, and for this pack that's the right rung.
CategoryPBRFUSION4/Utils

Inputs (3)

NameTypeDefaultDescription
upscale_modelUPSCALE_MODEL
imageIMAGE
enableBOOLEANtrue

Outputs (1)

NameTypeDescription
imageIMAGE