update lora

Signed-off-by: Vladimir Mandic <mandic00@live.com>
This commit is contained in:
Vladimir Mandic
2024-11-30 08:50:25 -05:00
parent 881fa1183c
commit 1e90312982
5 changed files with 41 additions and 23 deletions
+5 -1
View File
@@ -1,4 +1,5 @@
import os
import time
import math
import random
import warnings
@@ -9,7 +10,7 @@ import cv2
from PIL import Image
from skimage import exposure
from blendmodes.blend import blendLayers, BlendType
from modules import shared, devices, images, sd_models, sd_samplers, sd_hijack_hypertile, processing_vae
from modules import shared, devices, images, sd_models, sd_samplers, sd_hijack_hypertile, processing_vae, timer
debug = shared.log.trace if os.environ.get('SD_PROCESS_DEBUG', None) is not None else lambda *args, **kwargs: None
@@ -352,6 +353,7 @@ def img2img_image_conditioning(p, source_image, latent_image, image_mask=None):
def validate_sample(tensor):
t0 = time.time()
if not isinstance(tensor, np.ndarray) and not isinstance(tensor, torch.Tensor):
return tensor
dtype = tensor.dtype
@@ -377,6 +379,8 @@ def validate_sample(tensor):
if upcast is not None and not upcast:
setattr(shared.sd_model.vae.config, 'force_upcast', True) # noqa: B010
shared.log.warning('Decode: upcast=True set, retry operation')
t1 = time.time()
timer.process.add('validate', t1 - t0)
return cast