The most powerful and modular diffusion model GUI, api and backend with a graph/nodes interface. The fastest local inference engine in the world.
skip_load_model -> force_full_load (#11390)
comfyanonymousbf7dc63bd6ac
diff --git a/comfy/sampler_helpers.py b/comfy/sampler_helpers.pyindex e158e8a84..9134e6d71 100644--- a/comfy/sampler_helpers.py+++ b/comfy/sampler_helpers.py@@ -122,21 +122,20 @@ def estimate_memory(model, noise_shape, conds):minimum_memory_required = model.model.memory_required([noise_shape[0]] + list(noise_shape[1:]), cond_shapes=cond_shapes_min)return memory_required, minimum_memory_required-def prepare_sampling(model: ModelPatcher, noise_shape, conds, model_options=None, skip_load_model=False):+def prepare_sampling(model: ModelPatcher, noise_shape, conds, model_options=None, force_full_load=False):executor = comfy.patcher_extension.WrapperExecutor.new_executor(_prepare_sampling,comfy.patcher_extension.get_all_wrappers(comfy.patcher_extension.WrappersMP.PREPARE_SAMPLING, model_options, is_model_options=True))- return executor.execute(model, noise_shape, conds, model_options=model_options, skip_load_model=skip_load_model)+ return executor.execute(model, noise_shape, conds, model_options=model_options, force_full_load=force_full_load)-def _prepare_sampling(model: ModelPatcher, noise_shape, conds, model_options=None, skip_load_model=False):+def _prepare_sampling(model: ModelPatcher, noise_shape, conds, model_options=None, force_full_load=False):real_model: BaseModel = Nonemodels, inference_memory = get_additional_models(conds, model.model_dtype())models += get_additional_models_from_model_options(model_options)models += model.get_nested_additional_models() # TODO: does this require inference_memory update?memory_required, minimum_memory_required = estimate_memory(model, noise_shape, conds)- models_list = [model] if not skip_load_model else []- comfy.model_management.load_models_gpu(models_list + models, memory_required=memory_required + inference_memory, minimum_memory_required=minimum_memory_required + inference_memory)+ comfy.model_management.load_models_gpu([model] + models, memory_required=memory_required + inference_memory, minimum_memory_required=minimum_memory_required + inference_memory, force_full_load=force_full_load)real_model = model.modelreturn real_model, conds, modelsdiff --git a/comfy_extras/nodes_train.py b/comfy_extras/nodes_train.pyindex 88bc8c8e8..364804205 100644--- a/comfy_extras/nodes_train.py+++ b/comfy_extras/nodes_train.py@@ -44,7 +44,7 @@ class TrainGuider(comfy_extras.nodes_custom_sampler.Guider_Basic):noise.shape,self.conds,self.model_options,- skip_load_model=True, # skip load model as we manage it in TrainLoraNode.execute()+ force_full_load=True, # mirror behavior in TrainLoraNode.execute() to keep model loaded))device = self.model_patcher.load_device