AUTOMATIC1111 / stable-diffusion-webui

Stable Diffusion web UI
GNU Affero General Public License v3.0
141.75k stars 26.78k forks source link

[Feature Request]: Make 1024x1024 resolution the default setting in the UI when SDXL model is loaded #13181

Closed Nekos4Lyfe closed 1 year ago

Nekos4Lyfe commented 1 year ago

What would your feature do ?

SDXL is not trained for 512x512 resolution , so whenever I use an SDXL model on A1111 I have to manually change it to 1024x1024 (or other trained resolutions) before generating.

This adds a fair bit of tedium to the generation session. I would prefer that the default resolution was set to 1024x1024 when an SDXL model is loaded.

Proposed workflow

In stable-diffusion-webui / modules /ui.py:

from shared import sd_model val = 512 if sd_model.is_sdxl : val = 1024

...

width = gr.Slider(minimum=64, maximum=2048, step=8, label="Width", value=val, elem_id="txt2img_width") height = gr.Slider(minimum=64, maximum=2048, step=8, label="Height", value=val, elem_id="txt2img_height")

TLDR: If SDXL model is loaded => set initial value for image width and height sliders to 1024x1024

Is there an existing issue for this?

alexbofa commented 1 year ago

Hello, use sd-webui-ar-plus or you can change default config in ui-config.json

    "txt2img/Width/value": 1024,
    "txt2img/Height/value": 1024,
    "img2img/Width/value": 1024,
    "img2img/Height/value": 1024,
Nekos4Lyfe commented 1 year ago

Thanks. The information is helpful.

Still, it would be nice to (optionally) have one set of configs that are only enabled when an SDXL model is loaded upon UI start.

My work process is usually load either SD1.5 or SDXL in UI , run the UI , do some tests , close the UI.

I don't want to have to change configurations when I change the model if this can be done automatically. Doesn't have to be fancy.

Building upon your suggestion : I'm thinking just a ui-config-sdxl.json script with NoneType values.

Upon loading an SDXL model , if there is a value for a setting in the ui-config-sdxl.json script that isn't NoneType , then that setting will overwrite the existing setting in the ui-config.json script. Would that work?

alexbofa commented 1 year ago

There is still such an extension config-preset only there is no automatic switching, but you can write to the developer about such a proposal

Your suggestion for automation, as it seems to me, as the main function, it makes the performance of Stable Diffusion very heavy.

Although your suggestion suggested that if SDXL is enabled, then the Refiner tab appears, and if 1.5, then this tab disappears

Nekos4Lyfe commented 1 year ago

Ok I'll give it a go. Thanks.

gwillen commented 3 months ago

I am not the OP, but I am only just now discovering that it's apparently a well-known fact that SDXL produces garbage at the default resolution, and you have to manually set it to 1024x1024 to get output that isn't garbage. That's... really quite unfriendly to the novice user. (I had no idea how SDXL was trained until now.) I have been trying to figure out for a few days, since I installed webui, why SDXL doesn't work at all.