From 1139541b553d398dc080ddfd0d13045669853455 Mon Sep 17 00:00:00 2001 From: Volpeon Date: Sat, 4 Mar 2023 09:58:36 +0100 Subject: Update --- pipelines/stable_diffusion/vlpn_stable_diffusion.py | 11 ++--------- 1 file changed, 2 insertions(+), 9 deletions(-) (limited to 'pipelines/stable_diffusion') diff --git a/pipelines/stable_diffusion/vlpn_stable_diffusion.py b/pipelines/stable_diffusion/vlpn_stable_diffusion.py index a6b31d8..f02dd72 100644 --- a/pipelines/stable_diffusion/vlpn_stable_diffusion.py +++ b/pipelines/stable_diffusion/vlpn_stable_diffusion.py @@ -307,17 +307,10 @@ class VlpnStableDiffusion(DiffusionPipeline): return timesteps, num_inference_steps - t_start def prepare_image(self, batch_size, width, height, dtype, device, generator=None): - max = 0.4 - offset = max * (2 * torch.rand( - (batch_size, 1, 1, 1), - dtype=dtype, - device=device, - generator=generator - ) - 1) noise = perlin_noise( - batch_size, width, height, res=3, octaves=3, generator=generator, dtype=dtype, device=device + batch_size, width, height, res=1, octaves=4, generator=generator, dtype=dtype, device=device ).expand(batch_size, 3, width, height) - return ((1 + max) * noise + max * offset).clamp(-1, 1) + return (1.4 * noise).clamp(-1, 1) def prepare_latents(self, init_image, timestep, batch_size, dtype, device, generator=None): init_image = init_image.to(device=device, dtype=dtype) -- cgit v1.2.3-70-g09d2