mirror of
https://git.datalinker.icu/comfyanonymous/ComfyUI
synced 2026-09-13 18:27:11 +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:
|
||||
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):
|
||||
|
||||
11
nodes.py
11
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
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user