From be16f33151760ec64fccdf7b245cd0cd11e1000b Mon Sep 17 00:00:00 2001 From: Sean Sube Date: Thu, 19 Jan 2023 22:07:31 -0600 Subject: [PATCH] fix(api): pass txt2img dimensions in correct order --- api/onnx_web/pipeline.py | 6 +++--- api/params.json | 4 ++-- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/api/onnx_web/pipeline.py b/api/onnx_web/pipeline.py index 0d7701e20..58cab46ca 100644 --- a/api/onnx_web/pipeline.py +++ b/api/onnx_web/pipeline.py @@ -37,7 +37,7 @@ def get_latents_from_seed(seed: int, size: Size) -> np.ndarray: From https://www.travelneil.com/stable-diffusion-updates.html ''' # 1 is batch size - latents_shape = (1, 4, size.width // 8, size.height // 8) + latents_shape = (1, 4, size.height // 8, size.width // 8) # Gotta use numpy instead of torch, because torch's randn() doesn't support DML rng = np.random.default_rng(seed) image_latents = rng.standard_normal(latents_shape).astype(np.float32) @@ -92,8 +92,8 @@ def run_txt2img_pipeline( image = pipe( params.prompt, - size.width, - size.height, + height=size.height, + width=size.width, generator=rng, guidance_scale=params.cfg, latents=latents, diff --git a/api/params.json b/api/params.json index b35d21bf6..6d19eea06 100644 --- a/api/params.json +++ b/api/params.json @@ -21,7 +21,7 @@ "height": { "default": 512, "min": 64, - "max": 512, + "max": 1024, "step": 8 }, "model": { @@ -77,7 +77,7 @@ "width": { "default": 512, "min": 64, - "max": 512, + "max": 1024, "step": 8 } } \ No newline at end of file