下载

夸克:https://pan.quark.cn/s/acbb99f01fb4

迅雷::https://pan.xunlei.com/s/VNxcqQGRNcf1OMd7NoR-aqKuA1?pwd=g6kp#

来源github作者:thomasasfk这是一个简单的sd-webui插件,可在更改尺寸的时侯,轻松保持宽高比

安装

下载压缩包后,解压放入以下路径:

放入:stable-diffusion-webui\extensions

Features 特征

  • JavaScript aspect ratio controls
    JavaScript 纵横比控件

    • Adds a dropdown of configurable aspect ratios, to which the dimensions will auto-scale
      添加可配置纵横比的下拉列表,尺寸将自动缩放到该纵横比
    • When selected, you will only be able to modify the higher dimension
      选中后,您将只能修改更高的维度

      • The smaller or equivalent dimension will scale accordingly
        较小或等效的维度将相应缩放
  • If "Lock/🔒" is selected, the aspect ratio of the current dimensions will be kept
    如果选择“Lock/🔒”,则将保持当前尺寸的纵横比

    • If "Image/🖼️" is selected, the aspect ratio of the current image will be kept (img2img only)
      如果选择“Image/🖼️”,则将保留当前图像的纵横比(仅限 img2img)
    • If you click the "Swap/⇅" button, the current dimensions will swap
      如果单击“交换/⇅”按钮,则当前尺寸将交换

      • Configurable aspect ratios will also flip, reducing the need for duplication of config
        可配置的纵横比也将翻转,从而减少重复配置的需要
  • Scale to maximum dimension
    缩放到最大尺寸

      • Upon clicking, the width and height will scale according to the configured maximum value
        单击后,宽度和高度将根据配置的最大值进行缩放
      • Aspect ratio will be retained, the smaller or equivalent dimension will be scaled to match
        将保留纵横比,较小或等效的尺寸将缩放以匹配
  • Scale to aspect ratio
    比例与纵横比

      • Upon clicking, the current dimensions will be scaled to the given aspect ratio, using the highest width or height
        单击后,当前尺寸将缩放为给定的纵横比,使用最高宽度或高度

        • i.e 4:3 of 256x512 = 512x384 9:16 of 512x256 = 288x512 1:1 of 256x300 = 300x300
          即 4:3 of 256x512 = 512x384 9:16 of 512x256 = 288x512 1:1 of 256x300 = 300x300
  • You can optionally toggle this to use the "Maximum dimension" slider value
    您可以选择将其切换为使用“最大尺寸”滑块值

        • i.e 4:3 of 512 = 512x384 9:16 of 512 = 288x512 1:1 of 300 = 300x300
          即 4:3 of 512 = 512x384 9:16 of 512 = 288x512 1:1 of 300 = 300x300
  • Scale by percentage  按百分比缩放
  • Upon clicking, the current dimensions will be multiplied by the given percentage, with aspect ratio maintained
    单击后,当前尺寸将乘以给定的百分比,并保持纵横比
      • i.e -25% of 512x256 = 384x192 +50% of 512x512 = 768x768 即 -25% of 512x256 = 384x192 +50% of 512x512 = 768x768
        • You can also change the display of these if you find it more intuitive
          如果您发现这些更直观,您还可以更改这些显示
        • i.e 75% of 512x256 = 384x192 150% of 512x512 = 768x768 即 75% of 512x256 = 384x192 150% of 512x512 = 768x768
        • i.e x0.75 of 512x256 = 384x192 x1.5 of 512x512 = 768x768 即 x0.75 of 512x256 = 384x192 x1.5 of 512x512 = 768x768

Settings 设置

  • Hide accordion by default (False)
    默认隐藏手风琴 ( False )
  • Expand accordion by default (False)
    默认展开手风琴 ( False )

    • Determines whether the 'Aspect Ratio Helper' accordion expands by default
      确定“Aspect Ratio Helper”折叠面板是否默认展开
  • UI Component order (MaxDimensionScaler, PredefinedAspectRatioButtons, PredefinedPercentageButtons)
    UI 组件顺序 ( MaxDimensionScaler, PredefinedAspectRatioButtons, PredefinedPercentageButtons )

    • Determines the order in which the UI components will render
      确定 UI 组件呈现的顺序
  • Enable JavaScript aspect ratio controls
    启用 JavaScript 纵横比控件
  • JavaScript aspect ratio buttons (1:1, 4:3, 16:9, 9:16, 21:9)
    JavaScript 纵横比按钮 (1:1, 4:3, 16:9, 9:16, 21:9)

    • i.e 1:1, 4:3, 16:9, 9:16, 21:9 2:3, 1:5, 3:5 即 1:1, 4:3, 16:9, 9:16, 21:9 2:3, 1:5, 3:5
  • Show maximum dimension button (True)
    显示最大尺寸按钮 ( True )
  • Maximum dimension default (1024)
    最大尺寸默认值 ( 1024 )
  • Show pre-defined aspect ratio buttons (True)
    显示预定义的纵横比按钮 ( True )
  • Use "Maximum dimension" for aspect ratio buttons (False)
    将“最大尺寸”用于宽高比按钮 ( False )
  • Pre-defined aspect ratio buttons (1:1, 4:3, 16:9, 9:16, 21:9)
    预定义的纵横比按钮 ( 1:1, 4:3, 16:9, 9:16, 21:9 )

    • i.e 1:1, 4:3, 16:9, 9:16, 21:9 2:3, 1:5, 3:5 即 1:1, 4:3, 16:9, 9:16, 21:9 2:3, 1:5, 3:5
  • Show pre-defined percentage buttons (True)
    显示预定义的百分比按钮 ( True )
  • Pre-defined percentage buttons (25, 50, 75, 125, 150, 175, 200)
    预定义的百分比按钮 ( 25, 50, 75, 125, 150, 175, 200 )

    • i.e 25, 50, 75, 125, 150, 175, 200 50, 125, 300 即 25, 50, 75, 125, 150, 175, 200 50, 125, 300
  • Pre-defined percentage display format (Incremental/decremental percentage (-50%, +50%))
    预定义的百分比显示格式 ( Incremental/decremental percentage (-50%, +50%) )

    • Incremental/decremental percentage (-50%, +50%)
    • Raw percentage (50%, 150%)
    • Multiplication (x0.5, x1.5)

Dependencies 依赖

使用现有的 AUTOMATIC1111 webui 依赖项开发。

建议使用 A1111 webui 指定的 python 版本。

但是 - 对于运行单元测试,我们使用 pytest。

pip install pytest

Testing 测试

从存储库的根目录。

pytest
(如遇失效,请加v:xkd2310备注SD)
声明:本站所有文章,如无特殊说明或标注,均为本站原创发布。任何个人或组织,在未征得本站同意时,禁止复制、盗用、采集、发布本站内容到任何网站、书籍等各类媒体平台。如若本站内容侵犯了原著者的合法权益,可联系我们进行处理。