sdwebui-w-horde / sd-webui-stable-horde-worker

Stable Horde Unofficial Worker Bridge as Stable Diffusion WebUI (AUTOMATIC1111) Extension
GNU Affero General Public License v3.0
60 stars 19 forks source link

feat: add hires fix feature #78

Closed prodigy closed 1 year ago

prodigy commented 1 year ago

Description

Implemented hires_fix feature. Calculates the hires firstphase dimensions by taking into account the requested target width and height and calculating it down to a configurable value. 512 is the default. No UI support for configuring yet.

close #69

Type of changes

Please check the following items before submitting your pull request

prodigy commented 1 year ago

As commit 6b1c59577ddd12842dc8deb1ee7fbc5931d7d49e already claims to add clip skip support, I set the version to 4 for the horde to recognize the new feature set. I didn't update the docs on clip skip though.

MaikoTan commented 1 year ago

:tada: Thanks for your contribution ! :tada:


In sd-webui, there is an "old way" and a "new way" to do the hires fix work. The old way is to generate a smaller one first, and then upscale it to the desired size. The new way is to generate the given size first, and then upscale it by a specified multiplier.

If I am not misunderstanding, it looks like your code only handles the "old way", which should be manually enabled by the user: image

prodigy commented 1 year ago

~You are totally right, I changed it to use the scaler method. Also it is possible to configure the upscaler now, as I had problems using "Latent" with exceptions being thrown. I changed it to "Lanczos" for my configuration. Maybe we need to discuss the default value here?~

I have to correct: I used the calculation method as the horde only sends the requested FINAL resolution, not the initial rendering resolution. We have to calculate the initial resolution on our own.

MaikoTan commented 1 year ago

Ah, okay. Sorry for the misunderstanding.