fix taesd for original backend

This commit is contained in:
Vladimir Mandic
2023-08-06 07:06:58 +00:00
parent a22862d5c6
commit dc739b9f50
5 changed files with 10 additions and 3 deletions
+2
View File
@@ -2,6 +2,8 @@
## Update for 2023-08-05
Another minor update, but it unlocks some cool new items...
- diffusers:
- vaesd live preview (sd and sd-xl)
- fix inpainting (sd and sd-xl)
+1
View File
@@ -1000,4 +1000,5 @@ class Shared(sys.modules[__name__].__class__): # this class is here to provide s
sd_model = None
sd_refiner = None
sd_model_type = ''
sys.modules[__name__].__class__ = Shared
+5 -1
View File
@@ -5,6 +5,7 @@ Tiny AutoEncoder for Stable Diffusion
https://github.com/madebyollin/taesd
"""
import os
from PIL import Image
from modules import devices, paths_internal
from modules.taesd.taesd import TAESD
@@ -42,8 +43,11 @@ def model(model_class = 'sd', model_type = 'decoder'):
def decode(latents):
from modules import shared
model_class = shared.sd_model_type
if model_class == 'ldm':
model_class = 'sd'
if 'sd' not in model_class:
return None
shared.log.warning(f'TAESD unsupported model type: {model_class}')
return Image.new('RGB', (8, 8), color = (0, 0, 0))
vae = taesd_models[f'{model_class}-decoder']
if vae is None:
model_path = os.path.join(paths_internal.models_path, "TAESD", f"tae{model_class}_decoder.pth")