ComfyUI Extension: ComfyUI_MUTOU_SmartAspectRatio
Run ComfyUI workflows without the setup
No installs, no CUDA version roulette, no GPU sitting idle on your bill. Bring a workflow and run it in the browser.
A smart custom node for ComfyUI that automatically detects the aspect ratio of an input image and matches it to the closest ratio from a user-defined list.
README
🧩 ComfyUI MUTOU Smart Aspect Ratio
A smart custom node for ComfyUI that automatically detects the aspect ratio of an input image and matches it to the closest ratio from a user-defined list. 一个用于 ComfyUI 的智能节点,自动检测输入图像的宽高比,并匹配用户定义列表中最接近的比例名称。
Note: This node outputs the original dimensions of the image. It does NOT resize or crop the image. 注意:本节点输出图像的原始尺寸。它不会缩放或裁切图像。
✨ Features (功能特点)
- Smart Matching: Calculates the current aspect ratio and finds the closest match from your list (e.g., identifies a 1000x1000 image as "1:1"). 智能匹配:计算当前比例并从列表中找出最接近的匹配项(例如:将 1000x1000 的图像识别为 "1:1")。
- Original Data: Outputs strictly the original width and height (INT & STRING), perfect for logic control without altering pixels. 原始数据:严格输出原始宽高(整数和文本),适合在不修改像素的情况下进行逻辑控制。
- Flexible Input: Supports unlimited custom ratios (e.g.,
21:9, 3:4, 1.85:1). 灵活输入:支持无限自定义比例列表。
🛠️ Installation (安装方法)
- Go to your ComfyUI
custom_nodesdirectory. 进入 ComfyUI 的custom_nodes目录。 - Clone this repository:
克隆本仓库:
git clone https://github.com/c1660181647-hash/ComfyUI_MUTOU_SmartAspectRatio.git - Restart ComfyUI. 重启 ComfyUI。
🚀 Usage (使用方法)
- Search Node: Double click on canvas and search for
MUTOU. 搜索节点:双击画布搜索MUTOU。 - Connect Image: Connect your image to the
imageinput. 连接图片:将图片连入image输入点。 - Set Ratios: Edit the
ratio_listtext widget (supports multiline). 设置比例:编辑ratio_list文本框(支持多行输入)。 - Outputs:
输出端口:
width_int/height_int: Original dimensions (INT).ratio_name: The matched ratio text (e.g., "16:9").wh_text: Original resolution string (e.g., "1024x768").
👨💻 About
Developed by MUTOU.
Designed for Easy-Use ComfyUI workflows.
Run ComfyUI workflows without the setup
No installs, no CUDA version roulette, no GPU sitting idle on your bill. Bring a workflow and run it in the browser.