Commit Graph
77 Commits
Author SHA1 Message Date
Mehdi Chaid 703d685c01 fix(nodes): rename bundle nodes from Flakes to Flake 2026-05-06 16:58:01 -04:00
Mehdi Chaid 2ff14658bb fix(ui): use native family widget, remove gaps, preserve dimensions 2026-05-06 16:57:49 -04:00
Mehdi Chaid e2c4e64cc7 fix(nodes): robustly remove hidden widget input pins via splice and onConfigure 2026-05-06 16:22:04 -04:00
Mehdi Chaid a0092fae3c fix(ui): use imported app for canvas zoom scale in family dropdown 2026-05-06 16:21:58 -04:00
Mehdi Chaid fbdf37c36b fix(flake-cover): store LoRA sibling path instead of copying cover image 2026-05-06 16:21:53 -04:00
Mehdi Chaid d7858fbcdd fix(nodes): remove hidden widget input pins from flake nodes 2026-05-06 15:49:30 -04:00
Mehdi Chaid 834b6429da fix(ui): scale family dropdown options with canvas zoom 2026-05-06 15:49:25 -04:00
Mehdi Chaid 4bcb30de52 fix(preset-cover): remove image copy logic and fallback to checkpoint sibling 2026-05-06 15:38:52 -04:00
Mehdi Chaid d085865404 fix(preset-picker): show full preset name without folder prefix 2026-05-06 15:38:47 -04:00
Mehdi Chaid 003f0359eb fix(flake-stack): replace default options with positive prompt field 2026-05-06 15:38:42 -04:00
Mehdi Chaid e6cd0c788f chore: stop tracking docs/plans/todo.md (local-only) 2026-05-05 16:43:33 -04:00
Mehdi Chaid cd109431fc gitignore plans 2026-05-05 16:41:32 -04:00
Mehdi Chaid 6f24015cc7 feat(pickers): show real on-disk path, scope search, allow up-nav (#66)
Three related improvements to the file selector popups:

- The Load Existing flake picker opens at img/<family_folder>/ derived
  from the active node's selected family (instead of root) and shows
  models/flakes/<rel> in the breadcrumb. The up arrow can still walk
  past the family folder for cross-family use.
- The generic file browser (LoRAs, checkpoints, flakes) header now
  renders models/<type>/<rel>/ instead of a bare /, so the user knows
  exactly which directory the listing came from.
- Search inside the Load Existing picker is now scoped to the current
  folder, matching the breadcrumb. Searching from the family folder
  no longer pulls in unrelated flakes from elsewhere.
- The empty-state message also shows up when navigating into an empty
  family folder (previously only at the root).
2026-05-05 16:35:46 -04:00
Mehdi Chaid 7f956ee70f feat(flake-modal): default LoRA browser to models/loras/img/<family>/ (#64)
Open the LoRA file browser at img/<family_folder>/ instead of the
loras root, derived from the active modal's family dropdown (create
mode) or the existing flake's stored path prefix (edit mode).

The file browser also now falls back to the loras root if the
requested directory doesn't exist on disk, so the UX is forgiving
when a family folder hasn't been populated yet.
2026-05-05 16:32:59 -04:00
Mehdi Chaid b5fdf63cdb feat(flake-modal): default cover image from first LoRA's sibling (#63)
When the user selects a LoRA on a flake and no cover has been picked
yet, fetch the LoRA's sibling image (same basename, .png/.jpg/.webp/...)
from models/loras/ and use it as the flake's default cover.

Triggers from all three LoRA selection paths (file browser, dropdown
change, dropdown blur) but only for the first LoRA on the flake, and
only when no cover file has been chosen by the user. Adds a server
endpoint /flakes/lora_sibling_image mirroring the existing checkpoint
sibling endpoint, with a shared helper.
2026-05-05 16:29:51 -04:00
Mehdi Chaid 37826641e5 feat(model-preset): enlarge hover buttons on selected preset (#68)
The Modify and Remove buttons that appear on hover over a selected
preset were 24x24 with small icons, making them awkward to target.
Bump to 36x36 with 20px icons, larger shadow and gap, and add a
per-button mouseenter scale + brighter background so they feel
clickable when targeted.
2026-05-05 16:24:06 -04:00
Mehdi Chaid c0b8ed68b9 fix(family-dropdown): enlarge and stop click propagation (#67)
The Family dropdown was too small to comfortably click on the Flake
Stack node and clicks were leaking to the LiteGraph canvas on the
Flake Model Preset node, where they triggered the underlying preset
combo. Increase font size, padding, and min-height across all four
widgets, and stop mousedown/click propagation so the canvas no longer
intercepts dropdown opens.

Also introduce a shared FAMILY_FOLDERS / familyFolder helper in utils
to be used by upcoming path-aware features.
2026-05-05 16:19:43 -04:00
Mehdi Chaid 8754e7556c feat: add model family selection with flakes and presets filtering (#62) 2026-05-04 15:42:33 -04:00
Mehdi Chaid 701db3d146 fix: match Flake Model Preset button styling to Flake Stack Add Flake block (#60) 2026-05-04 15:42:27 -04:00
Mehdi Chaid 2acd90ed99 fix: register model_presets folder to enable preset creation (#61) 2026-05-04 15:42:11 -04:00
Mehdi Chaid 5317c07dc5 chore: ignore backup files and remove accidentally committed .bak2 2026-05-01 15:06:43 -04:00
Mehdi Chaid 6ab581f040 refactor: split flake_stack.js into focused modules
Decomposes the ~3800-line flake_stack.js monolith into maintainable
modules:

- api.js        – all server API calls
- utils.js      – DOM helpers, sliders, inputs, drag indicators
- modal.js      – overlay modal infrastructure
- flake-modal.js – flake create/edit modal
- preset-modal.js – preset create/edit modal + preset option refresh
- pickers.js    – file browser, flake picker, preset picker
- widgets/      – per-node widget setups
  - flake-stack.js
  - flake-combo.js
  - flake-model-preset.js
  - flake-model-combo.js
- queue.js      – frontend combination queueing logic
- flake_stack.js – entry point, imports everything and registers extension

Fixes #59
2026-05-01 15:06:12 -04:00
Mehdi Chaid d6f77c73a6 feat: redesign preset selection UI with visual picker popup
- Add openPresetPicker() that shows presets in a searchable grid with
  cover images, matching ComfyUI Load Image dropdown styling.
- Rewrite FlakeModelPreset widget: remove dropdown, add 'Select Preset'
  and 'Create Preset' buttons. When selected, show cover image with
  preset name and hover buttons for Remove/Modify.
- Update FlakeModelCombo widget: remove dropdown, use the visual picker
  when clicking 'Add Preset'.

Fixes #54, Fixes #55, Fixes #57
2026-05-01 14:16:10 -04:00
Mehdi Chaid 8e411b4133 fix: refresh preset options immediately after creating a preset
Adds cache-busting to the preset list fetch and makes widget DOM
updates more robust by trying multiple element selectors. Also
forces a canvas redraw so existing nodes reflect the new preset
without requiring a ComfyUI reload.

Fixes #56
2026-05-01 14:11:05 -04:00
Mehdi Chaid 0b48242fbd fix: make file browser search null-safe and remove redundant keyup listener
Adds String() coercion and null-safety to the file browser search
filter to prevent 'No matches' when entries have unexpected types.
Removes redundant keyup listener since input already covers text changes.

Fixes #58
2026-05-01 14:09:04 -04:00
Mehdi Chaid f7edf61d79 fix(grid-item): show all LoRAs in dropdown when YAML has multiple
Sync entry.loras to the length of the YAML's loras array so every LoRA
gets a strength slider in the grid item panel.

Closes #48
2026-04-29 14:55:35 -04:00
Mehdi Chaid 7573d71c68 feat(checkpoint-image): auto-set preset cover from sibling image and update on swap
- Add /flakes/checkpoint_sibling_image endpoint to find an image next to
the selected checkpoint with the same basename.
- In the preset editor, auto-load that image as cover when a checkpoint is
selected, but only if no cover already exists.
- Poll preset widget value in FlakeModelPreset so cover updates immediately
when the user swaps presets via the dropdown.

Closes #52
2026-04-29 14:54:03 -04:00
Mehdi Chaid ffcfcb10b9 fix(configs): refresh preset dropdown immediately after create/update
Update the DOM <select> options in addition to the widget's internal
values array, and include FlakeModelCombo nodes in the refresh.

Closes #51
2026-04-29 14:50:39 -04:00
Mehdi Chaid 83ffcf87e6 fix(file-picker): double-click to select file and improve search
- Add dblclick handler on file rows to immediately select and close.
- Add keyup fallback for search filtering.
- Add Enter key support to select the first matching file.
- Focus search input when dialog opens.

Closes #50
2026-04-29 14:49:14 -04:00
Mehdi Chaid 40c50f373b fix(new-flake): remove default empty options group
Stop passing data: { options: {} } when opening the create modal so the
options field is not pre-added to activeFields by default.

Closes #49
2026-04-29 14:47:34 -04:00
Mehdi Chaid 54a74e51b4 fix(slider): allow arbitrary decimal values instead of snapping to step
Remove Math.round(v / step) * step from clamp so typed values like 4.7
are preserved. Drag and button clicks still use step math naturally.

Closes #53
2026-04-29 14:46:51 -04:00
Mehdi Chaid 007820c54f Fix option dropdown centering and option font size in item panel
- Increase select and option font-size from 10px to 13px
- Increase height from 22px to 26px to fit larger text
- Fix asymmetric padding (0 18px 0 4px → 0 18px) so selected text is
  truly centered across the full width, not offset by the chevron
- Add text-align:center to each <option> so open dropdown items are centered

Closes #47
2026-04-28 16:42:10 -04:00
Mehdi Chaid 1aa9cb878a Load Existing picker: show all flakes and add double-click selection
- Stop filtering out already-added flakes from the picker list
- Add double-click handler on flake thumbnails to select+close immediately
- Add double-click on folder items to navigate into them
- Update both FlakesStack and FlakesCombo handleLoad call sites

Closes #46
2026-04-28 16:40:09 -04:00
Mehdi Chaid 2f4915bc37 Improve URL toggle and link icon styling in preset and LoRA editors
- Model Preset: move URL input above checkpoint path selector
- Model Preset: make toggle button bigger (14px) with flex centering
- Model Preset: make link icon blue (#4a9eff)
- Flake LoRA editor: same bigger toggle button and blue link icon

Closes #45
2026-04-28 16:38:17 -04:00
Mehdi Chaid ec0b5910b6 Fix _browse to search all roots dynamically instead of first root at import time
- Replace module-level _BROWSE_ROOTS with dynamic _get_browse_roots() called
  at request time. This fixes the Empty folder bug caused by evaluating paths
  before ComfyUI has finished registering them.
- Search ALL configured roots for a given type and merge/deduplicate results,
  matching the behavior of folder_paths.get_filename_list().
- Add security check per-root so symlink escapes are skipped rather than fatal.

Closes #44
2026-04-28 16:35:48 -04:00
Mehdi Chaid 4aa1f7e357 Redesign Load Existing picker with folder navigation and model_presets exclusion
- openFileLoadPicker now accepts {flakes, directories} and builds a folder tree
- Folders rendered as large 📁 icons with labels; clicking navigates into them
- Breadcrumb path bar shows current location; click to return to root
- Up-folder item (..) shown when inside a subfolder
- Search bar filters all flakes globally regardless of folder
- Exclude model_presets/ from both directory tree and search results
- Update both FlakesStack and FlakesCombo handleLoad call sites

Closes #43
2026-04-28 15:09:10 -04:00
Mehdi Chaid ca6f62fbfc Fix checkpoint and LoRA file pickers: correct root path and search bar
- Replace defaultPath: 'img' with '' for both checkpoints and loras pickers
  so they open at the model root instead of a non-existent img/ subfolder
- Add real-time search bar to openFileBrowser overlay filtering files/folders
  in the current directory by name
- Show 'No matches' when search yields no results

Closes #42
2026-04-28 15:04:21 -04:00
Mehdi Chaid b83f24a17d Preserve optional field order in flake YAML on save/load
- Save: build ordered dict by iterating activeFields so YAML keys follow
  the user-dragged order
- Load: derive activeFields from Object.keys(data) order (Python preserves
  insertion order via yaml.safe_dump sort_keys=False)
- Fallback appends any fields not present in the key order

Closes #41
2026-04-28 15:01:27 -04:00
Mehdi Chaid b7b529ba1f Style option dropdowns in item panel to match LoRA slider palette
- Add makePanelDropdown helper with dark background (#1a1a1a), #333 border,
  4px radius, 10px font, 22px height — matching makeSmallValueSlider
- Hide native arrow with appearance:none and add custom SVG chevron
- Center text edge-to-edge using text-align-last:center
- Options now share the same 10px font size as the selected value
- Replace inline select creation in rebuildPanel with makePanelDropdown

Closes #40
2026-04-28 14:58:03 -04:00
Mehdi Chaid ba8bc6ba89 Fix dropdown triangle visibility and remove right-click behavior
- Extract loadOptions() to fetch flake metadata in the background on init
- Call loadOptions() immediately so triangle button shows for flakes with options/loras
- Remove right-click handler that was used as a workaround

Closes #39
2026-04-28 14:55:48 -04:00
Mehdi Chaid 7f63eb0a95 Redesign Load Existing picker with search bar and thumbnail grid
- Replaces file-browser-based load picker with a dedicated overlay
- Shows thumbnail grid with cover images (background-size:cover)
- Search bar filters flakes by name in real time
- Click to select, Cancel / Select buttons in footer

Closes #32
2026-04-28 14:05:54 -04:00
Mehdi Chaid d3460dffdc Fix drag-to-reorder for optional fields in flake edit overlay
- Add proper dragstart/dragover/drop/dragend handlers to field drag handles
- Visual drop indicator shows between fields during drag
- Reorders activeFields array and re-renders on drop

Closes #36
2026-04-28 14:03:56 -04:00
Mehdi Chaid e6ac25c62a Add triangle toggle for URL fields in Preset and LoRA editors
- Model Preset: checkpoint URL hidden by default, toggle with triangle button
  next to Checkpoint label. Blue link icon appears when URL is populated.
- Flake LoRA: replace [...] button with triangle toggle. Header shows LoRA name
  and blue link icon when URL is populated. Full URL no longer shown in header.

Closes #33, closes #34
2026-04-28 14:02:34 -04:00
Mehdi Chaid 73a32e661f File picker: fallback to root directory when default img subdirectory is missing
Closes #31
2026-04-28 13:58:06 -04:00
Mehdi Chaid 43b014d569 Move width and height pins after filename_prefix in Flakes Generation Data
Closes #37
2026-04-28 13:57:34 -04:00
Mehdi Chaid e18f75df38 Support multiple LoRAs per flake with name, URL, and strength
Backend:
- Add LoraEntry dataclass with name, url, path, strength
- Flake dataclass now has loras[] list; legacy lora_path/strength kept for compat
- _flake_from_raw parses both new multi-LoRA and legacy single-LoRA formats
- resolve() applies multi-LoRA strength overrides from grid entries
- full_flake_node.py applies all LoRAs in order

Frontend:
- Flake edit modal: each LoRA gets its own section with name, URL, path picker,
  strength slider. +Add LoRA button to add more. [...] button edits name/URL.
- Grid dropdown: shows one strength slider per LoRA, labeled with LoRA name
- Grid entries store loras[] array of strengths for overrides
- Backward compatibility: old entries with single strength auto-converted

Closes #30
2026-04-28 13:15:36 -04:00
Mehdi Chaid 46da579d5a Add cover image support for Model Presets
- Backend: add save_preset_cover, read_preset_cover, _preset_cover_path helpers
- Backend: add /flakes/preset_cover GET/POST endpoints
- Frontend: add cover image upload box in preset edit modal
- FlakeModelPreset node: displays preset cover image under the dropdown
- FlakeModelCombo grid items: use preset cover as background with dark overlay

Closes #26
2026-04-28 12:56:13 -04:00
Mehdi Chaid c85bd9e149 Implement Python-backed file browser for correct base paths
- Add /flakes/browse API endpoint that returns directory listings
  filtered by file type (checkpoints, loras, flakes)
- Build custom file browser overlay in JavaScript
- Replace all browser-native file pickers with the Python-backed browser:
  - Checkpoint selection defaults to models/checkpoints/img/
  - LoRA selection defaults to models/loras/img/
  - Load Existing defaults to models/flakes/img/
- Remove unused createFilePicker helper

Closes #29
2026-04-28 12:53:24 -04:00
Mehdi Chaid 99ffab6640 Fix drag indicator position and add rightmost drop target
- Replace inset box-shadow with absolutely positioned indicator at left:-3px
  so the blue line appears in the gap between items rather than on the item
- Add dragover/drop handlers to the Add block for dropping after the last item
- Clear all indicators on drag end

Closes #28
2026-04-28 12:47:39 -04:00
Mehdi Chaid 24e4323265 Fix LoRA strength slider missing in grid dropdown and has_lora detection
- Update has_lora flag after editing/saving a flake (both defaultUpdated and saved cases)
- Update has_lora after overriding pending changes to disk
- Fix incorrect lora_path field name: raw YAML uses 'path', not 'lora_path'

Closes #27
2026-04-28 12:43:53 -04:00