--sd-webui-ar-plus icon indicating copy to clipboard operation
--sd-webui-ar-plus copied to clipboard

The Calculated Dimensions are not ideal

Open altoiddealer opened this issue 4 months ago • 14 comments

Hello, thank you for this great extension.

I should probably revise this to say "the calculated dimension" in the singular, because it seems to only calculate one dimension based on the other.

Screenshot 2024-03-10 101708

Ideally, though, both dimensions would be calculated simultaneously in the same method that Stable Swarm calculates - see ResToModelFit()

The values that your extension sets right now are not the sizes that the base models and most finetunes are trained on.

In a nutshell: -The model's 'base res' (ei: 1024) is considered the median value, and the height/width are offset proportionately. -The values are rounded to the nearest multiple of 64.

I spent a bit of time implementing the identical logic in my discord bot (see **update_size_option() section) for it to calculate all the different sizes for my /image command.

Screenshot 2024-03-10 100718

They are calculated dynamically using the same calculation. However, all the models in Stable Swarm correctly include their base resolution in the metadata, so their function is always predictable and successful. The majority of models on Civitai do not include the intended base resolution in the metadata.

My script assumes the "base resolution" as determined as the current base (Height + Width /2) - whatever these user settings may be.

This is how I recommend your extension should use as the input value - the sum of whatever the current Width/Height values are divided by 2.

I recommend that you consider implementing this approach, if possible!

altoiddealer avatar Mar 10 '24 14:03 altoiddealer