This commit is contained in:
Vladimir Mandic
2024-08-28 10:22:46 -04:00
parent 35565fa47c
commit 65c137abf1
2 changed files with 5 additions and 2 deletions
+2 -2
View File
@@ -213,13 +213,13 @@ 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}"')
debug(f'Control unit offload: model="{u.controlnet.model_id}" device={devices.cpu}')
sd_models.move_model(u.controlnet.model, devices.cpu)
continue
else:
if u.controlnet is not None and u.controlnet.model is not None:
debug(f'Control unit offload: model="{u.controlnet.model_id}" device={devices.device}')
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)
+3
View File
@@ -300,6 +300,9 @@ def resize_image(resize_mode, im, width, height, upscaler_name=None, output_type
from modules import masking
res = fill(im, color=0)
res, _mask = masking.outpaint(res)
else:
res = None
raise ValueError(f'Invalid resize mode: {resize_mode}')
if output_type == 'np':
return np.array(res)
return res