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

ComfyUI_SwapAndScale

Custom ComfyUI node to swap Height and Width input easily. Also you can set both height and width to a 32px scale and limit total to 1MP

Mainteneur@MijnSpamD · adoptionClasse

Profil du package

Statut
Vérifié
Éditeur
@MijnSpam
Source
GitHub
Étoiles
0

LIREMOI

ComfyUI_Swap_and_Scale


✨ Features

  • 🔗 Swap width with height
  • Limit output widht and height to a total of 1 Megapixel (usefull for certain model)
  • Resize width and height to factors of 32 which is usefull for new images, not so for existing.

🔧 Installation (Use ComfyUI customnode manager or clone this repo)

  1. Clone or download this repo into your ComfyUI/custom_nodes directory:
cd /workspace/ComfyUI/custom_nodes
git clone https://github.com/MijnSpam/ComfyUI_SwapAndScale.git
  1. Install dependencies:
no dependencies, all build-in python functions.
  1. Restart ComfyUI (or use the Reload Custom Nodes button if available).
  2. Refesh browser.

🧩 How to Use

Add node to workflow and connect a widht and heigth to the field.

In ComfyUI:

ComfyUI Node

  1. example explanation:
    • 1: Swap Width_Height is on and as you see the out_height is swapped with the width.
    • 2: example input image had dimensions 1344x752 >> 752 /32 = 23.5 and so with the factor_32px it's resize to 736.
    • 3: Total pixels (W*H) is below 1024000 px so no scaling done

ComfyUI Node 2. example explanation: - 1: NO Swap Width_Height, however 1MP and factor32 is on. Width 1504 / 32 = 47, Height 2720 / 32 = 85 >> ratio (w/h 0.552) scaled ratio 736 / 1344 = 0.547 Not perfect but it respects the 1MP Limit with the 32px rule.


🧑‍💻 Contributing

Pull requests and feature ideas are welcome!
Feel free to fork and create a PR.


📄 License

This project is licensed under the MIT License.
See LICENSE for details.

Other custom nodes (search for "KB comfy" in manager)

  • Upload to Pushover

Changelog

1.0.2 Trying to fix update when using comfy custom node manger 1.0.1 Fixed fault in 1MP resolution, no it actually uses 1024*1024

Nœuds dans ce pack

Nœud 1
  • SwapAndScale

Sources

3 sources
GitHubSource
github.com/MijnSpam/ComfyUI_SwapAndScale

Vérifié 2 nov.

GitHubSourceVersion 8bcdf7d9371fe774ac144ebe11748e261b4380bf
github.com/MijnSpam/ComfyUI_SwapAndScale

Vérifié 26 oct.

Extraits de sources

1 extrait

Source context: Repo MijnSpam/ComfyUI_SwapAndScale