Commit Graph
16 Commits
Author SHA1 Message Date
Mehdi Chaid e50ea96f9d feat: Generation Data overlay layout + ADetailer A/B toggle (#324, #328)
- Widen the overlay and switch the combo view to a 33/67 left/right split.
- Increase the preview/composite image size to 384px.
- Make combo-axis card grids wrap instead of horizontal-scroll.
- Add ADetailer/Upscale settings as a new 'Generation settings' section.
- Store ADetailer A/B outputs per combo key in queue.js; add an A/B toggle
  below the image dimensions to switch between regular and ADetailer outputs
  in the overlay (#328).
2026-06-19 14:22:49 -04:00
Mehdi Chaid ff46e2789c fix: exclude bypassed/muted combo nodes from generation (#304) 2026-06-17 14:17:13 -04:00
Mehdi Chaid 85f030a874 feat: per-instance model-preset overrides (filename/steps/cfg/sampler/scheduler) (#279) 2026-06-15 15:34:03 -04:00
Mehdi Chaid a4dd9357ba feat: per-preset enable/disable toggle in Flake Model Combo (#266) 2026-06-04 20:32:58 -04:00
Mehdi Chaid 01eb1e0154 fix: nest combo batch loops by graph connection order (#265) 2026-06-04 20:26:15 -04:00
Mehdi Chaid 9c927b5011 fix: combo highlight + progress for first generation (#241)
Two parts:

1. queue.js: websocket events (execution_start / executed / etc.) can
   arrive on the websocket transport BEFORE the REST response that
   gives us their prompt_id. The previous handlers looked up the pid
   in promptIds and bailed when it wasn't found — so the very first
   generation in a batch consistently lost its highlight and per-combo
   image stamp, and the overlay missed its progress events.

   Add a pendingByPid event buffer. When an event arrives for an
   unknown pid, queue it. When the patched api.queuePrompt finally
   resolves and registers the pid, replay the buffered events for it.
   Snapshot _currentBatchComboKey at call time so the queued combo key
   stays correct even if the await resolves out of order.

2. generation-data.js: when the overlay opens mid-batch, seed the
   progress bar on the currently-running combo's grid cards by
   reading _activeBatch.runningPromptId synchronously. Without this,
   a late-opened overlay only started showing progress on the *next*
   running combo.

Closes #241
2026-05-22 10:10:25 -04:00
Mehdi Chaid d79b3f6904 feat: overlay panel split, dedup, width, progress bars, aspect ratio (#228, #229, #230, #231)
#228 — combinationData() now returns separate {commonLoraRows,
commonPromptRows} (from Model Preset + Flake Stack) and
{comboLoraRows, comboPromptRows} (from ALL flake-axis selected
entries, not just the first). The right panel renders only common;
the left panel below the combo grids renders only combo. Previously
the right panel showed both, and the left panel only showed the
first combo axis — so second-combo data leaked right and was missing
on the left.

#229 — Reduce overlay max-width from min(1400px, 95vw) to
min(980px, 66vw) (30% smaller per the spec). Shrink the gap between
left and right panels from 14px to 8px.

#230 — Progress bars on combo grid items while the corresponding
combo is the currently-running job. queue.js exports an _activeBatch
view (promptIds + comboKeys + runningPromptId); the overlay
subscribes to the ComfyUI api `progress` websocket event, maps the
running prompt_id back to its comboKey, parses the comboKey into
[nodeId, itemIdx] pairs, and updates the matching cards' progress
bars. Cleared on execution_success/error/interrupted and unsubscribed
on overlay close.

#231 — Composite preview image aspect ratio now matches the output
resolution (combinationData reports {width, height} from the active
preset). applyAspectRatio() sizes the image to fit within a 256px
square while preserving the output's ratio (e.g. a 1200x800 preset
yields a 256x171 preview).

Closes #228
Closes #229
Closes #230
Closes #231
2026-05-21 15:15:24 -04:00
Mehdi Chaid d865208f3d feat: Flake Generate node — Total jobs label, [i/N] done progress, narrower button (#227)
- Rename "Jobs: N" → "Total jobs: N".
- Add "[i/N] done" sub-label below it, updated as each prompt in the
  batch finishes. queue.js writes _batch_completed_count and
  _batch_total_count onto every FlakeGenerate node and invokes the
  node's _batch_progress_render() callback; resets to 0/N at batch
  start.
- Shrink the Generation Data button to fit its label + a bit of
  padding (flex:0 0 auto, inline-flex, white-space:nowrap) instead of
  stretching across the row.

Closes #227
2026-05-21 14:56:04 -04:00
Mehdi Chaid 6156aa11e0 fix: capture prompt_id via api.queuePrompt patch for combo highlight (#207, #222)
Devtools console confirmed the previous defensive fallback's warning:
\`[flakes] queuePrompt result missing prompt_id; combo highlight may
not work for this batch.\` In current ComfyUI frontends, app.queuePrompt
returns void — the {prompt_id, number, node_errors} response only
flows through the lower-level api.queuePrompt call inside it.

Patch api.queuePrompt for the duration of each batch. The outer loop
sets _currentBatchComboKey before each combo's queue call; the patch
captures the returned prompt_id and pushes [promptId, comboKey] into
the parallel arrays the event listeners read. Restore the original
api.queuePrompt in the tracker cleanup.

This unblocks both:
- #207: setComboHighlight via execution_start now matches the right
  combination, so the blue border draws on the correct grid item.
- #222: per-combo image storage via the executed event now writes to
  the right combo key on the FlakeGenerate node, so the overlay
  composite image stops collapsing to the last-generated combo.

Closes #207
Closes #222
2026-05-21 13:26:54 -04:00
Mehdi Chaid 3c2a8a15c0 fix: per-combo image storage races, defensive batch tracking (#222, #207)
#222 — flake-generate.js used `node._pending_combination_key` to tag
the upcoming prompt's combo, and the FlakeGenerate node read that key
in onExecuted to stamp the generated image into _images_by_combo. But
queue.js's batch loop advanced the key for the next combo *before* the
previous onExecuted fired, so every image ended up filed under the
last combo's key — the overlay then only displayed the last option.

Move the per-combo storage into queue.js, keyed by prompt_id via the
`executed` websocket event. Maintain a `comboKeys` array parallel to
`promptIds` so an event's prompt_id maps unambiguously to the combo
that produced it, regardless of how many prompts are in flight.
flake-generate.js still records the empty-key image as a safety net
for single-prompt (no combo) runs.

#207 — Make batch tracking defensive against frontend variation:
- Resolve the ComfyUI api singleton from several known locations
  (comfyAPI.api.api, comfyAPI.api, app.api, window.app.api) and warn
  to the console if none are found instead of silently failing.
- Warn when _originalQueuePrompt returns no prompt_id (highlight and
  per-combo image tagging both depend on it).

Closes #222
Refs #207 (defensive helpers; runtime verification still pending the user)
2026-05-20 18:38:12 -04:00
Mehdi Chaid 043c50ff72 feat: highlight current combo item during batch generation (#207)
Use ComfyUI execution_start / execution_success / execution_error /
execution_interrupted websocket events to track which queued prompt
is currently running, and highlight the corresponding flake/preset
grid item in FlakeCombo and FlakeModelCombo nodes. Highlights are
cleared only after all batch jobs finish, not immediately after the
queuePrompt HTTP response.
2026-05-20 10:39:21 -04:00
Mehdi Chaid f8c82d4ea4 feat: combine Models+Inputs into Generation Data combination overlay (#188, #189, #190, #191)
Replaces the two Models/Inputs preview buttons with a single Generation
Data button (#188) opening a split overlay:

- Left half: one horizontal-scroll grid per upstream Flake Model Combo /
  Flake Combo node, defaulting to the first item, selectable (#189).
- Right half: model/output/LoRA/prompt data for the selected combination
  only, pulling fixed preset + common stack flakes + the chosen combo
  flake per axis (#190).
- Top of right half: k-d-tree composite of the selected combo covers
  (top half + bottom quarters for the 3-item case), with a
  'No image generated yet' label that swaps to the actual output +
  filename once that combination has been generated (#191).

queue.js stamps an order-independent combination key onto FlakeGenerate
before each queued prompt so onExecuted can map outputs to combinations.
closes #187
2026-05-15 21:57:43 -04:00
Mehdi Chaid 9ff0abc2b0 feat: highlight active combo item during generation (#181)
While queueing the cartesian product of jobs, each FlakeCombo and
FlakeModelCombo node highlights (blue border + glow) the flake/preset
being used for the current combination via a transient
_combo_generating_index, cleared when generation finishes.
2026-05-15 19:27:07 -04:00
Mehdi Chaid 1cba0f8e4c feat: replace queue confirmation popup with live 'Jobs: N' label (#180)
Removes the 'This will queue N prompts. Continue?' confirm() and adds a
Jobs: N label to the Flake Generate node (left of the preview buttons)
that polls computeJobCount() and updates as flakes are added/removed in
connected FlakeCombo / FlakeModelCombo nodes. Bypassed flakes excluded
(shared with #179 logic).
2026-05-15 19:22:33 -04:00
Mehdi Chaid 91de1adde4 fix: exclude bypassed flakes from FlakeCombo job queue (#179)
Bypassed (crossed-out) combo flakes were still multiplied into the
cartesian product of queued jobs. They are now filtered out so the job
count reflects only active flakes (e.g. two 4-flake combos with 2
bypassed each = 4 jobs, not 16).
2026-05-15 19:16:17 -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