Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add Size as an XYZ Grid option #15354

Merged
merged 1 commit into from
Mar 24, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 12 additions & 0 deletions scripts/xyz_grid.py
Original file line number Diff line number Diff line change
Expand Up @@ -106,6 +106,17 @@ def apply_upscale_latent_space(p, x, xs):
opts.data["use_scale_latent_for_hires_fix"] = False


def apply_size(p, x: str, xs) -> None:
try:
width, _, height = x.partition('x')
width = int(width.strip())
height = int(height.strip())
p.width = width
p.height = height
except ValueError:
print(f"Invalid size in XYZ plot: {x}")


def find_vae(name: str):
if name.lower() in ['auto', 'automatic']:
return modules.sd_vae.unspecified
Expand Down Expand Up @@ -271,6 +282,7 @@ def __init__(self, *args, **kwargs):
AxisOption("Refiner switch at", float, apply_field('refiner_switch_at')),
AxisOption("RNG source", str, apply_override("randn_source"), choices=lambda: ["GPU", "CPU", "NV"]),
AxisOption("FP8 mode", str, apply_override("fp8_storage"), cost=0.9, choices=lambda: ["Disable", "Enable for SDXL", "Enable"]),
AxisOption("Size", str, apply_size),
]


Expand Down