fix vae upscale

This commit is contained in:
Vladimir Mandic
2023-09-14 15:28:38 -04:00
parent ef51f55026
commit 9d85a9702b
3 changed files with 8 additions and 4 deletions
+1 -3
View File
@@ -3,7 +3,7 @@
## Update for 2023-09-13
Started as a mostly a service release with quite a few fixes, but then...
Major changes how **hires** works as well as support for a very interesting new model [wuerstchen](https://huggingface.co/blog/wuertschen)
Major changes how **hires** works as well as support for a very interesting new model [Wuerstchen](https://huggingface.co/blog/wuertschen)
- tons of fixes
- changes to **hires**
@@ -46,8 +46,6 @@ Major changes how **hires** works as well as support for a very interesting new
- cleaner server restart
- custom exception handling
Note: **wuerstchen** is pending critical bugfix in `diffusers=0.21.1`
## Update for 2023-09-06
One week later, another large update!
+6
View File
@@ -77,6 +77,12 @@ def process_diffusers(p: StableDiffusionProcessing, seeds, prompts, negative_pro
if not shared.cmd_opts.lowvram and not shared.opts.diffusers_seq_cpu_offload:
model.vae.to(devices.device)
latents.to(model.vae.device)
needs_upcasting = model.vae.dtype == torch.float16 and model.vae.config.force_upcast
if needs_upcasting: # this is done by diffusers automatically if output_type != 'latent'
model.upcast_vae()
latents = latents.to(next(iter(model.vae.post_quant_conv.parameters())).dtype)
decoded = model.vae.decode(latents / model.vae.config.scaling_factor, return_dict=False)[0]
if shared.opts.diffusers_move_unet and not model.has_accelerate:
model.unet.to(unet_device)
+1 -1
View File
@@ -47,7 +47,7 @@ requests==2.31.0
tqdm==4.66.1
accelerate==0.20.3
opencv-python-headless==4.7.0.72
diffusers==0.20.2
diffusers==0.21.1
einops==0.4.1
gradio==3.43.2
huggingface_hub==0.17.1