ComfyUI > Nodes > ComfyUI Fictiverse Nodes > Resize To Megapixels

ComfyUI Node: Resize To Megapixels

Class Name

Resize To Megapixels

Category
Fictiverse/Resize
Author
Fictiverse (Account age: 1343days)
Extension
ComfyUI Fictiverse Nodes
Latest Updated
2026-04-26
Github Stars
0.02K

How to Install ComfyUI Fictiverse Nodes

Install this extension via the ComfyUI Manager by searching for ComfyUI Fictiverse Nodes
  • 1. Click the Manager button in the main menu
  • 2. Select Custom Nodes Manager button
  • 3. Enter ComfyUI Fictiverse Nodes in the search bar
After installation, click the Restart button to restart ComfyUI. Then, manually refresh your browser to clear the cache and access the updated list of nodes.

Visit ComfyUI Online for ready-to-use ComfyUI environment

  • Free trial available
  • 16GB VRAM to 80GB VRAM GPU machines
  • 400+ preloaded models/nodes
  • Freedom to upload custom models/nodes
  • 200+ ready-to-run workflows
  • 100% private workspace with up to 200GB storage
  • Dedicated Support

Run ComfyUI Online

Resize To Megapixels Description

Adjusts image dimensions to a target megapixel count, preserving aspect ratio and resolution.

Resize To Megapixels:

The Resize To Megapixels node is designed to adjust the dimensions of an image to achieve a specific megapixel count while maintaining the original aspect ratio. This node is particularly useful for artists and designers who need to resize images to meet specific resolution requirements without distorting the image's proportions. By calculating the target pixel count based on the desired megapixels, the node ensures that the resized image fits within the specified constraints. The node also allows for the dimensions to be adjusted to the nearest multiple of a specified value, providing additional control over the final output size. This functionality is essential for optimizing images for various applications, such as digital art, printing, or web use, where specific resolution and aspect ratio are crucial.

Resize To Megapixels Input Parameters:

width

The width parameter specifies the initial width of the image in pixels. It determines the starting point for calculating the new dimensions based on the desired megapixel count. The minimum value is 64, the maximum is 8192, and the default is 1024. Adjusting this parameter affects the aspect ratio and the final resized dimensions.

height

The height parameter defines the initial height of the image in pixels. Similar to the width, it is used to calculate the new dimensions while maintaining the aspect ratio. The minimum value is 64, the maximum is 8192, and the default is 1024. This parameter, in conjunction with the width, influences the aspect ratio and the resized image's dimensions.

megapixels

The megapixels parameter sets the target resolution of the resized image in megapixels. It determines the total number of pixels the image should contain after resizing. The minimum value is 0.1, the maximum is 100.0, and the default is 1.0. This parameter is crucial for ensuring the image meets specific resolution requirements.

multiple_of

The multiple_of parameter specifies the value to which the new dimensions should be rounded. This ensures that the resized dimensions are multiples of a specified number, which can be important for certain applications or hardware requirements. The minimum value is 1, the maximum is 512, and the default is 64. Adjusting this parameter provides additional control over the final output size.

Resize To Megapixels Output Parameters:

adjusted_width

The adjusted_width output represents the new width of the image after resizing. It is calculated based on the desired megapixel count and the original aspect ratio, then rounded to the nearest multiple specified by the multiple_of parameter. This output is essential for understanding the final dimensions of the resized image.

adjusted_height

The adjusted_height output indicates the new height of the image after resizing. Like the adjusted width, it is determined by the target megapixel count and the original aspect ratio, and then rounded to the nearest specified multiple. This output provides the final height of the resized image, ensuring it meets the desired specifications.

Resize To Megapixels Usage Tips:

  • To maintain the original aspect ratio while resizing, ensure that the width and height parameters reflect the current dimensions of your image.
  • Use the megapixels parameter to set the desired resolution, especially when preparing images for print or high-resolution displays.
  • Adjust the multiple_of parameter to match specific requirements, such as hardware constraints or application needs, to ensure compatibility.

Resize To Megapixels Common Errors and Solutions:

Invalid width or height value

  • Explanation: The width or height value provided is outside the allowed range of 64 to 8192 pixels.
  • Solution: Ensure that both the width and height values are within the specified range before running the node.

Megapixels value out of range

  • Explanation: The megapixels value is set below 0.1 or above 100.0, which is outside the acceptable range.
  • Solution: Adjust the megapixels value to be within the range of 0.1 to 100.0 to ensure proper resizing.

Multiple_of value not valid

  • Explanation: The multiple_of parameter is set to a value outside the range of 1 to 512.
  • Solution: Set the multiple_of parameter to a valid integer within the specified range to ensure the dimensions are correctly rounded.

Resize To Megapixels Related Nodes

Go back to the extension to check out more related nodes.
ComfyUI Fictiverse Nodes
RunComfy
Copyright 2025 RunComfy. All Rights Reserved.

RunComfy is the premier ComfyUI platform, offering ComfyUI online environment and services, along with ComfyUI workflows featuring stunning visuals. RunComfy also provides AI Models, enabling artists to harness the latest AI tools to create incredible art.