mirror of
https://github.com/leejet/stable-diffusion.cpp.git
synced 2026-11-12 03:49:09 +00:00
refactor: unify model source and weight lifecycle management (#1956)
This commit is contained in:
1 parent
d04e8950c1
commit
6b47fec013
36 files changed
+2548
-1462
No files matched your search
@@ -19,7 +19,7 @@ struct GenerationExtensionInitContext {
|
||||
const sd_ctx_params_t* params;
|
||||
SDVersion version;
|
||||
const String2TensorStorage& tensor_storage_map;
|
||||
ModelLoader& model_loader;
|
||||
bool photomaker_source_available;
|
||||
std::shared_ptr<ModelManager> model_manager;
|
||||
int n_threads;
|
||||
std::function<bool(SDBackendModule)> ensure_backend_pair;
|
||||
@@ -39,7 +39,8 @@ struct GenerationExtensionConditionContext {
|
||||
struct GenerationExtension {
|
||||
virtual ~GenerationExtension() = default;
|
||||
|
||||
virtual const char* name() const = 0;
|
||||
virtual ModelComponent component() const = 0;
|
||||
const char* name() const { return model_component_name(component()); }
|
||||
virtual bool is_enabled() const {
|
||||
return false;
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user