Created logging code for this branch so that it can be used to track down all the code paths where transformer_options would need to be added

This commit is contained in:
Jedrzej Kosinski
2025-08-27 17:13:33 -07:00
parent b58db6934c
commit 68b00e9c60
2 changed files with 88 additions and 3 deletions

View File

@@ -1019,6 +1019,7 @@ class CFGGuider:
self.conds[k] = list(map(lambda a: a.copy(), self.original_conds[k]))
preprocess_conds_hooks(self.conds)
import comfy.ldm.modules.attention #TODO: Remove this $$$$$
try:
orig_model_options = self.model_options
self.model_options = comfy.model_patcher.create_model_options_clone(self.model_options)
@@ -1033,12 +1034,17 @@ class CFGGuider:
self,
comfy.patcher_extension.get_all_wrappers(comfy.patcher_extension.WrappersMP.OUTER_SAMPLE, self.model_options, is_model_options=True)
)
comfy.ldm.modules.attention.LOG_ATTN_CALLS = True #TODO: Remove this $$$$$
comfy.ldm.modules.attention.LOG_CONTENTS = {}
output = executor.execute(noise, latent_image, sampler, sigmas, denoise_mask, callback, disable_pbar, seed)
finally:
cast_to_load_options(self.model_options, device=self.model_patcher.offload_device)
self.model_options = orig_model_options
self.model_patcher.hook_mode = orig_hook_mode
self.model_patcher.restore_hook_patches()
comfy.ldm.modules.attention.LOG_ATTN_CALLS = False #TODO: Remove this $$$$$
comfy.ldm.modules.attention.save_log_contents()
comfy.ldm.modules.attention.LOG_CONTENTS = {}
del self.conds
return output