Extensions/ComfyUI-SimpleMegapixels
ComfyUI Extension

ComfyUI-SimpleMegapixels

A dead-simple ComfyUI node: resize image(s) to a chosen megapixel count, preserving aspect ratio. MP selector + upscale method + dimension rounding.

By ai-joe-git·Created about 15 hours ago·Updated about 15 hours ago· 0
ai-joe-git/ComfyUI-SimpleMegapixels
Nodes1
On cloudLocal install
Categoryimage/upscaling
Stars0
Updatedabout 15 hours ago
Readme

ComfyUI-SimpleMegapixels

A dead-simple ComfyUI node: image(s) in → image(s) out, resized to your chosen megapixel count.

Features

  • Input: one image or a batch of images (IMAGE)
  • Output: resized image(s) (IMAGE), batch preserved
  • Megapixels selector — pick the target size in MP (e.g. 1.0 ≈ 1024×1024)
  • Aspect ratio is always preserved
  • Upscale method: lanczos (default), bicubic, bilinear, area, nearest-exact
  • Round dimensions to a multiple (1 / 8 / 16 / 32 / 64) so results stay compatible with diffusion models (default 8)

Example

An 1344×768 image (~1.03 MP) with megapixels = 4.0, round_to = 8 → scale factor √(4.0/1.03) ≈ 1.97 → output 2648×1512 (rounded to multiples of 8).

Install

Via ComfyUI-Manager (search "SimpleMegapixels"), or clone into ComfyUI/custom_nodes:

git clone https://github.com/ai-joe-git/ComfyUI-SimpleMegapixels ComfyUI/custom_nodes/ComfyUI-SimpleMegapixels

Node

SimpleMegapixels — found under image/upscaling.

| Input | Description | |---|---| | image | IMAGE (batch-aware) | | megapixels | Target size in megapixels (default 1.0) | | upscale_method | Interpolation method (default lanczos) | | round_to | Round output dimensions to this multiple (default 8) |

License

MIT — see LICENSE.