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

[Feature Request]: can you add width and height options to plotxy script #5989

Closed
1 task done
falon-go-weeee opened this issue Dec 24, 2022 · 4 comments
Closed
1 task done
Labels
enhancement New feature or request

Comments

@falon-go-weeee
Copy link

Is there an existing issue for this?

  • I have searched the existing issues and checked the recent builds/commits

What would your feature do ?

Each model behaves uniquely when we use different aspect ratios and resolutions. so it will be extremely beneficial to check a model's behavior.

Proposed workflow

  1. Go to .... Plotxy script
  2. select height/width from Xtype/Ytype
  3. enter the set of resolutions.
  4. Generate

Additional information

No response

@ClashSAN
Copy link
Collaborator

they may be a couple of scripts / extensions that could do this, check the wiki section. xy script is just another of those scripts that come with the repo, and are likely not top priority

@mezotaken mezotaken added the enhancement New feature or request label Jan 12, 2023
@LanceGao97
Copy link

I want that function too, for high res fix, if high res is too high, the image looks crape, I want pick the highest resolution it can produce.

@disposabletiger
Copy link

Doing a pretty hacky version of this is straightforward. In webui\scripts\xyz_grid.py, add this near the top with the other apply defs:

def apply_size():
    def fun(p, x, xs):
        setattr(p, 'width', int(x.split('x')[0]))
        setattr(p, 'height', int(x.split('x')[1]))

    return fun

then around line 225, add:

    AxisOption("Image Width", int, apply_field("width")),
    AxisOption("Image Height", int, apply_field("height")),
    AxisOption("Image Size", str, apply_size()),

Restart webui. This allows height and width to be specified separately, or overall size in the form <w>x<h> i.e. 832x1088.

Grids don't adjust to images with multiple sizes, they use the first image's size as the cell size. So to get a proper grid out of this, where nothing is cut off, you need to make sure the largest image is the first one generated (i.e. enter sizes in reverse order). There are improvements that could be made to this, notably that and also centering images within oversized grid cells/using a white background, but this will do for quick size comparisons.

@catboxanon
Copy link
Collaborator

Implemented in #15354

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

6 participants