mirror of
https://github.com/comfyanonymous/ComfyUI.git
synced 2026-03-06 17:57:40 +08:00
refactor: use AspectRatio enum members as ASPECT_RATIOS dict keys (#12689)
Amp-Thread-ID: https://ampcode.com/threads/T-019ca1cb-0150-7549-8b1b-6713060d3408 Co-authored-by: Jedrzej Kosinski <kosinkadink1@gmail.com>
This commit is contained in:
parent
9d0e114ee3
commit
80d49441e5
@ -16,15 +16,15 @@ class AspectRatio(str, Enum):
|
|||||||
WIDESCREEN_V = "9:16 (Portrait Widescreen)"
|
WIDESCREEN_V = "9:16 (Portrait Widescreen)"
|
||||||
|
|
||||||
|
|
||||||
ASPECT_RATIOS: dict[str, tuple[int, int]] = {
|
ASPECT_RATIOS: dict[AspectRatio, tuple[int, int]] = {
|
||||||
"1:1 (Square)": (1, 1),
|
AspectRatio.SQUARE: (1, 1),
|
||||||
"3:2 (Photo)": (3, 2),
|
AspectRatio.PHOTO_H: (3, 2),
|
||||||
"4:3 (Standard)": (4, 3),
|
AspectRatio.STANDARD_H: (4, 3),
|
||||||
"16:9 (Widescreen)": (16, 9),
|
AspectRatio.WIDESCREEN_H: (16, 9),
|
||||||
"21:9 (Ultrawide)": (21, 9),
|
AspectRatio.ULTRAWIDE_H: (21, 9),
|
||||||
"2:3 (Portrait Photo)": (2, 3),
|
AspectRatio.PHOTO_V: (2, 3),
|
||||||
"3:4 (Portrait Standard)": (3, 4),
|
AspectRatio.STANDARD_V: (3, 4),
|
||||||
"9:16 (Portrait Widescreen)": (9, 16),
|
AspectRatio.WIDESCREEN_V: (9, 16),
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@ -55,8 +55,12 @@ class ResolutionSelector(io.ComfyNode):
|
|||||||
),
|
),
|
||||||
],
|
],
|
||||||
outputs=[
|
outputs=[
|
||||||
io.Int.Output("width", tooltip="Calculated width in pixels (multiple of 8)."),
|
io.Int.Output(
|
||||||
io.Int.Output("height", tooltip="Calculated height in pixels (multiple of 8)."),
|
"width", tooltip="Calculated width in pixels (multiple of 8)."
|
||||||
|
),
|
||||||
|
io.Int.Output(
|
||||||
|
"height", tooltip="Calculated height in pixels (multiple of 8)."
|
||||||
|
),
|
||||||
],
|
],
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user