Commit Graph
32 Commits
Author SHA1 Message Date
Mehdi Chaid 567870271a fix: more aggressive model_family widget hide via setWidgetHidden helper (#216)
The previous hide mechanism (computeSize/type/hidden/draw overrides
inline in each widget setup) didn't take effect on the user's frontend
version — model_family stayed visibly rendered when flake_data was
connected.

Refactor into a single setWidgetHidden(widget, hide) helper in utils.js
that stacks every known hide signal:
  - widget.computeSize = () => [0, -4]   (collapse row height)
  - widget.type = "hidden"               (LiteGraph + frontend flag)
  - widget.hidden = true                 (older frontend flag)
  - widget.draw = no-op                  (LiteGraph canvas path)
  - widget.options.serialize = true      (keep value in serialized JSON)
  - widget.element.style.display = none  (modern DOM-widget path)
  - widget.inputEl.style.display = none  (DOM input path)
And the inverse on unhide via a per-widget saved-state WeakMap.

Refs #216
2026-05-21 13:27:03 -04:00
Mehdi Chaid 13da022e49 fix: revert widget detach in #216 — keep model_family in node.widgets (#223)
Closes #223. The previous #216 fix (commit 2db236a) detached the
familyWidget from node.widgets to hide it. That introduced three
regressions:

1. Generation failed with "Required input is missing: model_family".
   The widget was the only carrier for the required model_family value
   in the serialized prompt; once detached, prompt validation rejected
   every job.

2. Node sizes were reset on reload. _updateFamilyVisibility called
   node.setSize(node.computeSize()) on every state transition, and on
   workflow load the 200ms poll fired a transition after onConfigure
   restored the saved size — overriding it.

3. Flake Stack items vanished on reload. Detaching the widget shifted
   the widget value order in the saved JSON: only [flakes_json_value]
   was serialized, but the reload code (correctly) still has the
   widget present, so the saved JSON string landed in model_family
   and flakes_json kept its empty default.

Fix:
- Keep familyWidget permanently in node.widgets so serialization is
  stable and the required input is always sent.
- Hide it visually by stacking computeSize=[0,-4], type="hidden",
  hidden=true, AND a no-op draw override (covers ComfyUI frontends
  that don't honor type/hidden for canvas-drawn COMBO widgets).
- Drop node.setSize from the visibility transition (rely on
  setDirtyCanvas to repaint).
- Defer the initial sync to setTimeout(0) so onConfigure has hydrated
  link state before we read it.
- Add _recoverShiftedWidgets in flake_stack.js onConfigure for
  FlakeStack and FlakeCombo: if model_family looks like JSON and
  flakes_json is at its empty default, swap them so workflows saved
  by the broken version recover their stack contents on next open.
2026-05-20 23:38:41 -04:00
Mehdi Chaid 2db236a8a8 feat: hide model_family on Stack/Combo when flake_data is connected (#216)
The previous attempt (#204 / 36620bd) only set `widget.hidden = true`,
`widget.type = "hidden"`, and zeroed computeSize. On the modern ComfyUI
frontend these flags are not enough — the canvas-drawn COMBO widget
still renders. Result: the model_family dropdown stayed visible on
FlakeStack and FlakeCombo even when an upstream flake_data pin was
connected.

Detach the widget entirely from node.widgets when the input is
connected (saving its prior index so it can be re-inserted in place
when disconnected) and re-add it on disconnect. Also drop the
DOM-querying `_getFamilyWidgetEl` fallback — it relied on label text
that doesn't exist in canvas-drawn widgets and never worked. Run an
initial sync at setup so loaded workflows hide the widget on open
without waiting for the 200ms poll.

Closes #216
2026-05-20 18:37:10 -04:00
Mehdi Chaid 36620bdebf feat: Hide Model Family dropdown when flake_data input is connected (#204) 2026-05-20 10:09:25 -04:00
Mehdi Chaid 2d1c627045 utils: close other option dropdowns when opening a new one
Add global _registerOpenPanel/_unregisterOpenPanel registry in utils.js.
flake-combo.js and flake-stack.js now register their option panels so
opening one automatically closes any other open panel.
2026-05-19 14:22:49 -04:00
Mehdi Chaid 101110af3a feat: add optional Variant Choice Image field per variant choice (#183)
Each variant choice can now have an optional image (picked from the
ComfyUI input browser) stored as variants.<group>.<choice>.image. The
grid item's cover swaps to that image when the choice is selected on a
Flake Combo or Flake Stack, falling back to the base cover otherwise.
Served via new /flakes/variant_image endpoint resolving from the input
directory or the LoRA tree.
2026-05-15 18:28:44 -04:00
Mehdi Chaid a322726f19 feat: show selected variant choice after flake name on grid (#182)
Adds variantSuffix() helper and a refreshName() per grid item so the
displayed name updates live to 'Name (Choice)' when a variant is
selected via the option dropdown, for both Flake Combo and Flake Stack.
2026-05-15 17:52:08 -04:00
Mehdi Chaid 2ef2c5eb00 fix: close option dropdown menu when clicking outside (#185) 2026-05-15 17:48:28 -04:00
Mehdi Chaid 5c1d70869d fix: remove redundant override button and _pendingData edit-caching (#184)
The Edit overlay already persists flakes to disk via PUT /flakes/save, so
the override button (which called an unimported saveFlakeApi) was both
broken and redundant. Refetch flake data after edit instead of caching it
in _pendingData. The per-instance Output Stem override now lives in a
dedicated _output_stem_override field, read server-side accordingly.
2026-05-15 17:46:53 -04:00
Mehdi Chaid a65c84fc6c fix: invalidate list cache on new flake, fix search, default to extra model path (closes #168, closes #169, closes #170)
#168: Call invalidateList() after handleNew so the load picker sees
newly created flakes without a page refresh.

#169: Pre-fetch the full flat LoRA/checkpoint list on browser open;
use it for search so results aren't limited to the current directory.

#170: Auto-select the last (extra) root path in create mode when
more than one base path is configured.
2026-05-14 18:19:11 -04:00
Mehdi Chaid b31f85ba4a fix: move option dropdown button to bottom edge and reorder panel fields (closes #162, closes #163)
Triangle button repositioned from bottom:30% to bottom:3px so it sits
at the grid item's bottom edge without overlapping hover buttons.
Panel field order changed to: Output Stem → LoRA sliders → Variants.
2026-05-14 15:54:48 -04:00
Mehdi Chaid 8f850de4c6 feat: show display name in Load Existing Flake overlay
Add display_names to /flakes/list API response and use them in the
Load Existing Flake picker to show the flake's display name instead
of the path filename as the grid item label.

Closes #137
2026-05-13 21:20:40 -04:00
Mehdi Chaid 906ca729f7 fix(ui): unify grid item hover overlay across Flake Stack, Flake Combo, and Flake Model Combo
- Extract shared grid item helpers (makeGridItemOverlay, makeHoverButton,
  makeTypeRibbon, makeBypassStrike, svgIcon, TYPE_COLORS) into utils.js
- Fix overlay not covering full item in Flake Stack (was using top/left/
  right/bottom:4px instead of inset:0)
- Fix option dropdown button position inconsistency between Stack and Combo
- Use same hover overlay style (inset:0, border-radius:3px) for all three
- Make hover buttons 50% bigger (33px instead of 22px)
- Make triangle dropdown button 50% bigger (18px font instead of 12px)
- Dark overlay always present (not conditional on hasCover), matching
  Model Combo style

Closes #138
2026-05-13 21:11:19 -04:00
Mehdi Chaid 992969f98f feat: redesign Edit/New Flake overlay top section (#130)
- Make cover image bigger (160x200)
- Rename Output_stem label to Output Stem, move to same row as Display Name
- Remove Model family field from New Flake overlay (inferred from node)
- Put Base field on same row as Flake type dropdown
- Add Concept option to Flake type, convert checkboxes to dropdown
- Put Output Path in its own row with resolved path preview
- Strip img/<model_family> prefix from Output Path input, show full resolved path below
- Make Output Stem editable in grid item options dropdown
- Make triangle button appear on hover (white, visible)
- Add Concept to TYPE_COLORS in grid
- Remove Output Filename Stem from Add flake field dropdown (now in top section)
2026-05-13 16:33:14 -04:00
Mehdi Chaid 51acc08e24 style: change disabled bar to diagonal and brighter
- Rotate bypassed bar from horizontal (-) to diagonal (/) with -30deg
- Increase bar thickness from 2px to 2.5px
- Brighten bar color from rgba(200,60,60,0.7) to rgba(230,90,90,0.85)
- Applied to both flake-stack and flake-combo grid items

Closes #129
2026-05-13 16:19:47 -04:00
Mehdi Chaid 0de72d4bae fix: hover buttons overlap grid item sides and options dropdown not clickable (closes #128)
- Add 4px inset padding to hover button overlay so buttons stay within
  grid item bounds when node size increases
- Raise triangle button z-index from 2 to 4 (above hover buttons at 3)
  so it remains clickable when hover buttons are visible
2026-05-13 16:16:51 -04:00
Mehdi Chaid 84c304dbb2 feat: add bypassed state toggle to Flake Type ribbon
- Clicking the ribbon toggles a flake between active and bypassed states
- Bypassed flakes show greyed out appearance with a red strikethrough line
- Bypassed ribbon is dimmed with click-to-activate tooltip
- Backend (FlakeStack.execute) skips bypassed flakes during processing
- Bypassed state stored as 'bypassed' field in flakes_json entries
- Works in both FlakeStack and FlakeCombo grid items

Closes #121
2026-05-13 12:40:15 -04:00
Mehdi Chaid 6aa6b3d4aa feat: use same SVG icons as Model Preset for Flake Stack grid buttons (#109) 2026-05-13 10:25:39 -04:00
Mehdi Chaid 1cbe049c0e feat: configurable output base path + flake path for flakes (#91)
Mirror the model-preset base-path support on the flake side:

Backend:
- save_flake() now accepts base_root_index, output_path, and old_name,
  using the same semantics as save_preset(). Renames/moves migrate the
  YAML and its cover image.
- /flakes/save now passes those through to save_flake.

Frontend:
- Base Path dropdown + Output Path text field on the flake create AND
  edit overlays (populated from /flakes/roots?type=flakes).
- Path prefill from display name + flake type only fires in create
  mode; edit mode seeds from the existing flake name and treats it
  as user-edited.
- Save call now uses /flakes/save with base_root_index/output_path/
  old_name, and flake-stack.js updates the entry's name if the saved
  canonical name differs (i.e. the flake was moved).
2026-05-12 16:13:45 -04:00
Mehdi Chaid 3cfa7320b2 feat: drag-and-drop reorder on full flake card; remove side handle (#89)
Set draggable on the whole grid item and remove the 3px vertical bar
on the left. Buttons inside the card cancel the drag so clicks on
Replace/Edit/Remove still work, and double-click-to-edit remains
intact (the browser only kicks off a drag after meaningful pointer
movement).
2026-05-12 15:51:35 -04:00
Mehdi Chaid 181637caea feat: Replace/Edit/Remove hover buttons on Flake Stack grid items (#88)
Mirror the Flake Model Preset hover-button pattern: each non-default
flake card shows three centered buttons on hover (Replace, Edit,
Remove). Removes the static top-right ✕. Double-click-to-edit is
preserved; the override (💾) badge stays pinned top-right when the
entry has unsaved in-memory changes. Replace opens the existing load
picker and swaps the entry in place.
2026-05-12 15:50:53 -04:00
Mehdi Chaid babfffc2f1 refactor: rename flake field 'options' to 'variants' (#93)
- YAML: write 'variants:' going forward; reads still accept 'options:'
  as a legacy alias and migrate it on next save.
- Flake.variants dataclass field renamed; entry payload now reads
  'variant' for the per-stack override (legacy 'option' still works).
- UI: button labels (+ variant group), field selector label (Variants),
  empty-state text, alert wording all updated.
- /flakes/meta returns both 'variants' and 'options' keys for one
  transitional release.
- README updated to reflect the new key.
2026-05-12 15:47:24 -04:00
Mehdi Chaid 92fa2ca5cb fix: always render the Flake Type ribbon on grid items (#90)
The ribbon was conditional on entry.flake_type being populated, but
loaded/created entries never copied flake_type from the YAML, so the
ribbon vanished after the modal closed. Always render the ribbon for
non-default entries, defaulting to Other when no type is set, and
populate entry.flake_type when loading/creating/saving.
2026-05-12 15:42:37 -04:00
Mehdi Chaid c330ae3ab2 fix: reset grid-item overrides when a flake's defaults change (#98)
After Edit Flake saves, sync the entry's lora strength overrides to the
new defaults and prune option-group overrides that no longer exist.
Previously the override array kept a stale 0.9 strength after the
default moved to 0.7, masking the new default with no UI indication.
2026-05-12 15:39:39 -04:00
Mehdi Chaid 023a112623 fix: invalidate FlakeStack cache when an entry is edited inline (#94)
Saving an edit updated the flake YAML on disk but flakes_json (the
node input) was unchanged for already-loaded entries, so ComfyUI
reused the cached FlakeStack output and the next generation still
saw the old values. Stamp _edited_at on each save so the JSON differs
and the node re-executes (which then re-reads from disk).
2026-05-12 15:35:16 -04:00
Mehdi Chaid cba952df7c fix(ui): preset buttons, default flake fields, cover image, grid names, family preselect, flake type tags, path prefill, add-field scroll (#75-#82) 2026-05-07 19:52:00 -04:00
Mehdi Chaid fed99d81da fix(ui): revert preset/flakes UI, keep native family widget 2026-05-06 17:14:06 -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 834b6429da fix(ui): scale family dropdown options with canvas zoom 2026-05-06 15:49:25 -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 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