mirror of
https://git.datalinker.icu/comfyanonymous/ComfyUI
synced 2026-10-22 00:27:08 +08:00
Make encode_from_tokens_scheduled call cleaner, rollback change in model_patcher.py for hook_patches_backup dict
This commit is contained in:
parent
489846905e
commit
16735c98e0
@ -971,7 +971,8 @@ class ModelPatcher:
|
|||||||
if hook.hook_ref not in self.hook_patches:
|
if hook.hook_ref not in self.hook_patches:
|
||||||
weight_hooks_to_register.append(hook)
|
weight_hooks_to_register.append(hook)
|
||||||
if len(weight_hooks_to_register) > 0:
|
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:
|
for hook in weight_hooks_to_register:
|
||||||
hook.add_hook_patches(self, target, registered_hooks)
|
hook.add_hook_patches(self, target, registered_hooks)
|
||||||
for callback in self.get_all_callbacks(CallbacksMP.ON_REGISTER_ALL_HOOK_PATCHES):
|
for callback in self.get_all_callbacks(CallbacksMP.ON_REGISTER_ALL_HOOK_PATCHES):
|
||||||
|
|||||||
11
nodes.py
11
nodes.py
@ -62,11 +62,12 @@ class CLIPTextEncode:
|
|||||||
|
|
||||||
def encode(self, clip, text):
|
def encode(self, clip, text):
|
||||||
tokens = clip.tokenize(text)
|
tokens = clip.tokenize(text)
|
||||||
if not clip.use_clip_schedule:
|
if clip.use_clip_schedule:
|
||||||
output = clip.encode_from_tokens(tokens, return_pooled=True, return_dict=True)
|
return (clip.encode_from_tokens_scheduled(tokens), )
|
||||||
cond = output.pop("cond")
|
output = clip.encode_from_tokens(tokens, return_pooled=True, return_dict=True)
|
||||||
return ([[cond, output]], )
|
cond = output.pop("cond")
|
||||||
return (clip.encode_from_tokens_scheduled(tokens), )
|
return ([[cond, output]], )
|
||||||
|
|
||||||
|
|
||||||
class ConditioningCombine:
|
class ConditioningCombine:
|
||||||
@classmethod
|
@classmethod
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user