ComfyUI > Nodes > ComfyUI 1hewNodes > Image Rotate with Mask

ComfyUI Node: Image Rotate with Mask

Class Name

1hew_ImageRotateWithMask

Category
1hewNodes/image
Author
1hew (Account age: 1113days)
Extension
ComfyUI 1hewNodes
Latest Updated
2026-04-17
Github Stars
0.03K

How to Install ComfyUI 1hewNodes

Install this extension via the ComfyUI Manager by searching for ComfyUI 1hewNodes
  • 1. Click the Manager button in the main menu
  • 2. Select Custom Nodes Manager button
  • 3. Enter ComfyUI 1hewNodes 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

Image Rotate with Mask Description

Rotates images with masks using OpenCV, preserving masked areas for precise transformations.

Image Rotate with Mask:

The 1hew_ImageRotateWithMask node is designed to facilitate the rotation of images while simultaneously applying a mask to maintain specific areas of interest. This node is particularly beneficial for AI artists who need to manipulate images without losing important details or altering the masked regions. By leveraging advanced image processing techniques, this node ensures that the rotation is smooth and the masked areas are preserved accurately. The node uses OpenCV functions to handle the rotation and masking processes, providing a seamless experience for users who want to enhance their creative projects with precise image transformations. The primary goal of this node is to offer a reliable and efficient method for rotating images with masks, making it an essential tool for artists looking to maintain the integrity of their work during transformations.

Image Rotate with Mask Input Parameters:

angle

The angle parameter determines the degree of rotation applied to the image. It is a crucial parameter as it defines how much the image will be rotated clockwise. The impact of this parameter is directly on the orientation of the image, and it can significantly alter the visual outcome. Typically, the angle can range from -360 to 360 degrees, allowing for full circular rotations. The default value is often set to 0, meaning no rotation, but users can adjust this to achieve the desired effect.

mask_pil

The mask_pil parameter is an optional input that allows you to specify a mask for the image. This mask is used to protect certain areas of the image from being altered during the rotation process. If provided, the mask should be in the same dimensions as the image and can be used to maintain the integrity of specific regions. If no mask is provided, the node will create a default mask that covers the entire image, ensuring that the rotation does not affect the image's boundaries.

Image Rotate with Mask Output Parameters:

result_images

The result_images output parameter provides the rotated images as a result of the node's processing. This output is crucial as it represents the final visual product after applying the specified rotation and mask. The images are returned as tensors, which are suitable for further processing or integration into other AI workflows. The interpretation of this output is straightforward: it is the transformed version of the input image, rotated according to the specified angle and masked as needed.

result_masks

The result_masks output parameter delivers the masks that correspond to the rotated images. This output is important for understanding which areas of the image were protected during the rotation process. Like the images, the masks are also returned as tensors, allowing for easy manipulation and analysis. The masks help in identifying the preserved regions and can be used for further image processing tasks where maintaining specific areas is critical.

Image Rotate with Mask Usage Tips:

  • To achieve the best results, ensure that the angle parameter is set according to the desired rotation effect. Experiment with different angles to find the perfect orientation for your image.
  • When using a mask, make sure it aligns perfectly with the image dimensions to avoid unexpected results. This will help in preserving the areas you want to protect during the rotation.

Image Rotate with Mask Common Errors and Solutions:

Image and mask dimension mismatch

  • Explanation: This error occurs when the dimensions of the image and the mask do not match, leading to incorrect masking during rotation.
  • Solution: Ensure that both the image and the mask have the same dimensions before processing them with the node.

Invalid angle value

  • Explanation: An invalid angle value, such as a non-numeric input, can cause the node to fail in executing the rotation.
  • Solution: Verify that the angle is a numeric value within the acceptable range of -360 to 360 degrees. Adjust the input accordingly to resolve the issue.

Image Rotate with Mask Related Nodes

Go back to the extension to check out more related nodes.
ComfyUI 1hewNodes
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.

Image Rotate with Mask