38 lines
1.4 KiB
Python
38 lines
1.4 KiB
Python
"""Per-model resolution presets.
|
|
|
|
Kept in its own module, imported last, so its widget is appended after every
|
|
existing widget and saved workflows keep their widget order.
|
|
"""
|
|
|
|
from .. import op
|
|
|
|
|
|
_MODEL_RESOLUTIONS = {
|
|
"SD 1.5 — 512x512": (512, 512),
|
|
"Qwen-Image — 1:1 1328x1328": (1328, 1328),
|
|
"Qwen-Image — 16:9 1664x928": (1664, 928),
|
|
"Qwen-Image — 9:16 928x1664": (928, 1664),
|
|
"Qwen-Image — 4:3 1472x1104": (1472, 1104),
|
|
"Qwen-Image — 3:4 1104x1472": (1104, 1472),
|
|
"Qwen-Image — 3:2 1584x1056": (1584, 1056),
|
|
"Qwen-Image — 2:3 1056x1584": (1056, 1584),
|
|
"Wan 2.1 / 2.2 14B — 720P 1280x720": (1280, 720),
|
|
"Wan 2.2 TI2V-5B — 720P 1280x704": (1280, 704),
|
|
"Wan 2.2 TI2V-5B — 720P portrait 704x1280": (704, 1280),
|
|
}
|
|
|
|
|
|
@op(
|
|
op_id="model_resolution_pick",
|
|
display_name="Model Resolution Pick (SD 1.5 / Qwen-Image / Wan)",
|
|
category="Resolution",
|
|
input_schema={"required": {
|
|
"model_preset": (list(_MODEL_RESOLUTIONS.keys()), {"default": "Qwen-Image — 1:1 1328x1328"}),
|
|
}},
|
|
output_indices=(5, 6, 8),
|
|
description="Width/height the model's authors list as supported: SD 1.5 training size, Qwen-Image aspect ratios, Wan 2.1/2.2 14B and TI2V-5B 720P sizes.",
|
|
)
|
|
def model_resolution_pick(self, model_preset):
|
|
w, h = _MODEL_RESOLUTIONS[model_preset]
|
|
return (w, h, {"preset": model_preset, "width": w, "height": h})
|