This commit removes all Flux-specific references from the codebase to make
it more universal and future-proof:
Changes:
- Renamed EasyRegionFlux → EasyRegionMask (class, function, JS references)
- Updated all tooltips to be model-agnostic (removed "for Flux" phrases)
- Moved Flux-specific tips from code to README "Model-Specific Tips" section
- Updated prompting guidance to emphasize spatial location in prompts
("left side", "right third") rather than just box positioning
- Changed node display name from "EasyRegion (Flux)" to "EasyRegion (Mask-Based)"
Rationale:
- Flux is over a year old and not the primary use case anymore
- Mask-based vs area-based distinction is clearer and more descriptive
- Model-specific tips belong in documentation, not code tooltips
- Makes codebase maintainable for future models (SD3, Chroma, etc.)
DELETED FILES:
- MultiAreaConditioning.py (5 classes: MultiAreaConditioning, MultiAreaConditioningMask, ConditioningUpscale, ConditioningStretch, ConditioningDebug)
- MultiLatentComposite.py
- js/MultiAreaConditioning.js
- js/MultiAreaConditioningMask.js
- js/MultiLatentComposite.js
KEPT:
- RegionalPrompting.py (RegionalPrompterSimple, RegionalPrompterFlux)
- js/RegionalPrompting.js
- js/utils.js
UPDATED:
- __init__.py: Now only exports the 2 enhanced nodes
- Removed all old node registrations from NODE_CLASS_MAPPINGS
- Simplified to just Area-Based and Mask-Based prompters
REASONING:
- Old nodes required external CLIP Text Encode (extra complexity)
- New enhanced nodes have inline prompts (much simpler UX)
- User not using old nodes, only the new enhanced ones
- Cleaner codebase, easier to maintain
RESULT:
- Nodes now nested under 'RegionalPrompter' category only
- No more 'Davemane42' category
- Only 2 nodes to choose from (Area or Mask based on model type)
THREE CRITICAL FIXES:
1. 🔧 CANVAS NOT SHOWING - Added missing WEB_DIRECTORY export
- ROOT CAUSE: __init__.py had no WEB_DIRECTORY export
- ComfyUI couldn't find JavaScript files in /js/ folder
- Canvas widget completely invisible/broken
- FIX: Export WEB_DIRECTORY = os.path.join(os.path.dirname(__file__), "js")
- All JavaScript extensions now load correctly
2. 🐛 INDEXERROR CRASH - Fixed variable shadowing in feathering loop
- ROOT CAUSE: Inner loop variable 'i' shadowed outer loop variable 'i'
- Line 397 feathering loop used 'i', corrupting outer iteration index
- When accessing encoded_conditionings[i] at line 413, index was wrong
- CRASH: IndexError: list index out of range
- FIX: Renamed inner loop variable to 'edge_idx' (RegionalPrompting.py:397-410)
- Feathering now works without crashing
3. 🎨 NODE NAMING - Removed "EASY!" and made names model-agnostic
- BEFORE: "Regional Prompter (Flux/Chroma - Easy!)"
- AFTER: "Regional Prompter (Mask-Based)"
- Describes conditioning technique, not specific models
- Mask-based works for: Flux, Chroma, SD3, SD3.5, Qwen-Image, etc.
- Also: "SD/SDXL - Easy!" → "Area-Based" (clearer description)
- Also: Simplified startup message to single line
IMPACT:
- Canvas now actually appears and works
- No more crashes during execution with feathering
- Professional naming that describes functionality
- Clean console output during startup
Documented all fixes in CONTEXT.md with detailed explanations.
MAJOR NEW FEATURES:
===================
🌟 NEW NODES (RECOMMENDED for all users):
- RegionalPrompterSimple (SD/SDXL) - Type prompts directly!
- RegionalPrompterFlux (Flux/Chroma) - Optimized for modern models!
✅ NO MORE external CLIP Text Encode nodes needed
✅ Simple workflow: Checkpoint → CLIP → Regional Prompter → Sampler
✅ Same visual box-drawing interface
✅ Up to 4 regions + background prompt
✅ Multiline text inputs for prompts
FLUX OPTIMIZATIONS:
===================
- Softened mask strength (0.8 vs 1.0) based on research
- Gentle feathering at region edges (40-60px equivalent)
- Automatic region count warning (>4 regions)
- flux_optimize toggle for easy control
IMPROVEMENTS TO EXISTING NODES:
================================
- Add mask_strength parameter to MultiAreaConditioningMask
(allows 0.7-0.85 for Flux, 1.0 for SD/SDXL)
- Add tooltips explaining Flux optimization
- Improve documentation with clear model recommendations
TECHNICAL DETAILS:
==================
Python Changes:
- RegionalPrompting.py - New enhanced nodes with CLIP encoding
- Uses clip.tokenize() and clip.encode_from_tokens() internally
- Proper pooled_output handling for all models
- Comprehensive error handling and validation
JavaScript Changes:
- RegionalPrompting.js - Visual canvas UI for new nodes
- Reuses canvas drawing code from original nodes
- Widget positioning adjusted for prompt inputs
Documentation:
- Prominent "NEW!" section highlighting enhanced nodes
- Easy mode vs Advanced mode comparison
- Flux-specific tips and optimization details
- Updated quick start with both methods
BACKWARD COMPATIBILITY:
=======================
- All original nodes unchanged and fully functional
- Original nodes renamed to "Advanced" in UI
- Enhanced nodes marked as "RECOMMENDED"
- Users can choose based on preference
USER EXPERIENCE:
================
Before (Advanced):
Checkpoint → CLIP → CLIPTextEncode → MultiAreaConditioning → Sampler
(repeat CLIPTextEncode for each region)
After (Easy):
Checkpoint → CLIP → Regional Prompter → Sampler
(type all prompts in one node!)
COMPATIBILITY:
==============
✅ ComfyUI 0.3.71+
✅ SD1.5, SD2.x, SDXL (area-based)
✅ Flux, Chroma, SD3, SD3.5 (mask-based with optimizations)
✅ V3 schema ready (uses standard INPUT_TYPES, will migrate later)
This makes regional conditioning DRAMATICALLY easier to use!
Major Changes:
- Add MultiAreaConditioningMask node for Flux/Chroma/SD3 support
- Implement comprehensive error handling and input validation
- Add bounds checking for MultiLatentComposite (fixes known issue)
- Modernize JavaScript loading (js/ folder, no file copying)
- Add tooltips and descriptions to all node inputs
Fixes:
- Remove debug console.log statements
- Fix graph reference bug in background drawing (app.graph vs graph)
- Fix typo in variable name (inputLenght -> inputLength)
- Improve comment accuracy
Enhancements:
- Add detailed error messages with emoji indicators (⚠️ℹ️❌)
- Implement graceful fallback behavior when metadata missing
- Add tensor shape and type validation
- Add channel compatibility checking in MultiLatentComposite
- Improve feathering with proper gradient calculation
- Add bounds clipping with informative warnings
Documentation:
- Complete README rewrite with compatibility matrix
- Add usage examples for Flux, Chroma, SD, SDXL
- Document all node inputs/outputs with descriptions
- Add troubleshooting section
- Add changelog with version 3.0 details
JavaScript:
- Move from javascript/ to js/ for modern ComfyUI compatibility
- Clean up all console.log debug statements
- Fix graph._nodes bug (should be app.graph._nodes)
- Add MultiAreaConditioningMask.js for mask-based node
- Improve code comments and formatting
Compatibility:
- SD1.5, SD2.x, SDXL (area-based, existing functionality)
- Flux, Chroma, SD3, SD3.5 (mask-based, NEW)
- Experimental Qwen-Image support noted
- WAN 2.2 marked as not supported (video architecture)
All changes maintain backward compatibility with existing workflows
while adding modern model support and significantly improving
robustness and user experience.