Bidirectional sync and slider improvements for V2#30
Open
diodiogod wants to merge 9 commits intoshootthesound:mainfrom
Open
Bidirectional sync and slider improvements for V2#30diodiogod wants to merge 9 commits intoshootthesound:mainfrom
diodiogod wants to merge 9 commits intoshootthesound:mainfrom
Conversation
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
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Integrated the features from #13 into your V2 release.
What's included
Bidirectional sync:
Slider improvements:
Parser:
What's changed
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.