Commit Graph
10 Commits
Author SHA1 Message Date
Claude df3e1e7e5b Make nodes model-agnostic: Rename EasyRegionFlux to EasyRegionMask
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.)
2025-11-22 17:33:41 +00:00
Claude b78dbb1916 MAJOR REBRAND: RegionalPrompter → EasyRegion + Documentation Updates
Renaming (All References):
- RegionalPrompterSimple → EasyRegionSimple
- RegionalPrompterFlux → EasyRegionFlux
- Category "RegionalPrompter" → "EasyRegion"
- Display names: "EasyRegion (Area-Based)" and "EasyRegion (Mask-Based)"
- Extension names: "Comfy.EasyRegion.Simple" and "Comfy.EasyRegion.Flux"
- Function names: addRegionalPrompterCanvas → addEasyRegionCanvas
- Repository name updated in all docs

Files Updated:
- RegionalPrompting.py: Class names and categories
- __init__.py: NODE_CLASS_MAPPINGS and display names
- js/RegionalPrompting.js: All node type checks and extension registrations
- README.md: Complete rewrite with new branding and updated tips
- CONTEXT.md: Repository name and comprehensive updates

README Improvements:
- Added background_strength and per-region strength documentation
- Emphasized "position regions FAR APART" tip
- Updated strength guidelines (2.5-4.5 for Flux with bg_strength=0.5)
- Improved troubleshooting with soft/blurry region fixes
- Updated example workflow with realistic values

CONTEXT.md Major Updates:
- ✅ FINAL strength values: 2.5, 3.5, 4.0, 4.5 (tested and confirmed)
- ⚠️ Added warning: values above 5.0 cause softness and detail loss
- ✅ Region positioning: FAR APART is critical (left/right thirds)
- ✅ Canvas sizing solution: FIXED 280px height (after 10+ failed dynamic attempts)
- ✅ Region selector bug documentation (1-based UI to 0-based array mapping)
- ✅ Added "Future Enhancement - Help Icon" todo
- Removed outdated strength values (old 5.0-8.0 recommendations)
- Added detailed canvas sizing lessons learned section

Reason for Rebrand:
- Avoid confusion with ImpactPack's "RegionalPrompt" nodes
- "EasyRegion" emphasizes simplified workflow with inline prompts
- Clearer branding distinct from other regional conditioning implementations
2025-11-22 17:24:10 +00:00
Claude ed58b39873 Remove old nodes - keep only enhanced Area/Mask-Based nodes
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)
2025-11-22 13:05:24 +00:00
Claude 12255445ec Fix critical bugs: canvas loading, IndexError, and naming
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.
2025-11-22 03:26:16 +00:00
Claude a7e50789b6 Add enhanced all-in-one Regional Prompter nodes with inline prompts
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!
2025-11-22 01:19:29 +00:00
Claude 7ed633055d Modernize for ComfyUI 0.3.71+ with Flux/Chroma support
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.
2025-11-22 01:10:55 +00:00
Mackerel 09ae5fdac3 fix for last PR, sorry 2023-04-07 14:01:45 -04:00
Mackerel 2935826a89 use os.sep instead of \\ 2023-04-07 01:28:06 -04:00
Davemane42 c63fe1467a more automated installation / fixed index slider throwing floats 2023-04-04 02:08:21 -04:00
Davemane42 55e3baca3a File restructure / MultiLatentComposite 1.0 2023-04-02 03:23:24 -04:00