mirror of
https://github.com/invoke-ai/InvokeAI
synced 2024-08-30 20:32:17 +00:00
fixing aspect ratio on hires
This commit is contained in:
parent
4104ac6270
commit
62412f8398
@ -27,9 +27,8 @@ class Txt2Img2Img(Generator):
|
|||||||
@torch.no_grad()
|
@torch.no_grad()
|
||||||
def make_image(x_T):
|
def make_image(x_T):
|
||||||
|
|
||||||
trained_square = 512 * 512
|
scale_dim = min(width, height)
|
||||||
actual_square = width * height
|
scale = 512 / scale_dim
|
||||||
scale = math.sqrt(trained_square / actual_square)
|
|
||||||
|
|
||||||
init_width = math.ceil(scale * width / 64) * 64
|
init_width = math.ceil(scale * width / 64) * 64
|
||||||
init_height = math.ceil(scale * height / 64) * 64
|
init_height = math.ceil(scale * height / 64) * 64
|
||||||
|
Loading…
Reference in New Issue
Block a user