mirror of
https://github.com/vladmandic/automatic
synced 2026-09-19 09:14:35 +02:00
persist control units state on restarts
This commit is contained in:
@@ -74,7 +74,7 @@ class ControlNetXS():
|
||||
self.model = None
|
||||
self.model_id = None
|
||||
|
||||
def load(self, model_id: str = None, time_embedding_mix: float = 0.0) -> str:
|
||||
def load(self, model_id: str = None, time_embedding_mix: float = 0.0, force: bool = True) -> str:
|
||||
try:
|
||||
t0 = time.time()
|
||||
model_id = model_id or self.model_id
|
||||
@@ -90,6 +90,9 @@ class ControlNetXS():
|
||||
if model_path is None:
|
||||
log.error(f'Control {what} model load failed: id="{model_id}" error=unknown model id')
|
||||
return
|
||||
if model_id == self.model_id and not force:
|
||||
log.debug(f'Control {what} model: id="{model_id}" path="{model_path}" already loaded')
|
||||
return
|
||||
self.load_config['time_embedding_mix'] = time_embedding_mix
|
||||
log.debug(f'Control {what} model loading: id="{model_id}" path="{model_path}" {self.load_config}')
|
||||
if model_path.endswith('.safetensors'):
|
||||
|
||||
Reference in New Issue
Block a user