Commit Graph
33 Commits
Author SHA1 Message Date
Mehdi Chaid 9eb9789b24 feat: ControlNet image-dimensions resolution override + two-row slider layout (#260)
Adds a per-CN 'Img res' checkbox (resolution_from_image) that drives the
generation resolution from the control image's dimensions, taking
precedence over the flake resolution. Restructures the strength/start/end
row to labels-on-top / fields-on-bottom and places the checkbox alongside
them. Backend reads the flagged entry's image size before the CN apply
loop (so _fit_cn_image is a no-op for it).
2026-06-02 20:15:48 -04:00
Mehdi Chaid a94cf2c0ff fix: preserve upstream ControlNets when chaining Flake nodes (#257)
Each Flake node re-encodes the accumulated prompt text, producing fresh
conditioning that dropped the 'control' chain attached by upstream nodes
— so a controlnet on an earlier FlakeStack/FlakeCombo was silently
discarded and only the last node's controlnets applied. Snapshot the
incoming conditioning and carry its 'control' (and control_apply_to_uncond)
onto the re-encoded conditioning so this node's controlnets chain on top
via set_previous_controlnet.
2026-06-02 13:10:20 -04:00
Mehdi Chaid 210c502c1b fix: fit ControlNet hint image to the generation frame (#255)
The control image was applied before the target resolution was known, so
ComfyUI stretched the hint to the latent size at sample time, distorting
the pose whenever the control image aspect differed from the generation
resolution. Resolve the resolution first and crop-and-resize each hint to
it (lanczos, center crop) before apply_controlnet, matching A1111's
default. Also logs the fitted size.
2026-06-02 12:30:25 -04:00
Mehdi Chaid 81e812feb3 fix: resolve ControlNet models from the family subfolder (#254)
SDXL controlnets live under models/controlnet/sdxl/ and ZImage under
.../zimage/. Add resolve_cn_model_name() which prefers the family's
controlnet subfolder and fuzzy-matches dash/version-named files (e.g.
controlnet-scribble-sdxl-1.0) against the inferred name, falling back to
the generic global resolver for flat layouts. Wire it into FlakeStack.
2026-06-02 12:22:47 -04:00
Mehdi Chaid e1abb97643 fix: ensure default flake serialization and always re-infer controlnet model from preset family (#251) 2026-06-02 11:48:01 -04:00
Mehdi Chaid 96819aadf3 feat: add controlnet debug logging for model/image/params (#250) 2026-06-02 11:21:41 -04:00
Mehdi Chaid 8e6f66aaf1 fix: resolve controlnet models in subdirectories (#251) 2026-06-02 11:21:12 -04:00
Mehdi Chaid c591dd4362 fix: guard against empty ControlNet image_name to prevent crash (#248) 2026-05-30 15:34:05 -04:00
Mehdi Chaid 12ad0223e9 feat: infer ControlNet model from type + model family, remove model file field (#246) 2026-05-30 14:37:34 -04:00
Mehdi Chaid 7ba61869e9 fix: skip controlnet entries with empty model_name (#243) 2026-05-28 10:40:48 -04:00
Mehdi Chaid a69741867a fix: re-add img/<model_family>/ structural prefix to output path (#240)
After #217 dropped the preset's yaml folder path from
filename_state["preset"], the structural img/<family>/ segment was
also lost — outputs landed at output/<rest>/... instead of
output/img/<family>/<rest>/...

Re-introduce it explicitly: _load_preset_bundle now takes model_family
and prepends "img/<family>/" to the stems list (it contains "/", so
_build_filename_prefix routes it into folder_parts). The explicit
filename_prefix field still contributes its own non-folder segment
afterwards. Thread model_family through FlakeModelPreset.execute, and
FlakeModelCombo inherits it automatically.

Closes #240
2026-05-22 10:10:39 -04:00
Mehdi Chaid abc9ec5515 fix: Model Preset filename prefix optional, drop yaml-path inheritance (#217)
Two bugs in one:

1. `_load_preset_bundle` used the preset's full yaml-relative name
   (e.g. img/illustrious/nova/nova_anime_xl_v17) as filename_state["preset"],
   which leaked into the output directory structure. The user expects
   the output path to derive only from the explicit Filename Prefix
   field on the preset — not from where the yaml file happens to live
   on disk. Set preset to "" and let the explicit prefix (added via
   stems) be the sole contributor.

2. The preset modal's syncOutputPath() unconditionally rewrote
   filenamePrefixInput.value from the Name field every time the user
   typed in Name. The user could never keep an empty or customized
   prefix. Add filenamePrefixManuallyEdited tracking (mirroring the
   existing pathManuallyEdited pattern) so once the user touches the
   field, sync stops clobbering it.

Closes #217
2026-05-20 18:36:42 -04:00
Mehdi Chaid 64ebdc6a81 fix: Filename prefix path missing img/<model_family> structure (#206) 2026-05-20 10:01:00 -04:00
Mehdi Chaid 6959c6a4bc full_flake_node: filter empty stems to prevent trailing underscore in filename
Skip empty stem values when building the filename prefix so that
generations without prefixes produce 09-58-35_00001.png instead of
09-58-35_00001_.png
2026-05-19 14:22:56 -04:00
Mehdi Chaid 6fe4a55c99 fix: re-run FlakeModelPreset when preset file changes on disk (#194) 2026-05-18 23:11:57 -04:00
Mehdi Chaid ada88cd1f6 fix: preserve output stems across chained FlakeStack nodes and apply runtime overrides (closes #171)
Stems no longer reset to [] on each FlakeStack — they accumulate across
the chain by preserving the incoming list. Runtime output_stem overrides
from the option panel dropdown are now applied by resolve() reading
_pendingData.output_stem from the serialised entry.
2026-05-14 18:16:44 -04:00
Mehdi Chaid 6e2fe634db feat: add Flake Generate node - KSampler + VAE Decode + Save Image wrapper (#141)
Creates FlakeGenerate node that takes flake_data input, runs KSampler, VAE Decode, and SaveImage internally. Displays seed widget with randomize/increment/decrement controls, 2x2 preview grid (reusing flake-preview.js), and generated image preview in a single DOM widget.
2026-05-14 10:12:27 -04:00
Mehdi Chaid 122c50d174 fix: implement Preview Flake Data with 2x2 grid and click-to-view overlays 2026-05-13 21:13: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 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 dfb0411819 refactor: replace 3-pin model_bundle/generation_data/sampling_preset with single flake_data pin (#112)
- FlakeModelPreset now outputs a single FLAKE_DATA pin
- FlakeStack now takes and returns a single FLAKE_DATA pin
- FlakeDataSplit(All/Select) now output all 12 individual types directly
- IntoFlakeData(All/Select) now take individual Comfy types as optional inputs
- Removed FlakesModel, FlakesCond, FlakesSampler (replaced by FlakeDataSplitAll)
- Removed flake_unpack_nodes.py entirely
2026-05-13 11:04:42 -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 f6b97619b7 fix: reset filename_prefix stems each execution to prevent recursive output paths (#96)
FlakeStack.execute() was appending to generation_data[7]['stems'] in
place. When ComfyUI re-used the cached tuple from a prior run, each
queued generation compounded the output_stem, producing paths like
frieren/frieren/frieren/... after a few runs.

Build a fresh stems list every execution; preserve only the preset name
from any upstream filename state.
2026-05-12 15:33:40 -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 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 f030f6fe98 Add Output Filename Stem support connected to Save Image filename_prefix
- Model Preset initializes filename prefix with <PresetName>/
- New optional 'Output Filename Stem' field in flakes editor
- FlakeStack collects stems from all flakes and builds prefix:
  - Folder stems (containing '/') are appended to path
  - Date folder <YYYY-MM-DD> inserted after last folder stem
  - Filename starts with <HH-MM-SS> followed by _ separated file stems
- FlakesGenerationData converter outputs filename_prefix as 6th pin

Closes #24
2026-04-28 11:44:52 -04:00
Mehdi Chaid 3795fd2e37 feat: implement frontend queueing for FlakeCombo and FlakeModelCombo 2026-04-27 18:23:50 -04:00
Mehdi Chaid d0c804ea08 feat: extract FlakeModelPreset, update FlakeStack chaining, add FlakeCombo/FlakeModelCombo stubs, rename converter inputs 2026-04-27 16:24:20 -04:00
Mehdi Chaid 25dadd99ef fix lora path 2026-04-27 00:15:12 -04:00
Mehdi Chaid 4b3a0b7819 model preset 2026-04-26 19:08:11 -04:00
Mehdi Chaid 7c5881c31c Update styling to match comfyUI widgets 2026-04-26 15:17:27 -04:00
Mehdi Chaid 67fd78fb5f Flake packs and preset 2026-04-26 12:38:47 -04:00
Mehdi Chaid 678bb15cfd full flakes 2026-04-26 11:27:44 -04:00