Claude 3958672c19 Fix critical bugs: canvas overlap, widget conflicts, README length
THREE MAJOR FIXES:

1. 🐛 FIXED WIDGET NAME CONFLICTS (Validation Error Fix)
   - ROOT CAUSE: Duplicate widget names "width" and "height"
     - Image dimension widgets: width, height (from INPUT_TYPES, at top)
     - Box dimension widgets: width, height (from CUSTOM_INT, at bottom)
   - SYMPTOM: "Value 0 smaller than min of 64" validation errors
     - When node created, box widgets initialized to 0
     - ComfyUI validator checked BOTH widgets named "width"
     - Found box widget with value 0 (< 64 minimum) → FAIL
   - FIX: Renamed box widgets to avoid conflict
     - x → box_x
     - y → box_y
     - width → box_w
     - height → box_h
   - RESULT: No more naming conflicts, validation passes
   - Location: RegionalPrompting.js (lines 336-340 for both nodes)
   - Also fixed: Default strength fallback from 1.0 → 0.8

2. 🎨 FIXED CANVAS OVERLAP (Widget Obscuring Canvas)
   - ROOT CAUSE: MIN_SIZE = 200px was too small
     - Canvas minimum height only 200px
     - 5 widgets below canvas (index, box_x, box_y, box_w, box_h, strength)
     - Each widget ~29px → 145px total widget height
     - Only 55px left for actual canvas visibility
     - Widgets visually overlapped canvas area
   - SYMPTOM: User reported "widgets obscuring canvas view"
     - Canvas barely visible, looked "janky"
     - Strength slider overlapping grid
   - FIX: Increased MIN_SIZE from 200 → 450
     - Guarantees 450px minimum canvas height
     - Widgets pushed further down, no overlap
     - Node auto-expands vertically to accommodate
   - Location: utils.js computeCanvasSize() (line 137)

3. 📝 DRASTICALLY SHORTENED README
   - BEFORE: 521 lines of verbose documentation
   - AFTER: 89 lines of concise, essential information
   - REDUCTION: 83% shorter
   - KEPT: Quick start, node descriptions, troubleshooting, examples
   - REMOVED: Verbose explanations, repetitive sections, fluff
   - RESULT: Respects user's time, much more usable

IMPACT:
- ✅ Validation errors fixed (widget naming conflict resolved)
- ✅ Canvas fully visible (no widget overlap)
- ✅ Clearer widget labels (box_x/box_y/box_w/box_h vs top width/height)
- ✅ README actually usable (83% shorter)

User can now:
- Load workflows without validation errors
- See the full canvas without obstruction
- Understand widget purpose (box dimensions vs image dimensions)
- Read documentation without scrolling for miles
2025-11-22 04:26:44 +00:00
2024-04-01 20:59:02 -04:00

ComfyUI Regional Conditioning

Control different parts of your image with separate prompts using visual box drawing.

Quick Start

  1. Install: Clone to ComfyUI/custom_nodes/ or use ComfyUI Manager
  2. Add Node: Search for "Regional Prompter"
  3. Connect: CLIP → Regional Prompter → Sampler
  4. Draw: Use canvas to position regions, type prompts
  5. Generate: Connect to your sampler and run

Nodes

Regional Prompter (Mask-Based)

For: Flux, Chroma, SD3, SD3.5, Qwen-Image

Inputs:

  • clip: CLIP from checkpoint
  • width/height: Must match your latent dimensions
  • soften_masks: Feathering at edges (recommended ON)
  • background_prompt: Scene description
  • region1-4_prompt: Region-specific prompts

Tips:

  • Use CFG 1.0-3.5 with Flux (higher = blur)
  • Keep to 3-4 regions max for Flux/Chroma
  • Default strength 0.8 works well

Regional Prompter (Area-Based)

For: SD1.5, SD2.x, SDXL

Same interface, uses area-based conditioning instead of masks.

Canvas Controls

  • index: Select which region to edit
  • box_x, box_y: Region top-left position
  • box_w, box_h: Region dimensions
  • strength: Conditioning strength (0-10, default 0.8)

Example Workflow

Checkpoint Loader
├→ CLIP → Regional Prompter (Mask-Based)
│           ├ width: 1024
│           ├ height: 1024
│           ├ soften_masks: true
│           ├ background: "city street"
│           ├ region1: "red sports car"
│           └ region2: "street vendor"
├→ MODEL → KSampler ← conditioning
└→ VAE → VAE Decode

Troubleshooting

Regions not showing:

  • Check width/height match your latent exactly
  • Try lower CFG (1.0-2.0) with Flux
  • Verify boxes aren't outside image bounds

Validation errors:

  • Ensure width/height are multiples of 64
  • Check no regions overlap fullscreen

Blurry output:

  • Lower CFG (Flux likes 1.0-3.5)
  • Try strength 0.6-0.8 instead of 1.0

Advanced Nodes

Original nodes available for complex workflows:

  • Multi Area Conditioning: Area-based, requires external CLIP encode
  • Multi Area Conditioning Mask: Mask-based, requires external CLIP encode
  • Multi Latent Composite: Visual latent compositing with feathering

Credits

Based on visual area conditioning by Davemane42.

Maintained by EnragedAntelope - github.com/EnragedAntelope/ComfyUI_RegionalConditioning

License

MIT License - use freely in personal and commercial projects.

S
Description
No description provided
Readme
28 MiB
Languages
JavaScript 53.9%
Python 46.1%