From 113a74d91ab9617251fca3c60679f3fd91bcfea0 Mon Sep 17 00:00:00 2001 From: CalamitousFelicitousness Date: Wed, 12 Aug 2026 03:17:45 +0100 Subject: [PATCH] fix(model): treat an unpopulated modular pipeline as not loaded None from a family loader means unhandled, so the chain falls through to the folder loader, which for a modular pipe builds an object holding only its from_config helpers and installs it. Refuse it when none of the from_pretrained specs materialized. --- modules/sd_models.py | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/modules/sd_models.py b/modules/sd_models.py index 1c5cf229d..daa4771ae 100644 --- a/modules/sd_models.py +++ b/modules/sd_models.py @@ -996,6 +996,17 @@ def load_diffuser(checkpoint_info: CheckpointInfo | None = None, op='model', rev log.error(f'Load {op}: name="{checkpoint_info.name if checkpoint_info is not None else None}" not loaded') return + # a family loader that returns None falls through to the generic folder loader, and for a modular pipeline that + # yields an object holding nothing but its from_config helpers, since a modular load registers the fetched + # components empty until load_components runs. it reports as a loaded model and then fails on the first + # component something reaches, far from the cause + specs = getattr(sd_model, '_component_specs', None) # pylint: disable=protected-access + if isinstance(specs, dict): + fetched = [name for name, spec in specs.items() if getattr(spec, 'default_creation_method', None) == 'from_pretrained'] + if len(fetched) > 0 and all(getattr(sd_model, name, None) is None for name in fetched): + log.error(f'Load {op}: name="{checkpoint_info.name if checkpoint_info is not None else None}" cls={sd_model.__class__.__name__} no components loaded') + return + set_overrides(sd_model, checkpoint_info, model_type) set_defaults(sd_model, checkpoint_info)