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!
Davemane42's Regional Conditioning Nodes for ComfyUI
Updated: November 22, 2025 Version: 3.1 - Enhanced with ALL-IN-ONE nodes featuring inline prompts!
Visual interface for regional conditioning in ComfyUI. Draw boxes on a canvas and assign different prompts to each region - perfect for precise control over image composition.
🌟 NEW! Enhanced Easy-Mode Nodes (RECOMMENDED)
🎨 Regional Prompter (SD/SDXL - Easy!) and 🎨 Regional Prompter (Flux/Chroma - Easy!)
✅ Type prompts directly in the node - No external CLIP Text Encode nodes needed! ✅ Simple workflow: Checkpoint → CLIP → Regional Prompter → Sampler ✅ Same visual box drawing you love ✅ Flux-optimized with perfect mask strength (0.8) and feathering ✅ Up to 4 regions + background
Perfect for beginners and quick workflows!
✨ Features
- 🎨 Visual Box Drawing Interface - Color-coded regions with interactive canvas
- 📐 Grid Overlay - 64px alignment grid for precise positioning
- 💪 Strength Control - Per-region strength adjustment (0.0-10.0)
- 🔄 Right-Click Menu - Easy add/remove/swap conditioning layers
- ✅ Automatic Boundary Clipping - Smart handling of out-of-bounds regions
- 🛡️ Comprehensive Error Handling - Helpful validation and fallback behavior
- 🚀 Modern Model Support - Area-based AND mask-based conditioning
📦 Installation
Method 1: ComfyUI Manager (Recommended)
- Open ComfyUI Manager
- Search for "Regional Conditioning"
- Click Install
Method 2: Manual Installation
cd ComfyUI/custom_nodes/
git clone https://github.com/Davemane42/ComfyUI_RegionalConditioning
# Restart ComfyUI
Note: JavaScript files are automatically loaded from the js/ folder - no manual copying needed!
🎯 Model Compatibility
✅ MultiAreaConditioning (Area-based)
Compatible Models:
- ✅ Stable Diffusion 1.5
- ✅ Stable Diffusion 2.x
- ✅ SDXL (Stable Diffusion XL)
Technology: Uses ComfyUI's ConditioningSetArea internally
Best For: Traditional Stable Diffusion workflows with rectangular regions
✅ MultiAreaConditioningMask (Mask-based)
Compatible Models:
- ✅ Flux (all variants)
- ✅ Chroma (Chroma1-Radiance, etc.)
- ✅ SD3 / SD3.5 (Stable Diffusion 3)
- ✅ Any model supporting ConditioningSetMask
Technology: Automatically converts boxes to binary masks Best For: Modern models that require mask-based conditioning
❓ Experimental Support
- 🟡 Qwen-Image (generation model) - May work with standard CONDITIONING
- ❌ WAN 2.2 - Not currently supported (video-focused architecture)
🚀 Quick Start Example
🌟 NEW! Easy Mode (Recommended)
Using Regional Prompter (inline prompts):
- Load your checkpoint
- Add
🎨 Regional Prompter (SD/SDXL)OR🎨 Regional Prompter (Flux/Chroma) - Connect CLIP from checkpoint to the Regional Prompter
- Type in Background Prompt: "photo of a mountain landscape"
- Draw a box on canvas, type in Region 1 Prompt: "majestic tiger"
- Draw another box, type in Region 2 Prompt: "berry bush"
- Connect conditioning output to your sampler
- Done! 🎉
That's it! No external CLIP Text Encode nodes, no complex wiring!
Advanced Mode (Original Nodes)
Using MultiAreaConditioning (requires external CLIP Text Encode):
- Add
MultiAreaConditioning(for SDXL) ORMultiAreaConditioningMask(for Flux) - Connect
conditioning0→ CLIPTextEncode("photo of a mountain landscape") - Draw a box, connect
conditioning1→ CLIPTextEncode("majestic tiger") - Draw another box, connect
conditioning2→ CLIPTextEncode("berry bush") - Connect output to your sampler
Both methods give the same result: A mountain landscape with a tiger and berry bush positioned exactly where you drew the boxes!
📚 Node Reference
🌟 Regional Prompter (SD/SDXL - Easy!) ← RECOMMENDED
The easiest way to use regional conditioning with SDXL!
Inputs:
clip- CLIP model from your checkpointbackground_prompt- Text box for overall scene (multiline)region1_prompt- Text box for first region (multiline)region2_prompt- Text box for second region (optional)region3_prompt- Text box for third region (optional)region4_prompt- Text box for fourth region (optional)
Outputs:
conditioning- Ready to connect to sampler!width,height- Canvas dimensions
How it works: Just type your prompts and draw boxes - the node handles CLIP encoding internally!
Perfect for: Quick workflows, beginners, anyone who wants simplicity
🌟 Regional Prompter (Flux/Chroma - Easy!) ← RECOMMENDED FOR FLUX
The easiest way to use regional conditioning with Flux!
Inputs:
clip- CLIP model from your checkpointwidth,height- Output dimensionsbackground_prompt- Text box for overall scene (multiline)region1_prompt- Text box for first region (multiline)region2_prompt- Text box for second region (optional)region3_prompt- Text box for third region (optional)region4_prompt- Text box for fourth region (optional, limit 3-4 for best results)flux_optimize- Enable Flux optimizations (default: ON)
Output:
conditioning- Ready to connect to sampler!
Flux Optimizations:
- ✅ Softened mask strength (0.8 vs 1.0) for better blending
- ✅ Gentle feathering at region edges
- ✅ Automatic region limiting (warns if >4 regions)
Tips:
- Use 3-4 regions maximum for reliable results
- Enable Flux Optimize for best quality
- Increase CFG to 5-7 (vs typical 3-5)
- Draw larger regions for better control
Perfect for: Flux workflows, Chroma, SD3, modern models
📚 Advanced Node Reference
MultiAreaConditioning (Area-based for SD/SDXL)
Inputs:
conditioning0- Base/background conditioning (fullscreen if no box drawn)conditioning1+- Regional conditioning (add more via right-click menu)
Outputs:
conditioning- Combined regional conditioningresolutionX- Canvas width (INT)resolutionY- Canvas height (INT)
Widgets:
resolutionX/Y- Canvas dimensions (auto-synced from latent)index- Select which region to editx, y- Region positionwidth, height- Region dimensionsstrength- Region influence (0.0-10.0)
Right-Click Menu:
- Insert input above/below current
- Swap with input above/below
- Remove currently selected input
- Remove all unconnected inputs
MultiAreaConditioningMask (Mask-based for Flux/Chroma)
Inputs:
conditioning0- Base/background conditioningconditioning1+- Regional conditioning (add more via right-click menu)width- Output width in pixels (default: 1024)height- Output height in pixels (default: 1024)
Output:
conditioning- Combined mask-based conditioning
Widgets: (same as area-based)
index- Select which region to editx, y- Region positionwidth, height- Region dimensionsstrength- Region influence (0.0-10.0)
How It Works: Boxes are automatically converted to binary masks behind the scenes. You draw visually, the node handles the mask generation!
ConditioningUpscale
Upscale conditioning areas by a scalar factor - perfect for hi-res fix workflows.
Inputs:
conditioning- Conditioning to upscalescalar- Scaling factor (1-100, default: 2)
Output:
conditioning- Upscaled conditioning
Example: 512x512 regions × scalar=2 → 1024x1024 regions
ConditioningStretch
Stretch/resize conditioning areas to fit new dimensions - more flexible than upscale.
Inputs:
conditioning- Conditioning to resizeresolutionX/Y- Current/original dimensionsnewWidth/Height- Target dimensions
Output:
conditioning- Resized conditioning
Example: Transform regions from 512x512 to 1024x768 (proportional scaling)
MultiLatentComposite
Visual interface for compositing multiple latents with positioning and feathering.
Inputs:
samples_to- Base/destination latent canvassamples_from0+- Latents to composite (add more via right-click menu)
Output:
LATENT- Composited latent
Widgets:
index- Select which latent to editx, y- Position in pixelsfeather- Blend distance (0 = hard edge, higher = smooth blend)
Features:
- ✅ Automatic bounds checking and clipping
- ✅ Channel compatibility validation
- ✅ Smart feathering with gradient masks
- ✅ Detailed info/warning messages
Fixed: The "no bounds checking" issue mentioned in original README is now resolved!
🔧 Advanced Tips
Fullscreen/Background Conditioning
Set a region to x=0, y=0, width=canvas_width, height=canvas_height to make it fullscreen. This is perfect for background prompts.
Grid Alignment
The 64px grid overlay helps you align regions to latent space boundaries for optimal results.
Strength Values
1.0- Normal strength (default)0.5- Subtle influence2.0+- Strong influence0.0- Effectively disabled
Multiple Regions
- Use right-click menu to add as many conditioning inputs as needed
- Each region can have different prompts, positions, and strengths
- Regions are processed in order and can overlap
🐛 Error Handling
This modernized version includes extensive error handling:
- ✅ Validation - All inputs validated with helpful error messages
- ✅ Fallback Behavior - Graceful degradation if metadata missing
- ✅ Bounds Checking - Automatic clipping for out-of-bounds regions
- ✅ Type Checking - Validates tensor shapes and data types
- ✅ Helpful Messages - Clear ⚠️ warnings and ℹ️ info in console
Common Issues:
- "Workflow metadata missing" → Save and reload your workflow
- "Region has zero width/height" → Check your box dimensions
- "Beyond canvas width/height" → Region position is out of bounds (auto-clipped)
📝 Changelog
Version 3.0 (November 2025)
- ✨ NEW: MultiAreaConditioningMask for Flux/Chroma support
- ✨ NEW: Comprehensive error handling and validation
- ✨ NEW: Bounds checking for MultiLatentComposite (fixes known issue)
- ✨ NEW: Tooltips and descriptions on all inputs
- 🔧 FIX: Modernized JavaScript loading (no more file copying!)
- 🔧 FIX: Removed debug console.log statements
- 🔧 FIX: Fixed graph reference bug in background drawing
- 📚 DOCS: Complete compatibility matrix and examples
- 🚀 PERF: Improved tensor operations and validation
Version 2.4 (Original)
- Visual area conditioning interface
- MultiLatentComposite with feathering
- ConditioningUpscale and ConditioningStretch utilities
🤝 Contributing
Found a bug? Have a feature request? Open an issue
📄 License
GLWT (Good Luck With That) Public License See LICENSE file for details.
🙏 Credits
Original Author: Davemane42#0042 Modernization: 2025-11-22 update for ComfyUI 0.3.71+
Special Thanks:
- ComfyUI community for testing and feedback
- Contributors who reported issues and suggested improvements
📸 Examples
MultiAreaConditioning Workflow
Traditional area-based regional conditioning for SDXL
MultiLatentComposite Workflow
Visual latent compositing with feathering
Enjoy precise regional control in your ComfyUI workflows! 🎨