refactor: unify model source and weight lifecycle management (#1956)

This commit is contained in:
leejet authored and GitHub committed 2026-09-10 23:53:48 +08:00
1 parent d04e8950c1
commit 6b47fec013
36 files changed
+2548 -1462

No files matched your search

+3 -2
View File
@@ -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;
}