From 58d3c0c0dcd30ed9f22c45ca9cb3872ec305e209 Mon Sep 17 00:00:00 2001 From: fujammy <467918@qq.com> Date: Wed, 25 Dec 2024 01:44:44 +0800 Subject: [PATCH] Enhance image resolution adjuster to support SDXL optimal aspect ratios with improved error handling. Update README files to reflect new features and use cases for the image resolution adjuster utility. --- README.md | 15 ++++++ README_CN.md | 15 ++++++ .../image_resolution_adjuster.cpython-311.pyc | Bin 11085 -> 10942 bytes image_resolution_adjuster.py | 48 ++++++++++++++---- 4 files changed, 69 insertions(+), 9 deletions(-) diff --git a/README.md b/README.md index 42c6374..6318cea 100644 --- a/README.md +++ b/README.md @@ -56,6 +56,21 @@ Features: - Supports trimming leading and trailing spaces - Flexible output format options +### Image Resolution Adjuster +A utility node for adjusting image resolutions according to SDXL optimal aspect ratios. + +Features: +- Supports all SDXL optimal resolutions (1:1, 9:7, 7:9, 3:2, 2:3, etc.) +- Adjustable scale factor for resolution scaling +- Configurable maximum and minimum resolution constraints +- Multiple extend modes (contain, cover, fill, etc.) +- Maintains aspect ratio while resizing + +Use Cases: +- Preparing images for SDXL generation +- Batch resizing images to specific aspect ratios +- Standardizing image dimensions for consistent processing + ## 🎨 Usage Examples ### Dynamic Image Inputs Node diff --git a/README_CN.md b/README_CN.md index 908adb0..1f4736b 100644 --- a/README_CN.md +++ b/README_CN.md @@ -51,6 +51,21 @@ git clone https://github.com/jammyfu/ComfyUI_PaintingCoderUtils.git - 支持移除首尾空格 - 灵活的输出格式选项 +### 图像分辨率调整器 (Image Resolution Adjuster) +一个用于按照 SDXL 最佳宽高比调整图像分辨率的实用节点。 + +特点: +- 支持所有 SDXL 最佳分辨率(1:1、9:7、7:9、3:2、2:3 等) +- 可调节的缩放系数 +- 可配置的最大和最小分辨率限制 +- 多种延展模式(包含、覆盖、填充等) +- 调整时保持宽高比 + +使用场景: +- 为 SDXL 生成准备图像 +- 批量调整图像至特定宽高比 +- 标准化图像尺寸以保持处理一致性 + ## 🎨 使用示例 ### 动态图片输入节点 diff --git a/__pycache__/image_resolution_adjuster.cpython-311.pyc b/__pycache__/image_resolution_adjuster.cpython-311.pyc index c39bc69a156d0bd3a9b1c7ec4810607888af8245..a6d15357657948c96bbdb30531df8935226144c6 100644 GIT binary patch delta 1457 zcmb`HO>7%Q6o6;EKVGlB8z8uj9pgCvY)w<_BrRDrZGq+hDF~6altM^N*NIIN+nrsf zku_F=_)%N6sL~u7sj29xRmCO92W~x-BSJVR6474Z!hxQQ#E)by%(L4NDBKv$eDBSh zH#2YEKJC{h?jF}~YnqC9lYV}0ZfMWv`n6E(um_=Q$ikM#5-ib@EZOo}isiG^HD5($ zxWiBbVb}wWxgD`~rQ*v!;Rr1Y(9)Pc+=~^qHyp$&>kjuXd;eOcD)ryumwd)Yt5pIt zKs{$gnAtMdg_cfC$M?X63+kbPvY$(#CI4}T=14nyRjQTw{1)c-@WIBz-pAFydHAWu zlHuU;&Kn+$Os6^(&o&R{k?B-w={&NXFA}NVj7)0D|0S{~bx0IdsBc!BLWa)1iF~oY zAtcRYLl`r;w%;6U2*YNoA*9S!r=-F=_QU_-e_aKXoi)eFN$s8e=nL)=ea`pu+OvKqp4T4@OOdOw}IHIy%Ff$ z4D{Z7elswzGEtY2qSYRY*SyfTdQ$77n>}M2O4kMT>g3hQAN7t}cx=6&gZB;H+|33wB5isKGj>mC|tV3R=Y8L}&#&sk2^m9v@LT-I^@wzV`r(>j=4?i!M0 z?iOcvyZWXVVLKo8ha4-YuAoqKD;RmCcWwnc>+Nd0Tt^%$ll2Jl=@%APmRA!sZ$Ix_ zZIRW9oBLJ|ZMG$9O5#@;?Fv_a>AH>ENS+^E_Qaod@lpdDY^%G}`3^UcX%1JkolMac zUV8Od4k-xzgju%dxtCAFdK&O9;0(axFgyezcI9-jn8{oGsn{kNu=q*FF3gvB?(#M% zg8wQVCkARDPAT)A?DZ5if^9_)& t)}A%cw$EuO2NnueX+Cq1e9F%3zSxt%hjAV4;3*u!d+KN#DW)e5{RwrmPeuR$ delta 1547 zcmb7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