From e1eb17c0c5c0d225ef65504da566ccb30bffb455 Mon Sep 17 00:00:00 2001 From: Junst Date: Wed, 24 Sep 2025 14:17:53 +0900 Subject: [PATCH] Add debug logging for clip object structure MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 🔍 **Debug Logging Added**: - Print clip type and attributes - Print text_encoder and tokenizer extraction process - Print final extracted components - This will help identify why text_encoder/tokenizer are None --- nodes.py | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/nodes.py b/nodes.py index 47dabbf..9fafa12 100644 --- a/nodes.py +++ b/nodes.py @@ -68,16 +68,28 @@ class ConceptAttentionNode: text_encoder = None tokenizer = None + print(f"DEBUG: clip type: {type(clip)}") if clip is not None: + print(f"DEBUG: clip attributes: {dir(clip)}") + if hasattr(clip, 'cond_stage_model'): text_encoder = clip.cond_stage_model + print(f"DEBUG: Using cond_stage_model as text_encoder: {type(text_encoder)}") elif hasattr(clip, 'text_encoder'): text_encoder = clip.text_encoder + print(f"DEBUG: Using text_encoder: {type(text_encoder)}") if hasattr(clip, 'tokenizer'): tokenizer = clip.tokenizer + print(f"DEBUG: Using clip.tokenizer: {type(tokenizer)}") elif hasattr(clip, 'cond_stage_model') and hasattr(clip.cond_stage_model, 'tokenizer'): tokenizer = clip.cond_stage_model.tokenizer + print(f"DEBUG: Using cond_stage_model.tokenizer: {type(tokenizer)}") + + print(f"DEBUG: Final text_encoder: {text_encoder}") + print(f"DEBUG: Final tokenizer: {tokenizer}") + else: + print("DEBUG: clip is None!") # Process image saliency_maps = processor.process_image(