diff --git a/comfy/model_management.py b/comfy/model_management.py index 29aa60d6..f6dfc18b 100644 --- a/comfy/model_management.py +++ b/comfy/model_management.py @@ -93,7 +93,7 @@ try: except: npu_available = False -if args.cpu or args.openvino: +if args.cpu: cpu_state = CPUState.CPU def is_intel_xpu(): diff --git a/comfy/model_patcher.py b/comfy/model_patcher.py index 813e7be1..a2a26f17 100644 --- a/comfy/model_patcher.py +++ b/comfy/model_patcher.py @@ -470,7 +470,7 @@ class ModelPatcher: current_patches.append((strength_patch, patches[k], strength_model, offset, function)) self.patches[key] = current_patches else: - new_key=key.replace("diffusion_model","diffusion_model._orig_mod") + new_key=key.replace("diffusion_model", "diffusion_model._orig_mod") if new_key in model_sd: p.add(k) if key in self.patches: diff --git a/comfy/sampler_helpers.py b/comfy/sampler_helpers.py index 8c080baf..92ec7ca7 100644 --- a/comfy/sampler_helpers.py +++ b/comfy/sampler_helpers.py @@ -1,5 +1,4 @@ from __future__ import annotations -from comfy.cli_args import args import uuid import comfy.model_management import comfy.conds @@ -115,6 +114,7 @@ def prepare_sampling(model: ModelPatcher, noise_shape, conds, model_options=None minimum_memory_required = model.memory_required([noise_shape[0]] + list(noise_shape[1:])) + inference_memory comfy.model_management.load_models_gpu([model] + models, memory_required=memory_required, minimum_memory_required=minimum_memory_required) real_model = model.model + return real_model, conds, models def cleanup_models(conds, models):