Commit Graph
8 Commits
Author SHA1 Message Date
Junst 7eecd3685e 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.
2025-09-17 14:52:53 +09:00
Junst 30bf6d8d0a Fix ConceptAttentionVisualizerNode input parameter name
- Change 'overlay_alpha' to 'alpha' to match the node's INPUT_TYPES definition
- This fixes the validation error: 'Required input is missing: alpha'
2025-09-17 14:49:46 +09:00
Junst 6595d25bad Update workflow for elderly woman character example
- Remove VAE output from CheckpointLoaderSimple (not needed for ConceptAttention)
- Update example prompt to: 'Elderly woman character with white hair and a red dress holding a cane and accompanied by a small white cat on her shoulder. Cartoon style with smooth lines and exaggerated facial features offering a whimsical and friendly appearance. Her name is abae.'
- Update concept segmentation to: woman, cat, white, lines, cane
- Update concept saliency map default to: woman
- Update mock saliency map patterns for new concepts:
  * woman: center region (red)
  * cat: shoulder region (green)
  * white: scattered bright spots (white)
  * lines: horizontal/vertical line patterns (blue)
  * cane: vertical line on right side (magenta)
- Update color mappings in utils.py and nodes.py
- Fix workflow link validation issues
2025-09-17 14:02:15 +09:00
Junst 4b4667f15f Revert to CheckpointLoaderSimple to fix link errors
- Go back to CheckpointLoaderSimple which provides MODEL, CLIP, VAE outputs
- Remove separate UNETLoader, CLIPLoader, VAELoader that were causing link issues
- Fix link 3 to connect CheckpointLoaderSimple CLIP output to ConceptAttentionNode
- VAE is included but not used (ConceptAttention works on original images, not latents)
- This should resolve the 'origin(2).outputs[1].links does NOT contain it' error
2025-09-17 13:55:47 +09:00
Junst 901663a7a1 Fix workflow link error
- Fix link 3 to connect CLIPLoader (node 11) to ConceptAttentionNode (node 3)
- Previously incorrectly connected UNETLoader (node 2) which doesn't have CLIP output
- Workflow now properly connects MODEL from UNETLoader and CLIP from CLIPLoader
2025-09-17 13:53:18 +09:00
Junst ab9313138c Fix ModelPatcher errors and update workflow to use separate loaders
- Fix 'named_modules' error by adding fallback method for ModelPatcher
- Add mock saliency map generation for testing
- Update workflow to use UNETLoader, CLIPLoader, VAELoader instead of CheckpointLoaderSimple
- Improve error handling in nodes
- Fix tensor dimension issues in saliency map processing
- Add proper concept-based pattern generation for different object types
2025-09-17 12:03:07 +09:00
Junst 31dc847125 Fix workflow validation errors
- Remove invalid links 7 and 9 that were causing validation errors
- Fix MASK outputs to not connect to SaveImage nodes (SaveImage only accepts IMAGE)
- Update last_link_id to match actual number of links
- Workflow now validates correctly in ComfyUI
2025-09-17 11:55:06 +09:00
Junst 9a6b6ce77a Initial commit: ComfyUI-Concept-Diffusion implementation
- Implement ConceptAttention nodes for ComfyUI
- Add concept saliency map generation
- Add zero-shot segmentation capabilities
- Add visualization tools
- Include example workflow and tests
- Based on ConceptAttention paper (arXiv:2502.04320)
2025-09-17 11:36:27 +09:00