Compare commits

...

2 Commits

Author SHA1 Message Date
Lincoln Stein
d73f1c363c bump version number 2023-05-01 09:28:49 -04:00
Lincoln Stein
e52e7418bb close #3304 2023-04-29 20:07:21 -04:00
2 changed files with 11 additions and 5 deletions

View File

@@ -1 +1 @@
__version__='2.3.5-rc2'
__version__='2.3.5'

View File

@@ -456,11 +456,8 @@ class LoRA:
class KohyaLoraManager:
lora_path = None
vector_length_cache_path = None
def __init__(self, pipe):
self.lora_path = Path(global_lora_models_dir())
self.vector_length_cache_path = self.lora_path / '.vectorlength.cache'
self.unet = pipe.unet
self.wrapper = LoRAModuleWrapper(pipe.unet, pipe.text_encoder)
@@ -468,6 +465,16 @@ class KohyaLoraManager:
self.device = torch.device(choose_torch_device())
self.dtype = pipe.unet.dtype
@classmethod
@property
def lora_path(cls)->Path:
return Path(global_lora_models_dir())
@classmethod
@property
def vector_length_cache_path(cls)->Path:
return cls.lora_path / '.vectorlength.cache'
def load_lora_module(self, name, path_file, multiplier: float = 1.0):
print(f" | Found lora {name} at {path_file}")
if path_file.suffix == ".safetensors":
@@ -568,7 +575,6 @@ class KohyaLoraManager:
class LoraVectorLengthCache(object):
def __init__(self, cache_path: Path):
self.cache_path = cache_path
print(f'DEBUG: lock path = {Path(cache_path.parent, ".cachelock")}')
self.lock = FileLock(Path(cache_path.parent, ".cachelock"))
self.cache = {}