Nodes/ComfyUI-PBaSR/PBaSR Upscale
ComfyUI Node

PBaSR Upscale

The upscaler that won't sharpen your bokeh

By MoRanYue·Created 3 months ago·Updated 3 months ago· 0
PBaSR Upscale
  • image
  • image
model_name
archPBaSR_SRFormer_x4
tile_size512
tile_pad64
precisionfp16
keep_model_loadedtrue

Every upscaler you already own will sharpen your out-of-focus background. Run ESRGAN or a generative restorer on a real photo and the bokeh - that soft, creamy blur you actually wanted - comes back as smeary texture and invented halos, because a model that has one job ("make it sharper") treats defocus as damage to repair. PBaSR is the rare 4x super-resolution model built to keep the blur: "blur-kept" is the whole pitch, aimed squarely at realistic photos where depth of field carries the shot. If you upscale a lot of real photography, this node is worth a look. If you only upscale AI generations, you can probably skip it - that's fine, it's not for you.

What it actually is

PBaSR is a research upscaler from Imalne/PBaSR, and ComfyUI-PBaSR is a lean inference-only port. It ships two architectures behind one node: PBaSR_SRFormer_x4, the heavy transformer-based model that does the blur-aware work properly, and PBaSR_ESRGAN_x4, an RRDBNet-style variant that's lighter and faster. Both are classic pixel upscalers - they add pixels, they don't hallucinate detail the way SeedVR2 or SUPIR do.

The mechanism is the interesting part. The original PBaSR net is a ParallelNet with a general_branch for in-focus content and a defocus_branch for the blur, plus a combinet branch that averages them at test time. The node's author noticed you only need that averaged branch for inference, so it strips general_branch.*/defocus_branch.* keys out of the checkpoint and loads just combinet.* - less VRAM, same test-time output as the original repo. It also handles the common params / params_ema / module. checkpoint wrappers so you don't have to preprocess anything.

The inputs that matter

The node takes an image in, gives one image (4x) out, and has exactly one set of knobs worth touching:

  • arch - PBaSR_SRFormer_x4 (default, quality) vs PBaSR_ESRGAN_x4 (speed). Try SRFormer first; fall back to ESRGAN if it's crawling.
  • tile_size - default 512. SRFormer x4 is heavy; if you're on 8GB or less, drop to 384.
  • precision - fp16 (default), bf16, or fp32. If you see artifacts on your GPU, fp32 fixes it (and on CPU it's forced to fp32 automatically).
  • tile_pad - default 64. Overlap between tiles so you don't get seams. Leave it alone.

model_name just picks which .pth in your model folder to load, and keep_model_loaded is a cache toggle - leave it on unless you're swapping archs constantly.

Install

Manager will find it as ComfyUI-PBaSR, or the manual route:

cd ComfyUI/custom_nodes
git clone https://github.com/MoRanYue/ComfyUI-PBaSR

Then grab the two weights from huggingface.co/MoRanYue/PBaSR and put them here - not in custom_nodes:

ComfyUI/models/pbasr/PBaSR_SRFormer_best.pth
ComfyUI/models/pbasr/PBaSR_ESRGAN_best.pth

Restart ComfyUI and add it via image/upscaling → PBaSR Upscale. Good news: there's no requirements.txt and no pip install - the port vendors the BasicSR arch code it needs, so all you're really installing is torch, which you already have.

Where people get burned

The most common failure is also the dumbest: run the node before dropping the models in and you'll see the model dropdown showing a literal placeholder (put_PBaSR_SRFormer_best.pth...). The node raises FileNotFoundError rather than guessing - the fix is just putting the weights where it's looking.

Second: fp16 artifacts on certain GPUs. The README's own advice is to try fp32 before you blame the model. Third: SRFormer x4 is much heavier than a normal RRDB/ESRGAN - if you're OOMing on a large image, drop tile_size to 384 before anything else.

The honest verdict

PBaSR is a niche, research-flavored tool - new, barely discussed, and it won't out-restore SeedVR2 or out-sharpen 4x-UltraSharp. But if your workflow is "real photo, shallow depth of field, upscale it without wrecking the bokeh," it's the one thing designed for exactly that job. Wire it after your generation/restore step and before any final sharpening, and don't sharpen afterward - that defeats the whole point.

Categoryimage/upscaling

Inputs (7)

NameTypeDefaultDescription
imageIMAGE
model_nameCOMBO1 options: put_PBaSR_SRFormer_best.pth_or_PBaSR_ESRGAN_best.pth_in_ComfyUI_models_pbasr
archCOMBOPBaSR_SRFormer_x42 options: PBaSR_SRFormer_x4, PBaSR_ESRGAN_x4
tile_sizeINT5120–2048
tile_padINT640–256
precisionCOMBOfp163 options: fp16, bf16, fp32
keep_model_loadedBOOLEANtrue

Outputs (1)

NameTypeDescription
imageIMAGE