1
0
Fork 0

fix(api): generate correct latents for non-square images

This commit is contained in:
Sean Sube 2023-01-19 22:00:58 -06:00
parent 0afd25f25b
commit 86fb2ae28e
1 changed files with 1 additions and 1 deletions

View File

@ -37,7 +37,7 @@ def get_latents_from_seed(seed: int, size: Size) -> np.ndarray:
From https://www.travelneil.com/stable-diffusion-updates.html From https://www.travelneil.com/stable-diffusion-updates.html
''' '''
# 1 is batch size # 1 is batch size
latents_shape = (1, 4, size.height // 8, size.width // 8) latents_shape = (1, 4, size.width // 8, size.height // 8)
# Gotta use numpy instead of torch, because torch's randn() doesn't support DML # Gotta use numpy instead of torch, because torch's randn() doesn't support DML
rng = np.random.default_rng(seed) rng = np.random.default_rng(seed)
image_latents = rng.standard_normal(latents_shape).astype(np.float32) image_latents = rng.standard_normal(latents_shape).astype(np.float32)