diff --git a/comfy/model_patcher.py b/comfy/model_patcher.py index ef7971b14..6f692f115 100644 --- a/comfy/model_patcher.py +++ b/comfy/model_patcher.py @@ -971,7 +971,8 @@ class ModelPatcher: if hook.hook_ref not in self.hook_patches: weight_hooks_to_register.append(hook) if len(weight_hooks_to_register) > 0: - self.hook_patches_backup = create_hook_patches_clone(self.hook_patches_backup) + # clone hook_patches to become backup so that any non-dynamic hooks will return to their original state + self.hook_patches_backup = create_hook_patches_clone(self.hook_patches) for hook in weight_hooks_to_register: hook.add_hook_patches(self, target, registered_hooks) for callback in self.get_all_callbacks(CallbacksMP.ON_REGISTER_ALL_HOOK_PATCHES): diff --git a/nodes.py b/nodes.py index 6e6051c1f..7106dc297 100644 --- a/nodes.py +++ b/nodes.py @@ -62,11 +62,12 @@ class CLIPTextEncode: def encode(self, clip, text): tokens = clip.tokenize(text) - if not clip.use_clip_schedule: - output = clip.encode_from_tokens(tokens, return_pooled=True, return_dict=True) - cond = output.pop("cond") - return ([[cond, output]], ) - return (clip.encode_from_tokens_scheduled(tokens), ) + if clip.use_clip_schedule: + return (clip.encode_from_tokens_scheduled(tokens), ) + output = clip.encode_from_tokens(tokens, return_pooled=True, return_dict=True) + cond = output.pop("cond") + return ([[cond, output]], ) + class ConditioningCombine: @classmethod