InvokeAI 6.10.0__py3-none-any.whl → 6.10.0rc2__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- invokeai/app/invocations/metadata_linked.py +0 -47
- invokeai/app/invocations/z_image_denoise.py +3 -8
- invokeai/app/services/config/config_default.py +1 -3
- invokeai/app/services/model_manager/model_manager_default.py +0 -7
- invokeai/backend/model_manager/load/load_default.py +1 -0
- invokeai/backend/model_manager/load/model_cache/model_cache.py +2 -104
- invokeai/backend/model_manager/load/model_loaders/stable_diffusion.py +1 -0
- invokeai/frontend/web/dist/assets/{App-BBELGD-n.js → App-DllqPQ3j.js} +37 -37
- invokeai/frontend/web/dist/assets/{browser-ponyfill-4xPFTMT3.js → browser-ponyfill-BP0RxJ4G.js} +1 -1
- invokeai/frontend/web/dist/assets/{index-vCDSQboA.js → index-B44qKjrs.js} +3 -3
- invokeai/frontend/web/dist/index.html +1 -1
- invokeai/version/invokeai_version.py +1 -1
- {invokeai-6.10.0.dist-info → invokeai-6.10.0rc2.dist-info}/METADATA +1 -1
- {invokeai-6.10.0.dist-info → invokeai-6.10.0rc2.dist-info}/RECORD +20 -20
- {invokeai-6.10.0.dist-info → invokeai-6.10.0rc2.dist-info}/WHEEL +0 -0
- {invokeai-6.10.0.dist-info → invokeai-6.10.0rc2.dist-info}/entry_points.txt +0 -0
- {invokeai-6.10.0.dist-info → invokeai-6.10.0rc2.dist-info}/licenses/LICENSE +0 -0
- {invokeai-6.10.0.dist-info → invokeai-6.10.0rc2.dist-info}/licenses/LICENSE-SD1+SD2.txt +0 -0
- {invokeai-6.10.0.dist-info → invokeai-6.10.0rc2.dist-info}/licenses/LICENSE-SDXL.txt +0 -0
- {invokeai-6.10.0.dist-info → invokeai-6.10.0rc2.dist-info}/top_level.txt +0 -0
|
@@ -52,7 +52,6 @@ from invokeai.app.invocations.primitives import (
|
|
|
52
52
|
)
|
|
53
53
|
from invokeai.app.invocations.scheduler import SchedulerOutput
|
|
54
54
|
from invokeai.app.invocations.t2i_adapter import T2IAdapterField, T2IAdapterInvocation
|
|
55
|
-
from invokeai.app.invocations.z_image_denoise import ZImageDenoiseInvocation
|
|
56
55
|
from invokeai.app.services.shared.invocation_context import InvocationContext
|
|
57
56
|
from invokeai.backend.model_manager.taxonomy import BaseModelType, ModelType, SubModelType
|
|
58
57
|
from invokeai.backend.stable_diffusion.schedulers.schedulers import SCHEDULER_NAME_VALUES
|
|
@@ -730,52 +729,6 @@ class FluxDenoiseLatentsMetaInvocation(FluxDenoiseInvocation, WithMetadata):
|
|
|
730
729
|
return LatentsMetaOutput(**params, metadata=MetadataField.model_validate(md))
|
|
731
730
|
|
|
732
731
|
|
|
733
|
-
@invocation(
|
|
734
|
-
"z_image_denoise_meta",
|
|
735
|
-
title=f"{ZImageDenoiseInvocation.UIConfig.title} + Metadata",
|
|
736
|
-
tags=["z-image", "latents", "denoise", "txt2img", "t2i", "t2l", "img2img", "i2i", "l2l"],
|
|
737
|
-
category="latents",
|
|
738
|
-
version="1.0.0",
|
|
739
|
-
)
|
|
740
|
-
class ZImageDenoiseMetaInvocation(ZImageDenoiseInvocation, WithMetadata):
|
|
741
|
-
"""Run denoising process with a Z-Image transformer model + metadata."""
|
|
742
|
-
|
|
743
|
-
def invoke(self, context: InvocationContext) -> LatentsMetaOutput:
|
|
744
|
-
def _loras_to_json(obj: Union[Any, list[Any]]):
|
|
745
|
-
if not isinstance(obj, list):
|
|
746
|
-
obj = [obj]
|
|
747
|
-
|
|
748
|
-
output: list[dict[str, Any]] = []
|
|
749
|
-
for item in obj:
|
|
750
|
-
output.append(
|
|
751
|
-
LoRAMetadataField(
|
|
752
|
-
model=item.lora,
|
|
753
|
-
weight=item.weight,
|
|
754
|
-
).model_dump(exclude_none=True, exclude={"id", "type", "is_intermediate", "use_cache"})
|
|
755
|
-
)
|
|
756
|
-
return output
|
|
757
|
-
|
|
758
|
-
obj = super().invoke(context)
|
|
759
|
-
|
|
760
|
-
md: Dict[str, Any] = {} if self.metadata is None else self.metadata.root
|
|
761
|
-
md.update({"width": obj.width})
|
|
762
|
-
md.update({"height": obj.height})
|
|
763
|
-
md.update({"steps": self.steps})
|
|
764
|
-
md.update({"guidance": self.guidance_scale})
|
|
765
|
-
md.update({"denoising_start": self.denoising_start})
|
|
766
|
-
md.update({"denoising_end": self.denoising_end})
|
|
767
|
-
md.update({"scheduler": self.scheduler})
|
|
768
|
-
md.update({"model": self.transformer.transformer})
|
|
769
|
-
md.update({"seed": self.seed})
|
|
770
|
-
if len(self.transformer.loras) > 0:
|
|
771
|
-
md.update({"loras": _loras_to_json(self.transformer.loras)})
|
|
772
|
-
|
|
773
|
-
params = obj.__dict__.copy()
|
|
774
|
-
del params["type"]
|
|
775
|
-
|
|
776
|
-
return LatentsMetaOutput(**params, metadata=MetadataField.model_validate(md))
|
|
777
|
-
|
|
778
|
-
|
|
779
732
|
@invocation(
|
|
780
733
|
"metadata_to_vae",
|
|
781
734
|
title="Metadata To VAE",
|
|
@@ -50,7 +50,7 @@ from invokeai.backend.z_image.z_image_transformer_patch import patch_transformer
|
|
|
50
50
|
title="Denoise - Z-Image",
|
|
51
51
|
tags=["image", "z-image"],
|
|
52
52
|
category="image",
|
|
53
|
-
version="1.
|
|
53
|
+
version="1.3.0",
|
|
54
54
|
classification=Classification.Prototype,
|
|
55
55
|
)
|
|
56
56
|
class ZImageDenoiseInvocation(BaseInvocation):
|
|
@@ -69,7 +69,6 @@ class ZImageDenoiseInvocation(BaseInvocation):
|
|
|
69
69
|
)
|
|
70
70
|
denoising_start: float = InputField(default=0.0, ge=0, le=1, description=FieldDescriptions.denoising_start)
|
|
71
71
|
denoising_end: float = InputField(default=1.0, ge=0, le=1, description=FieldDescriptions.denoising_end)
|
|
72
|
-
add_noise: bool = InputField(default=True, description="Add noise based on denoising start.")
|
|
73
72
|
transformer: TransformerField = InputField(
|
|
74
73
|
description=FieldDescriptions.z_image_model, input=Input.Connection, title="Transformer"
|
|
75
74
|
)
|
|
@@ -348,12 +347,8 @@ class ZImageDenoiseInvocation(BaseInvocation):
|
|
|
348
347
|
|
|
349
348
|
# Prepare input latent image
|
|
350
349
|
if init_latents is not None:
|
|
351
|
-
|
|
352
|
-
|
|
353
|
-
s_0 = sigmas[0]
|
|
354
|
-
latents = s_0 * noise + (1.0 - s_0) * init_latents
|
|
355
|
-
else:
|
|
356
|
-
latents = init_latents
|
|
350
|
+
s_0 = sigmas[0]
|
|
351
|
+
latents = s_0 * noise + (1.0 - s_0) * init_latents
|
|
357
352
|
else:
|
|
358
353
|
if self.denoising_start > 1e-5:
|
|
359
354
|
raise ValueError("denoising_start should be 0 when initial latents are not provided.")
|
|
@@ -85,7 +85,6 @@ class InvokeAIAppConfig(BaseSettings):
|
|
|
85
85
|
max_cache_ram_gb: The maximum amount of CPU RAM to use for model caching in GB. If unset, the limit will be configured based on the available RAM. In most cases, it is recommended to leave this unset.
|
|
86
86
|
max_cache_vram_gb: The amount of VRAM to use for model caching in GB. If unset, the limit will be configured based on the available VRAM and the device_working_mem_gb. In most cases, it is recommended to leave this unset.
|
|
87
87
|
log_memory_usage: If True, a memory snapshot will be captured before and after every model cache operation, and the result will be logged (at debug level). There is a time cost to capturing the memory snapshots, so it is recommended to only enable this feature if you are actively inspecting the model cache's behaviour.
|
|
88
|
-
model_cache_keep_alive_min: How long to keep models in cache after last use, in minutes. A value of 0 (the default) means models are kept in cache indefinitely. If no model generations occur within the timeout period, the model cache is cleared using the same logic as the 'Clear Model Cache' button.
|
|
89
88
|
device_working_mem_gb: The amount of working memory to keep available on the compute device (in GB). Has no effect if running on CPU. If you are experiencing OOM errors, try increasing this value.
|
|
90
89
|
enable_partial_loading: Enable partial loading of models. This enables models to run with reduced VRAM requirements (at the cost of slower speed) by streaming the model from RAM to VRAM as its used. In some edge cases, partial loading can cause models to run more slowly if they were previously being fully loaded into VRAM.
|
|
91
90
|
keep_ram_copy_of_weights: Whether to keep a full RAM copy of a model's weights when the model is loaded in VRAM. Keeping a RAM copy increases average RAM usage, but speeds up model switching and LoRA patching (assuming there is sufficient RAM). Set this to False if RAM pressure is consistently high.
|
|
@@ -166,10 +165,9 @@ class InvokeAIAppConfig(BaseSettings):
|
|
|
166
165
|
max_cache_ram_gb: Optional[float] = Field(default=None, gt=0, description="The maximum amount of CPU RAM to use for model caching in GB. If unset, the limit will be configured based on the available RAM. In most cases, it is recommended to leave this unset.")
|
|
167
166
|
max_cache_vram_gb: Optional[float] = Field(default=None, ge=0, description="The amount of VRAM to use for model caching in GB. If unset, the limit will be configured based on the available VRAM and the device_working_mem_gb. In most cases, it is recommended to leave this unset.")
|
|
168
167
|
log_memory_usage: bool = Field(default=False, description="If True, a memory snapshot will be captured before and after every model cache operation, and the result will be logged (at debug level). There is a time cost to capturing the memory snapshots, so it is recommended to only enable this feature if you are actively inspecting the model cache's behaviour.")
|
|
169
|
-
model_cache_keep_alive_min: float = Field(default=0, ge=0, description="How long to keep models in cache after last use, in minutes. A value of 0 (the default) means models are kept in cache indefinitely. If no model generations occur within the timeout period, the model cache is cleared using the same logic as the 'Clear Model Cache' button.")
|
|
170
168
|
device_working_mem_gb: float = Field(default=3, description="The amount of working memory to keep available on the compute device (in GB). Has no effect if running on CPU. If you are experiencing OOM errors, try increasing this value.")
|
|
171
169
|
enable_partial_loading: bool = Field(default=False, description="Enable partial loading of models. This enables models to run with reduced VRAM requirements (at the cost of slower speed) by streaming the model from RAM to VRAM as its used. In some edge cases, partial loading can cause models to run more slowly if they were previously being fully loaded into VRAM.")
|
|
172
|
-
keep_ram_copy_of_weights: bool = Field(default=True,
|
|
170
|
+
keep_ram_copy_of_weights: bool = Field(default=True, description="Whether to keep a full RAM copy of a model's weights when the model is loaded in VRAM. Keeping a RAM copy increases average RAM usage, but speeds up model switching and LoRA patching (assuming there is sufficient RAM). Set this to False if RAM pressure is consistently high.")
|
|
173
171
|
# Deprecated CACHE configs
|
|
174
172
|
ram: Optional[float] = Field(default=None, gt=0, description="DEPRECATED: This setting is no longer used. It has been replaced by `max_cache_ram_gb`, but most users will not need to use this config since automatic cache size limits should work well in most cases. This config setting will be removed once the new model cache behavior is stable.")
|
|
175
173
|
vram: Optional[float] = Field(default=None, ge=0, description="DEPRECATED: This setting is no longer used. It has been replaced by `max_cache_vram_gb`, but most users will not need to use this config since automatic cache size limits should work well in most cases. This config setting will be removed once the new model cache behavior is stable.")
|
|
@@ -60,10 +60,6 @@ class ModelManagerService(ModelManagerServiceBase):
|
|
|
60
60
|
service.start(invoker)
|
|
61
61
|
|
|
62
62
|
def stop(self, invoker: Invoker) -> None:
|
|
63
|
-
# Shutdown the model cache to cancel any pending timers
|
|
64
|
-
if hasattr(self._load, "ram_cache"):
|
|
65
|
-
self._load.ram_cache.shutdown()
|
|
66
|
-
|
|
67
63
|
for service in [self._store, self._install, self._load]:
|
|
68
64
|
if hasattr(service, "stop"):
|
|
69
65
|
service.stop(invoker)
|
|
@@ -92,10 +88,7 @@ class ModelManagerService(ModelManagerServiceBase):
|
|
|
92
88
|
max_ram_cache_size_gb=app_config.max_cache_ram_gb,
|
|
93
89
|
max_vram_cache_size_gb=app_config.max_cache_vram_gb,
|
|
94
90
|
execution_device=execution_device or TorchDevice.choose_torch_device(),
|
|
95
|
-
storage_device="cpu",
|
|
96
|
-
log_memory_usage=app_config.log_memory_usage,
|
|
97
91
|
logger=logger,
|
|
98
|
-
keep_alive_minutes=app_config.model_cache_keep_alive_min,
|
|
99
92
|
)
|
|
100
93
|
loader = ModelLoadService(
|
|
101
94
|
app_config=app_config,
|
|
@@ -75,6 +75,7 @@ class ModelLoader(ModelLoaderBase):
|
|
|
75
75
|
|
|
76
76
|
config.path = str(self._get_model_path(config))
|
|
77
77
|
self._ram_cache.make_room(self.get_size_fs(config, Path(config.path), submodel_type))
|
|
78
|
+
self._logger.info(f"Loading model '{stats_name}' into RAM cache..., config={config}")
|
|
78
79
|
loaded_model = self._load_model(config, submodel_type)
|
|
79
80
|
|
|
80
81
|
self._ram_cache.put(
|
|
@@ -55,21 +55,6 @@ def synchronized(method: Callable[..., Any]) -> Callable[..., Any]:
|
|
|
55
55
|
return wrapper
|
|
56
56
|
|
|
57
57
|
|
|
58
|
-
def record_activity(method: Callable[..., Any]) -> Callable[..., Any]:
|
|
59
|
-
"""A decorator that records activity after a method completes successfully.
|
|
60
|
-
|
|
61
|
-
Note: This decorator should be applied to methods that already hold self._lock.
|
|
62
|
-
"""
|
|
63
|
-
|
|
64
|
-
@wraps(method)
|
|
65
|
-
def wrapper(self, *args, **kwargs):
|
|
66
|
-
result = method(self, *args, **kwargs)
|
|
67
|
-
self._record_activity()
|
|
68
|
-
return result
|
|
69
|
-
|
|
70
|
-
return wrapper
|
|
71
|
-
|
|
72
|
-
|
|
73
58
|
@dataclass
|
|
74
59
|
class CacheEntrySnapshot:
|
|
75
60
|
cache_key: str
|
|
@@ -147,7 +132,6 @@ class ModelCache:
|
|
|
147
132
|
storage_device: torch.device | str = "cpu",
|
|
148
133
|
log_memory_usage: bool = False,
|
|
149
134
|
logger: Optional[Logger] = None,
|
|
150
|
-
keep_alive_minutes: float = 0,
|
|
151
135
|
):
|
|
152
136
|
"""Initialize the model RAM cache.
|
|
153
137
|
|
|
@@ -167,7 +151,6 @@ class ModelCache:
|
|
|
167
151
|
snapshots, so it is recommended to disable this feature unless you are actively inspecting the model cache's
|
|
168
152
|
behaviour.
|
|
169
153
|
:param logger: InvokeAILogger to use (otherwise creates one)
|
|
170
|
-
:param keep_alive_minutes: How long to keep models in cache after last use (in minutes). 0 means keep indefinitely.
|
|
171
154
|
"""
|
|
172
155
|
self._enable_partial_loading = enable_partial_loading
|
|
173
156
|
self._keep_ram_copy_of_weights = keep_ram_copy_of_weights
|
|
@@ -199,12 +182,6 @@ class ModelCache:
|
|
|
199
182
|
self._on_cache_miss_callbacks: set[CacheMissCallback] = set()
|
|
200
183
|
self._on_cache_models_cleared_callbacks: set[CacheModelsClearedCallback] = set()
|
|
201
184
|
|
|
202
|
-
# Keep-alive timeout support
|
|
203
|
-
self._keep_alive_minutes = keep_alive_minutes
|
|
204
|
-
self._last_activity_time: Optional[float] = None
|
|
205
|
-
self._timeout_timer: Optional[threading.Timer] = None
|
|
206
|
-
self._shutdown_event = threading.Event()
|
|
207
|
-
|
|
208
185
|
def on_cache_hit(self, cb: CacheHitCallback) -> Callable[[], None]:
|
|
209
186
|
self._on_cache_hit_callbacks.add(cb)
|
|
210
187
|
|
|
@@ -213,7 +190,7 @@ class ModelCache:
|
|
|
213
190
|
|
|
214
191
|
return unsubscribe
|
|
215
192
|
|
|
216
|
-
def on_cache_miss(self, cb:
|
|
193
|
+
def on_cache_miss(self, cb: CacheHitCallback) -> Callable[[], None]:
|
|
217
194
|
self._on_cache_miss_callbacks.add(cb)
|
|
218
195
|
|
|
219
196
|
def unsubscribe() -> None:
|
|
@@ -241,78 +218,7 @@ class ModelCache:
|
|
|
241
218
|
"""Set the CacheStats object for collecting cache statistics."""
|
|
242
219
|
self._stats = stats
|
|
243
220
|
|
|
244
|
-
def _record_activity(self) -> None:
|
|
245
|
-
"""Record model activity and reset the timeout timer if configured.
|
|
246
|
-
|
|
247
|
-
Note: This method should only be called when self._lock is already held.
|
|
248
|
-
"""
|
|
249
|
-
if self._keep_alive_minutes <= 0:
|
|
250
|
-
return
|
|
251
|
-
|
|
252
|
-
self._last_activity_time = time.time()
|
|
253
|
-
|
|
254
|
-
# Cancel any existing timer
|
|
255
|
-
if self._timeout_timer is not None:
|
|
256
|
-
self._timeout_timer.cancel()
|
|
257
|
-
|
|
258
|
-
# Start a new timer
|
|
259
|
-
timeout_seconds = self._keep_alive_minutes * 60
|
|
260
|
-
self._timeout_timer = threading.Timer(timeout_seconds, self._on_timeout)
|
|
261
|
-
# Set as daemon so it doesn't prevent application shutdown
|
|
262
|
-
self._timeout_timer.daemon = True
|
|
263
|
-
self._timeout_timer.start()
|
|
264
|
-
self._logger.debug(f"Model cache activity recorded. Timeout set to {self._keep_alive_minutes} minutes.")
|
|
265
|
-
|
|
266
221
|
@synchronized
|
|
267
|
-
@record_activity
|
|
268
|
-
def _on_timeout(self) -> None:
|
|
269
|
-
"""Called when the keep-alive timeout expires. Clears the model cache."""
|
|
270
|
-
if self._shutdown_event.is_set():
|
|
271
|
-
return
|
|
272
|
-
|
|
273
|
-
# Double-check if there has been activity since the timer was set
|
|
274
|
-
# This handles the race condition where activity occurred just before the timer fired
|
|
275
|
-
if self._last_activity_time is not None and self._keep_alive_minutes > 0:
|
|
276
|
-
elapsed_minutes = (time.time() - self._last_activity_time) / 60
|
|
277
|
-
if elapsed_minutes < self._keep_alive_minutes:
|
|
278
|
-
# Activity occurred, don't clear cache
|
|
279
|
-
self._logger.debug(
|
|
280
|
-
f"Model cache timeout fired but activity detected {elapsed_minutes:.2f} minutes ago. "
|
|
281
|
-
f"Skipping cache clear."
|
|
282
|
-
)
|
|
283
|
-
return
|
|
284
|
-
|
|
285
|
-
# Check if there are any unlocked models that can be cleared
|
|
286
|
-
unlocked_models = [key for key, entry in self._cached_models.items() if not entry.is_locked]
|
|
287
|
-
|
|
288
|
-
if len(unlocked_models) > 0:
|
|
289
|
-
self._logger.info(
|
|
290
|
-
f"Model cache keep-alive timeout of {self._keep_alive_minutes} minutes expired. "
|
|
291
|
-
f"Clearing {len(unlocked_models)} unlocked model(s) from cache."
|
|
292
|
-
)
|
|
293
|
-
# Clear the cache by requesting a very large amount of space.
|
|
294
|
-
# This is the same logic used by the "Clear Model Cache" button.
|
|
295
|
-
# Using 1000 GB ensures all unlocked models are removed.
|
|
296
|
-
self._make_room_internal(1000 * GB)
|
|
297
|
-
elif len(self._cached_models) > 0:
|
|
298
|
-
# All models are locked, don't log at info level
|
|
299
|
-
self._logger.debug(
|
|
300
|
-
f"Model cache timeout fired but all {len(self._cached_models)} model(s) are locked. "
|
|
301
|
-
f"Skipping cache clear."
|
|
302
|
-
)
|
|
303
|
-
else:
|
|
304
|
-
self._logger.debug("Model cache timeout fired but cache is already empty.")
|
|
305
|
-
|
|
306
|
-
@synchronized
|
|
307
|
-
def shutdown(self) -> None:
|
|
308
|
-
"""Shutdown the model cache, cancelling any pending timers."""
|
|
309
|
-
self._shutdown_event.set()
|
|
310
|
-
if self._timeout_timer is not None:
|
|
311
|
-
self._timeout_timer.cancel()
|
|
312
|
-
self._timeout_timer = None
|
|
313
|
-
|
|
314
|
-
@synchronized
|
|
315
|
-
@record_activity
|
|
316
222
|
def put(self, key: str, model: AnyModel) -> None:
|
|
317
223
|
"""Add a model to the cache."""
|
|
318
224
|
if key in self._cached_models:
|
|
@@ -322,7 +228,7 @@ class ModelCache:
|
|
|
322
228
|
return
|
|
323
229
|
|
|
324
230
|
size = calc_model_size_by_data(self._logger, model)
|
|
325
|
-
self.
|
|
231
|
+
self.make_room(size)
|
|
326
232
|
|
|
327
233
|
# Inject custom modules into the model.
|
|
328
234
|
if isinstance(model, torch.nn.Module):
|
|
@@ -366,7 +272,6 @@ class ModelCache:
|
|
|
366
272
|
return overview
|
|
367
273
|
|
|
368
274
|
@synchronized
|
|
369
|
-
@record_activity
|
|
370
275
|
def get(self, key: str, stats_name: Optional[str] = None) -> CacheRecord:
|
|
371
276
|
"""Retrieve a model from the cache.
|
|
372
277
|
|
|
@@ -404,11 +309,9 @@ class ModelCache:
|
|
|
404
309
|
self._logger.debug(f"Cache hit: {key} (Type: {cache_entry.cached_model.model.__class__.__name__})")
|
|
405
310
|
for cb in self._on_cache_hit_callbacks:
|
|
406
311
|
cb(model_key=key, cache_snapshot=self._get_cache_snapshot())
|
|
407
|
-
|
|
408
312
|
return cache_entry
|
|
409
313
|
|
|
410
314
|
@synchronized
|
|
411
|
-
@record_activity
|
|
412
315
|
def lock(self, cache_entry: CacheRecord, working_mem_bytes: Optional[int]) -> None:
|
|
413
316
|
"""Lock a model for use and move it into VRAM."""
|
|
414
317
|
if cache_entry.key not in self._cached_models:
|
|
@@ -445,7 +348,6 @@ class ModelCache:
|
|
|
445
348
|
self._log_cache_state()
|
|
446
349
|
|
|
447
350
|
@synchronized
|
|
448
|
-
@record_activity
|
|
449
351
|
def unlock(self, cache_entry: CacheRecord) -> None:
|
|
450
352
|
"""Unlock a model."""
|
|
451
353
|
if cache_entry.key not in self._cached_models:
|
|
@@ -789,10 +691,6 @@ class ModelCache:
|
|
|
789
691
|
external references to the model, there's nothing that the cache can do about it, and those models will not be
|
|
790
692
|
garbage-collected.
|
|
791
693
|
"""
|
|
792
|
-
self._make_room_internal(bytes_needed)
|
|
793
|
-
|
|
794
|
-
def _make_room_internal(self, bytes_needed: int) -> None:
|
|
795
|
-
"""Internal implementation of make_room(). Assumes the lock is already held."""
|
|
796
694
|
self._logger.debug(f"Making room for {bytes_needed / MB:.2f}MB of RAM.")
|
|
797
695
|
self._log_cache_state(title="Before dropping models:")
|
|
798
696
|
|
|
@@ -140,6 +140,7 @@ class StableDiffusionDiffusersModel(GenericDiffusersLoader):
|
|
|
140
140
|
# Some weights of the model checkpoint were not used when initializing CLIPTextModelWithProjection:
|
|
141
141
|
# ['text_model.embeddings.position_ids']
|
|
142
142
|
|
|
143
|
+
self._logger.info(f"Loading model from single file at {config.path} using {load_class.__name__}")
|
|
143
144
|
with SilenceWarnings():
|
|
144
145
|
pipeline = load_class.from_single_file(config.path, torch_dtype=self._torch_dtype)
|
|
145
146
|
|