Aller au contenu
Node packVérifiéExterne
Ouvrir la source

comfyUI-rotate-image

A ComfyUI custom node for rotating images with configurable background handling.

Mainteneur@palealloy2999-progD · adoptionClasse

Profil du package

Statut
Vérifié
Éditeur
@palealloy2999-prog
Source
GitHub

LIREMOI

Rotate Image (Any Angle) Node

日本語 | English

A custom ComfyUI node that rotates RGB or RGBA images at any angle while preserving the original canvas size, tensor dtype, and device. It can also rotate a ComfyUI mask and preserve or fill transparent areas.

Installation

  1. Clone this repository into ComfyUI/custom_nodes:

    cd ComfyUI/custom_nodes
    git clone https://github.com/palealloy2999-prog/comfyUI-rotate-image.git
    
  2. Restart ComfyUI.

  3. Search for Rotate Image (Any Angle) in the node list.

Workflows created before the Registry-ready release used the internal node ID RotateImageNode. Replace that node after upgrading; the current internal ID is ImageRotateAnyAngle_PaleAlloy.

Inputs

  • image: RGB or RGBA image tensor
  • mask: optional ComfyUI mask where 1 is transparent and 0 is opaque
  • angle: rotation angle in degrees
  • size_mode:
    • cover: enlarge the image until the rotated result covers the entire canvas, cropping overflow
    • original: rotate at the original 1:1 scale (default)
    • contain: shrink the image until the complete rotated result fits inside the canvas
    • match_short_edge: match the short edge of the rotated bounding box to the canvas short edge
    • match_long_edge: match the long edge of the rotated bounding box to the canvas long edge
  • background_mode:
    • transparent: preserve source transparency and make the rotated canvas outside the image transparent
    • white: fill source transparency and the rotated canvas background with white (default)
    • black: fill source transparency and the rotated canvas background with black
    • custom: fill source transparency and the rotated canvas background with a custom hex color
  • custom_color: custom background color in hex format (for example #FF00AA)

Size and background modes are independent, so combinations such as contain with black or original with transparent are supported. Unlike contain, the edge-matching modes can crop the opposite edge when the rotated aspect ratio differs from the canvas. Connect the MASK output from ComfyUI's Load Image node to preserve or fill PNG transparency correctly. RGBA alpha and a connected mask are combined. The white, black, and custom modes produce a fully opaque output mask.

To preview or save transparent output as RGBA, connect this node's image and mask outputs to ComfyUI's Join Image with Alpha node.

Output

  • image: rotated image tensor with the same batch size, height, width, channel count, dtype, and device as the input
  • mask: rotated ComfyUI mask; it is empty for the opaque fill modes

Nœuds dans ce pack

Nœud 1
  • ImageRotateAnyAngle_PaleAlloy

Sources

3 sources
GitHubSourceVersion 388b2fc48dfdd7f561b43df00b5608eaf1eb0d5d
github.com/palealloy2999-prog/comfyUI-rotate-image

Vérifié 8 oct.

GitHubSourceVersion main
github.com/palealloy2999-prog/comfyUI-rotate-image

Vérifié 5 nov.

Extraits de sources

2 extraits

Source context: Repo palealloy2999-prog/comfyUI-rotate-image

Source context: Repo palealloy2999-prog/comfyUI-rotate-image