Skip to content

Bidirectional sync and slider improvements for V2#30

Open
diodiogod wants to merge 9 commits intoshootthesound:mainfrom
diodiogod:integrate-v2
Open

Bidirectional sync and slider improvements for V2#30
diodiogod wants to merge 9 commits intoshootthesound:mainfrom
diodiogod:integrate-v2

Conversation

@diodiogod
Copy link

@diodiogod diodiogod commented Jan 4, 2026

Integrated the features from #13 into your V2 release.

What's included

Bidirectional sync:

  • Text field at bottom of nodes syncs with sliders
  • Supports positional format (1.0, 0.5, 0.8...) and named format (%default=1.0, te1=0.5...)
  • String input overrides sliders when connected (for chaining nodes)

Slider improvements:

  • Click-to-jump (click track to set value)
  • Y-axis hit detection (4px tolerance, prevents accidental activation)
  • Drag continuation (smooth dragging)

Parser:

  • Fully dynamic, no hardcoded architecture patterns
  • Positional format works with any block count
  • Named format supports ranges (in7-8) and categories (te, mid, out)

What's changed

  • V1 nodes: All 5 selective loaders
  • V2 nodes: All 5 combined analyzer+loader nodes
  • ~350 lines total (Python + JavaScript)

Implementation notes

The text field is optional and complementary to sliders. You can use it or ignore it. The slider improvements are independent and work regardless.

You can implement and use whatever features you want from this. The fork will remain available for anyone who needs these features.

diodiogod and others added 9 commits December 18, 2025 18:52
Fixes shootthesound#13 - Workflow persistence and string-based block weight configuration

**Critical Bug Fixes:**
- Fixed preset not updating to "Custom" when manually changing toggles/strengths
- Fixed workflow save/load not restoring block weight values
- Fixed ctrl+z not preserving block configurations

**New Features:**
- Added block_weights_string input (multiline, optional) to all 5 selective loaders
- String input overrides UI when provided
- Added weights_output string return showing actual block configuration
- Simple positional format: "1.00, 0.00, 1.50, ..." for easy copy/paste

**Improvements:**
- Enhanced JavaScript onConfigure for proper widget value restoration
- Python preset widget now auto-updates to "Custom" on manual changes
- Output format simplified to positional list (SDXL: 13 values, FLUX: 57, Z-Image: 30, Wan: 40, Qwen: 60)

All selective LoRA loaders now properly save/load configurations and support reproducible workflows.
- Implement UI→Text sync using onMouseUp hook (non-intrusive)
- Reverted mouse handler to simple working version without callbacks
- Added Text→UI sync on mousedown with delay
- Sync triggers on: preset changes, node creation, workflow load, copy/paste
- Sliders now work smoothly without interference from sync callbacks

Resolves partial sync functionality from issue shootthesound#13
- Text→UI sync: Parse comma-separated values and update sliders
- UI→Text sync: Update string on slider changes via onMouseUp hook
- Added event listeners for text field blur/change events
- Sync works on node creation, workflow load, preset changes, manual edits
- Simple mouse handler preserves slider drag functionality

Issue shootthesound#13 bidirectional sync fully working
- Click on slider handle (±6px) → toggles block on/off
- Click on slider track (±4px vertical tolerance) → jumps to position
- Click outside slider area → toggles block on/off
- Drag on slider track → adjusts value smoothly, continues drag even outside vertical bounds
- Store widget Y position during draw for accurate hit detection
- Convert canvas-absolute coordinates to widget-relative for Y-axis precision
- Bidirectional sync fully working (UI↔Text)

Resolves all requirements from issue shootthesound#13
Complete port of all working features from fork to V1 selective loaders:

Bidirectional Sync:
- Text → UI: Parse string field and update sliders
- UI → Text: Update string when sliders change
- Supports positional format (1.0, 0.5, 0.8...)
- Named format parsed by Python (%%default=1.0, te1=0.5...)

Slider Improvements:
- Y-axis hit detection (4px tolerance)
- Click-to-jump functionality
- Drag continuation support
- Draw position tracking for precise interaction

Sync Triggers:
- Initial population on node creation
- Workflow load/configure sync
- onMouseUp hook for slider drag completion

Applies to all V1 selective loaders:
- SDXLSelectiveLoRALoader
- FLUXSelectiveLoRALoader
- ZImageSelectiveLoRALoader
- WanSelectiveLoRALoader
- QwenSelectiveLoRALoader

Changes: +244 lines (setupBidirectionalSync method, mouse handlers, sync triggers)

Tested: V1 nodes confirmed working with full bidirectional sync
Next: Port to V2 analyzer nodes
V2 Integration (lora_analyzer_v2.py):
- Fixed import: use relative import for _parse_block_weights_string
- Added block_weights_string optional input (multiline text)
- Added weights_output return value (6th return)
- Updated RETURN_TYPES, RETURN_NAMES, OUTPUT_TOOLTIPS
- Added parsing logic with string input priority over sliders
- Generates positional format output for chaining

Positional Format Support (selective_lora_loader.py):
- Added _get_architecture_blocks() helper function
- Enhanced _parse_block_weights_string() to support both formats:
  * Positional: "1.00, 0.50, 0.80, ..." (for chaining nodes)
  * Named: "%default=1.0, te1=0.5, in7-8=1.2" (Inspire Pack style)
- String input now takes priority over UI sliders (fixed!)

Benefits:
- Copy/paste block weights between nodes
- Programmatic weight generation via string connections
- Works on all V1 and V2 nodes (shared parser)

Affected nodes:
- V1: SDXL/FLUX/ZImage/Wan/Qwen SelectiveLoRALoader (5 nodes)
- V2: All combined Analyzer+SelectiveLoader nodes (5 nodes)

Changes: +97 lines total
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant