offload disabled controlnets

This commit is contained in:
Vladimir Mandic
2024-08-28 10:10:17 -04:00
parent b39abdd18f
commit 35565fa47c
2 changed files with 8 additions and 0 deletions
+1
View File
@@ -75,6 +75,7 @@ To use and of the new models, simply select model from *Networks -> Reference* a
*note*: requires reset of selected offload option
- control module allows reszing of indivudual process override images to match input image
for example: set size->before->method:nearest, mode:fixed or mode:fill
- automatically offload disabled controlnet units
- update **IPEX** to 2.1.40+xpu on Linux, thanks @Disty0!
- general **ROCm** fixes, thanks @lshqqytiger!
- fix full vae previews, thanks @Disty0!
+7
View File
@@ -213,7 +213,14 @@ def control_run(units: List[unit.Unit] = [], inputs: List[Image.Image] = [], ini
num_units += 1
debug(f'Control unit: i={num_units} type={u.type} enabled={u.enabled}')
if not u.enabled:
shared.log.debug(f'Control unit disabled: i={num_units}')
if u.controlnet is not None and u.controlnet.model is not None:
shared.log.debug(f'Control unit offload: model="{u.controlnet.model_id}"')
sd_models.move_model(u.controlnet.model, devices.cpu)
continue
else:
if u.controlnet is not None and u.controlnet.model is not None:
sd_models.move_model(u.controlnet.model, devices.device)
if unit_type == 't2i adapter' and u.adapter.model is not None:
active_process.append(u.process)
active_model.append(u.adapter)