Fix attention_outputs error and alpha parameter issues

1. Fix 'attention_outputs' not defined error:
   - Change 'return attention_outputs' to 'return self.attention_outputs'
   - This fixes the NameError in ConceptAttention extraction

2. Fix alpha parameter validation issues:
   - Move alpha from 'required' to 'optional' in ConceptAttentionVisualizerNode
   - Remove alpha input from workflow JSON since it's now optional with default value
   - This resolves the 'Required input is missing: alpha' validation error

These changes ensure the workflow runs without validation errors while maintaining
the default alpha value of 0.5 for overlay blending.
This commit is contained in:
Junst
2025-09-17 14:52:53 +09:00
parent 30bf6d8d0a
commit 7eecd3685e
3 changed files with 5 additions and 4 deletions
+1 -1
View File
@@ -52,7 +52,7 @@ class ConceptAttention:
logger.warning("Could not access named_modules, using fallback method")
self._register_hooks_fallback(actual_model, hook_fn)
return attention_outputs
return self.attention_outputs
def _register_hooks_fallback(self, model, hook_fn):
"""
+2 -3
View File
@@ -101,14 +101,13 @@
"mode": 0,
"inputs": [
{"name": "concept_maps", "type": "CONCEPT_MAPS", "link": 4},
{"name": "image", "type": "IMAGE", "link": 1},
{"name": "alpha", "type": "FLOAT", "link": null}
{"name": "image", "type": "IMAGE", "link": 1}
],
"outputs": [
{"name": "visualized_image", "type": "IMAGE", "links": [11], "slot_index": 0}
],
"properties": {"Node name for S&R": "ConceptAttentionVisualizerNode"},
"widgets_values": [0.5]
"widgets_values": []
},
{
"id": 7,
+2
View File
@@ -686,6 +686,8 @@ class ConceptAttentionVisualizerNode:
"required": {
"concept_maps": ("CONCEPT_MAPS",),
"image": ("IMAGE",),
},
"optional": {
"alpha": ("FLOAT", {
"default": 0.5,
"min": 0.0,