Sharpfin Magic Image Resize
The resizer that respects your pixels (and your colors)
- image
- resized_image
- out_width
- out_height
ComfyUI's stock Upscale Image node is fine, right up until it isn't. It hands you four kernels, resizes in gamma-encoded sRGB, and quietly turns a downscaled render into something slightly mushy and slightly off-color - and you blame the model when it was the resampling all along. SharpfinResizer is the fix for that. It's a single node wrapping drhead's Sharpfin library (Apache 2.0, vendored into the pack) that swaps in a much better set of interpolation kernels and does the whole resize in linear light. No models to download, no API key, no VRAM drama.
Let's be clear about which job this does. In the upscaling world there's "more pixels" (plain resampling) and "more detail" (generative upscalers like SeedVR2 or SUPIR that invent content). SharpfinResizer is aggressively, unapologetically the first kind. It cannot hallucinate eyelashes or rebuild a blurry face - it's for when your source already has the detail and you just need it resized properly, without ringing, moiré, or color drift. Interpolators had a reputation problem for a while, but a good one is genuinely underrated. This is a good one.
How it works
Two things separate it from the built-in node. First, the kernels. Besides the usual Nearest, Bilinear, and the Lanczos pair, it ships Mitchell, Catmull-Rom, B-Spline, and three flavors of Magic Kernel Sharp (plain, 2013, and 2021) - the resampling family that made its name in the Magic Camera project and has a serious following among people who downscale photos for a living. The default is Magic Kernel Sharp 2021, and the author recommends it; it's a good default.
Second, the color handling. With srgb_conversion enabled (the default), the node converts the image from sRGB to linear RGB, resamples, then converts back and clamps to [0,1]. Resizing in gamma space smears midtones and shifts color on gradients; resizing in linear light keeps them honest. That's the "Magic" in the name, and it's the part you'll actually notice if you downscale anything with a sky or a soft gradient in it.
One more thing worth knowing: it preserves aspect ratio. Since v2.0.0, it figures out which dimension is the limiting one and scales the other proportionally - so the width and height you type are targets, not guarantees. That's why it also returns out_width and out_height.
Inputs and outputs that matter
You'll touch three inputs on a normal day:
- width / height - target dimensions (1–8192, default 512). Actual output may differ to keep the aspect ratio.
- kernel - the ten-way picker. Leave it on Magic Kernel Sharp 2021 unless you have a reason. Two traps: Nearest only supports downsampling (it raises an error if you try to upscale with it), and if you're chasing speed rather than quality, Bilinear is the cheap seat.
- srgb_conversion - keep it enabled. Disable only if you're resizing something already in linear space and want to skip the round trip.
Outputs: resized_image, plus out_width and out_height (the actual, aspect-ratio-adjusted dimensions) - wire those into anything downstream that needs real numbers, like a VAE encode or a second resize.
Installing it
Easiest path is ComfyUI Manager: search ComfyUI Sharpfin (the pack title), hit install, restart ComfyUI. Or manually:
cd ComfyUI/custom_nodes
git clone https://github.com/tarcon/ComfyUI-Sharpfin
then restart. Dependencies are torch ≥ 2.4, torchvision ≥ 0.19, numpy, Pillow, msgspec, and tqdm - everything a stock ComfyUI already has. There are no model files to fetch. The one real requirement is Python ≥ 3.11; on an older Python the node won't import at all.
Gotchas
- It's pure-PyTorch, not blazing GPU magic. The original Sharpfin had a Triton path (~7× faster) that was removed from this fork for cross-platform/macOS support. You get the portable dense implementation, which is fine for single images and slower on big batches - don't expect video-frame throughput.
- Your typed dimensions may not be your output dimensions. Read
out_width/out_heightinstead of assuming. - Nearest + upscale = hard error. Pick a smooth kernel.
- It's a niche node with essentially no community footprint, so there's no folklore to lean on - the README and the source are the documentation. The pack ships unit tests and CI, which is more than a lot of custom nodes can say.
If your resize results look subtly wrong and you've been blaming everything else, this is worth the two minutes to install.
Inputs (5)
| Name | Type | Default | Description |
|---|---|---|---|
| image | IMAGE | Input image to resize | |
| width | INT | 5121–8192 | Target width in pixels (1-8192). Actual width may differ to preserve aspect ratio |
| height | INT | 5121–8192 | Target height in pixels (1-8192). Actual height may differ to preserve aspect ratio |
| kernel | COMBO | Magic Kernel Sharp 2021 | Interpolation kernel. "Magic Kernel Sharp 2021" recommended for quality. "Nearest" only supports downsampling |
| srgb_conversion | COMBO | enable | Enable sRGB color space conversion for accurate color handling during resize |
Outputs (3)
| Name | Type | Description |
|---|---|---|
| resized_image | IMAGE | Resized image preserving aspect ratio |
| out_width | INT | Actual output width in pixels (aspect-ratio adjusted) |
| out_height | INT | Actual output height in pixels (aspect-ratio adjusted) |