Commit Graph
22 Commits
Author SHA1 Message Date
Mehdi Chaid fb039296ab feat: show preset display name in Select a Preset overlay
Add list_preset_display_names to flake_io.py and return display_names
from the /flakes/presets API endpoint. Use the display name (falling
back to last path segment) in the preset picker grid thumbnails.
2026-05-14 09:36:17 -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 1d8ff68929 feat: controlnet type dropdown, input image file selector, auto cover image (#131)
- Make controlnet type a dropdown listing available types (openpose, depth, canny, etc.)
- Replace input image text field with file selector (left side) with image preview
- Redesign CN card layout: image preview on left, type/model/sliders on right
- Add labeled sliders (Str, Start, End) for controlnet
- Auto-set cover image from first controlnet input image if no cover exists
- Add /flakes/cn_types endpoint for listing controlnet types
- Add 'inputs' browse type for file picker to select input images
- Add fetchCnTypes API function
2026-05-13 16:38:39 -04:00
Mehdi Chaid 72e784ae0c fix: remove duplicate entries in VAE and text encoder dropdowns
The _shorten_filenames function was adding both the full filename and the
stem (without extension) to dropdown lists, causing models like VAEs and
text encoders to appear twice (e.g. 'ae' and 'ae.safetensors'). Now only
the stem is returned.

Backend resolution helpers (_resolve_model_name) are added to translate
stem-only names back to full filenames when loading checkpoin/vae/
text_encoder/controlnet models, ensuring backwards compatibility with
existing YAML files that store full filenames.
2026-05-13 12:01:48 -04:00
Mehdi Chaid 577efe9f32 feat: redesign checkpoint area with cover image, VAE, and text encoder in preset modal (#105) 2026-05-13 10:21:05 -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 62c60d8226 feat: configurable output base path + output path for model presets (#83)
Backend:
- /flakes/roots?type=model_presets exposes registered roots so the UI
  can label Default vs Extra base paths.
- save_preset() now accepts base_root_index (which root to write to)
  and output_path (relative location under that root), and old_name
  (so renames/moves migrate the YAML and its cover image cleanly).
- Returns the canonical saved name so the UI can register the new
  preset under the actual on-disk path.
- ModelPreset gained a display_name field stored alongside the YAML.

Frontend:
- New Base Path dropdown and Output Path text field on the create/edit
  preset overlay. Output path auto-prefills from family_folder/preset_name
  (snake-cased) until the user types in it.
- Preset name input is now a display name; the file path is independent.
- Edit mode passes old_name so the backend moves the YAML when the
  user changes either the base path or the output path.
2026-05-12 16:10:47 -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 00f4cf9956 fix: new flakes register under the family-prefixed name (#97)
save_flake() prepends img/<family>/ to the requested name when family
is set, but the API returned the original user-typed path, so the
freshly created grid item pointed at a non-existent name and any
subsequent run errored with FileNotFoundError. Return the resolved
name from the backend and use it for the grid entry.
2026-05-12 15:37:16 -04:00
Mehdi Chaid 41ae1349da fix: stop writing stray top-level path/strength and resolve cover_image to actual image (#100)
- Drop top-level path/strength keys on save when loras[] is present
- Strip them on read so the UI never sees the legacy duplicate
- Resolve LoRA-derived covers to the sibling image path on save so YAML
  never stores a .safetensors path under cover_image
- Backend cover lookup keeps fall-through support for legacy YAMLs that
  still point at a .safetensors weight
2026-05-12 15:33:22 -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 8754e7556c feat: add model family selection with flakes and presets filtering (#62) 2026-05-04 15:42:33 -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 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 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 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 8495c424d9 new model preset improvements 2026-04-26 22:16:56 -04:00
Mehdi Chaid 4b3a0b7819 model preset 2026-04-26 19:08:11 -04:00
Mehdi Chaid 678bb15cfd full flakes 2026-04-26 11:27:44 -04:00
Mehdi Chaid abaf147bf5 Grid UI + on disk write/read of flakes 2026-04-25 15:18:24 -04:00
Mehdi Chaid 6e02eb300d Initial commit 2026-04-25 12:53:38 -04:00