Commit 392895da authored by Your Name's avatar Your Name

Fix: Add missing get_cached_model_path and get_model_cache_dir methods to MultiModelManager

- Added proxy methods to MultiModelManager class for cache module functions
- These methods are called by images.py sd.cpp fallback path
- Fixes AttributeError: 'MultiModelManager' object has no attribute 'get_cached_model_path'
parent ce75ec47
...@@ -796,6 +796,24 @@ class MultiModelManager: ...@@ -796,6 +796,24 @@ class MultiModelManager:
# Otherwise return the first loaded model (there should only be one in ondemand mode) # Otherwise return the first loaded model (there should only be one in ondemand mode)
return list(self.models.keys())[0] if self.models else None return list(self.models.keys())[0] if self.models else None
def get_cached_model_path(self, url: str) -> Optional[str]:
"""
Check if a model URL is already cached.
This is a proxy method to the cache module function.
Returns the cached path if the model is cached, None otherwise.
"""
return get_cached_model_path(url)
def get_model_cache_dir(self) -> str:
"""
Get the model cache directory.
This is a proxy method to the cache module function.
Returns the path to the model cache directory.
"""
return get_model_cache_dir()
def unload_all_models(self): def unload_all_models(self):
""" """
Fully unload ALL models from VRAM. Used in ondemand mode when switching Fully unload ALL models from VRAM. Used in ondemand mode when switching
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment