From cb6e04d392d4a677d0a8397e9781da58aada9947 Mon Sep 17 00:00:00 2001 From: CalamitousFelicitousness Date: Sat, 8 Aug 2026 02:20:06 +0100 Subject: [PATCH] fix(offload): return on-demand components to rest after bulk moves A pipeline-level move to the accelerator carries on-demand components along with it, since modular pipelines skip only group-hooked modules; the load path then left a resting vae on the gpu until its first use. Bulk moves now re-evict stamped components, whose entry points onload them when needed. --- modules/sd_models.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/modules/sd_models.py b/modules/sd_models.py index 32795c153..e1b819576 100644 --- a/modules/sd_models.py +++ b/modules/sd_models.py @@ -266,6 +266,8 @@ def move_model(model, device=None, force=False): model.to(device) if hasattr(model, "prior_pipe"): model.prior_pipe.to(device) + if device == devices.device: + offload_ondemand(model) # a bulk move must not strand on-demand components on the accelerator; their entry points onload them when needed except Exception as e0: if 'Cannot copy out of meta tensor' in str(e0) or 'must be Tensor, not NoneType' in str(e0): if hasattr(model, "components"):