Commit Graph
42 Commits
Author SHA1 Message Date
Jason HokuandClaude Opus 4.6 9e7911aa23 feat: SeedVR2 upscale mode in Builder UI and Dashboard
Adds SeedVR2 as a new upscale mode alongside HiRes Fix, Model Upscale,
and Model+HiRes. Requires ComfyUI-SeedVR2_VideoUpscaler to be installed
as a dependency — the plugin calls its nodes programmatically.

Data Model:
- New seedvr2 options object on each upscale step with all SeedVR2
  parameters: dit_model, resolution, max_resolution, seed,
  color_correction, batch_size, noise scales, blocks_to_swap,
  attention_mode, offload_device, cache_model, VAE tiling options
- _defaultSeedVR2Options() / createDefaultSeedVR2Options() helpers
- Migration: ensureStepFields adds seedvr2 defaults to existing configs

Builder UI (conf-builder-config-management.js):
- "SeedVR2 Upscale" added to mode dropdown
- When selected, shows full SeedVR2 settings: DiT model selection
  (10 variants: 3B/7B x fp16/fp8/GGUF/sharp), resolution, seed,
  color correction, noise scales, batch size, VRAM optimization
  (blocks_to_swap, attention_mode, offload), VAE tiling with
  conditional encode/decode tile size and overlap fields

Dashboard (logic_upscale_modal.js):
- Same SeedVR2 mode and fields in renderPipelineEditor via _renderStep
- All fields use existing _makeSelect/_makeNumber/_makeCheckbox helpers

Python Execution (image_generation.py):
- New seedvr2_upscale(pil_image, seedvr2_config) function
- Imports SeedVR2 nodes from NODE_CLASS_MAPPINGS at runtime
- Calls SeedVR2LoadDiTModel → SeedVR2LoadVAEModel → SeedVR2VideoUpscaler
- Converts PIL→tensor→SeedVR2→tensor→PIL
- Clear error if SeedVR2 not installed

Pipeline Integration (generation_orchestrator.py):
- Inline upscale path: mode=="seedvr2" branch decodes current latent
  to PIL, calls seedvr2_upscale, saves result, updates manifest
- Supports chained steps: non-final SeedVR2 steps re-encode to latent
  for the next step in the pipeline

Preset compatible: seedvr2 config serializes naturally as JSON, saved
and loaded with upscale presets without any special handling.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-12 12:29:00 -07:00
Jason HokuandClaude Opus 4.6 1d86313fcc fix: distribution wait loop timeout prevents infinite block
The master's wait-for-workers loop could block forever if a worker
crashed without cleanup, leaving a job in "Claimed" state. The
_release_timed_out_jobs() was only called during claim_job, never
during the wait loop.

Fixes:
- Call release_timed_out_jobs() every 5s during the wait loop to
  reclaim jobs from dead workers (no heartbeat)
- Add configurable wait_timeout (default 600s/10min) from distribution
  config — after timeout, force-reclaim all remaining claimed jobs and
  proceed to finalization instead of looping forever
- Add public release_timed_out_jobs() method to DistributionManager
- Remaining jobs after timeout are marked completed and abandoned with
  a warning, unblocking the ComfyUI queue

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-30 09:59:57 -07:00
Jason HokuandClaude Opus 4.6 d46ec6a9b0 feat: upscaling support in distributed mode
Workers now generate base images only, and the master runs all upscale
pipelines after distributed generation completes. Uses the existing
run_deferred_upscales() function. The warning message now says upscales
will run on master after collection instead of "not supported."

Builds deferred queue from all generated items in existing_data, runs
after remote VAE cleanup but before final manifest save.

Also adds model count endpoint for fast change detection.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-25 22:27:25 -07:00
Jason HokuandClaude Opus 4.6 5ee1834587 feat: LoRA weight array Cartesian expansion in generation pipeline
Add _expand_lora_weight_arrays() that expands bracket notation in LoRA
strength fields into Cartesian product of configs:
  lora1:[0.5, 1.0]:1.0 + lora2:0.8:[0.7, 1.0] → 4 configs

Distinguishes weight arrays (brackets in strength after :) from folder
random syntax (brackets in name before :). Runs before folder expansion
so both features work together correctly.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-24 16:05:58 -07:00
Jason HokuandClaude Opus 4.6 7d7324d880 fix: worker submission race condition after master finishes
The delayed manager cleanup used a flat 30s timer, which could expire
before a slow worker finished submitting its last result. Now polls
every 10s (up to 5 minutes) checking if any registered workers still
have recent heartbeats before cleaning up the manager.

Also added clarifying comment on submit_result route — it intentionally
does NOT check is_active, only manager existence, to accept late
submissions from workers that were mid-generation when master finished.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-20 20:50:12 -07:00
Jason HokuandClaude Opus 4.6 9b8f01ea48 feat: add Start At Job # option for custom job resume/skipping
New 'Run Settings' section in Builder UI with a job number input.
When set > 0, the generation loop skips all jobs before that number.
Useful for resuming at a specific point without relying on
auto-detection. Flows through session settings to the orchestrator.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-16 16:00:43 -07:00
Jason HokuandClaude Opus 4.6 dd104b521a feat: implement deferred upscales with run_deferred_upscales()
When run_upscales_at_end is enabled, inline upscale is skipped and
jobs are queued. After generation completes (before cleanup), the
deferred phase loads base images from disk, VAE-encodes them, and
runs full pipeline chains. Includes resume support, interrupt handling,
and progress reporting with phase="upscaling".

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-16 02:30:28 -07:00
Jason HokuandClaude Opus 4.6 9cf556d886 fix: prompt ordering and duration metric with upscaling
- Replace set() with ordered list dedup for batch encoding so prompts
  generate in the order they're written in the config array
- Track cumulative upscale duration so the time metric includes both
  generation and all upscale steps instead of just the last upscale

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-15 18:00:47 -07:00
JasonHokuandClaude Opus 4.6 89b6ce4eb1 feat: upscale pipelines system + save pre-upscale + HiRes prompt adjust
Replace flat upscale configs with pipeline/steps/repeat architecture:
- Pipelines run independently from base image
- Steps chain sequentially within a pipeline
- Steps support repeat count for iterative refinement

Add "Save Pre-Upscaled Output" option to also keep the base image.

Add "Adjust Prompt During HiRes Fix" with prepend/append/replace
behaviors. HiRes-adjusted prompts are batch pre-encoded for efficiency.
Results written to manifest metadata and exposed as label overlays.

Fix fmtVal scoping error in buildLabelOverlay (was referenced outside
the upscale block where it was defined).

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-09 15:33:04 -07:00
JasonHokuandClaude Opus 4.6 2bded1cf6c fix: upscaling manifest issues — correct file URL, add id field, skip base image
Three bugs fixed:
1. Upscaled images used bare 'filename=...' instead of full '/view?filename=...&type=output&subfolder=...' URL format, causing 404s in dashboard
2. Upscaled manifest entries missing 'id' and 'rejected' fields, causing holes in dashboard grid
3. Base (non-upscaled) images were still saved to pending_batch when upscaling was enabled — now only upscaled final versions appear in output

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-09 03:29:11 -07:00
JasonHokuandClaude Opus 4.6 b443184316 fix: prevent crash on empty model name and correct upscale_size for model_only mode
Skip upscale combos that require a model when none is selected.
Use effective_size=2.0 for model_only mode instead of 1.0 which
would resize the model output back to original resolution.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-08 21:36:48 -07:00
JasonHokuandClaude Opus 4.6 9555aad4d9 feat: array-based upscaling with Cartesian expansion in orchestrator
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-08 21:26:00 -07:00
JasonHokuandClaude Opus 4.6 91b8598ac3 feat: add seed settings, canvas flicker fix, upscaling & GPU cooldown
- Seed: expanded per-gen behavior + new full run seed behavior (random/increment/decrement before/after entire run)
- Canvas: fix flicker during simultaneous pan+zoom via requestAnimationFrame batching
- Upscaling: 3 session-level modes (HiRes fix, model upscale, model+HiRes) with tiled VAE support
- Cooldown: configurable GPU breaks between generations with optional VRAM clearing

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-08 14:00:06 -07:00
JasonHokuandClaude Opus 4.6 d404420042 fix: disable job skip/resume when optional inputs are connected
Previously, check_if_job_completed() with optional inputs would only
match on sampler/scheduler/steps/cfg/denoise/seed — skipping model,
prompt, and lora checks. This caused false positive matches, skipping
jobs even when the user changed models via optional input nodes.

Now returns -1 (no match) immediately when has_optional_inputs=True,
forcing all jobs to re-generate since upstream changes can't be detected.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-07 14:53:55 -08:00
JasonHokuandClaude Opus 4.6 38b766cc92 fix: preserve all conditioning extra dict keys during worker serialization
The conditioning serialization was only preserving pooled_output, dropping
critical keys like attention_mask that Wan/T5 models need for proper
sampling. This caused KSampler to produce NaN latents on distributed workers.
Includes backwards compatibility with old serialization format.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-07 14:38:54 -08:00
JasonHokuandClaude Opus 4.6 f6f21e309d fix: remove force_patch_weights for Dynamic VRAM compatibility
ComfyUI v16.3's Dynamic VRAM uses ModelPatcherDynamic which asserts
force_patch_weights=False. Removed the flag from both CLIP GPU loading
calls to match ComfyUI's own CLIP.load_model() pattern. Backwards
compatible with older ComfyUI versions.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-07 12:09:49 -08:00
JasonHokuandClaude Opus 4.6 5e7ad22cc7 fix: backslash in f-string, dashboard focus stealing, VAE config priority, column hotkeys
- Fix Python 3.10 SyntaxError: extract backslash replace() out of f-string
  expression in config_builder_node.py (issue #12)

- Fix dashboard iframe stealing focus from ComfyUI on every live update
  by removing viewport.focus() from render/update paths in logic_virtual.js

- Intercept Ctrl+S in dashboard iframe and forward to ComfyUI parent
  window so workflow save works instead of triggering browser Save As dialog

- Config Builder VAE settings now override sampler node's remote_vae_endpoint
  via config_overrides_vae flag in generation_orchestrator.py flush logic

- Fix Shift+1-9 column hotkeys: use e.code instead of e.key since Shift
  produces symbols (!@#$) not digits for e.key on standard keyboards

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-06 13:41:44 -08:00
JasonHokuandClaude Opus 4.6 a4060351bd Fix claim_timeout default from 300 to 600 in orchestrator
The DistributionManager, config builder, and UI all already used 600 as
the default, but the orchestrator's fallback was still 300. This caused
premature job reclaim when workers loaded models for the first time.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-05 23:41:59 -08:00
JasonHokuandClaude Opus 4.6 fddffd7a8c Add worker model sync and upcoming models pre-fetching
Worker downloads missing models from master via HTTP before processing.
Background pre-fetch thread downloads upcoming models during job execution.
Distribution manager scans pending queue for unique model references.
Job claim responses include upcoming_models list when sync enabled.
Master passes sync_models_to_workers flag to workers via start_worker.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-02 15:15:54 -08:00
JasonHokuandClaude Opus 4.6 aadae6d94a feat: per-config resolutions — builder UI, config expansion, generation override
Each config array can now have its own resolution list displayed as chips with
categorized preset dropdown (SD 1.5/SDXL/Flux × Square/Portrait/Landscape) plus
custom W×H input. Resolutions flow through configs_json, expand in the Cartesian
product, and override the sampler's global resolutions_json on a per-config basis.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-01 04:24:15 -08:00
JasonHokuandClaude Opus 4.6 c8f8bfae7a feat: pass extra model & sampling options through orchestrator to generate_image
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-27 18:25:02 -08:00
JasonHoku 25e4c657f0 fix lora triggerwords 2026-02-27 16:53:20 -08:00
JasonHoku 822373227c Optional Text Encoder On Master Only & Serve To Workers & More Distrib Logging 2026-02-26 20:11:59 -08:00
JasonHoku 5d3a76b246 distribution numpy img save fix, lora triggerword pathing fix 2026-02-26 17:16:02 -08:00
JasonHoku 2d5acaa7ca fix promptserver requests 2026-02-26 16:50:11 -08:00
JasonHoku 473c8509a3 add distribution logging 2026-02-26 16:22:21 -08:00
JasonHoku cfb75e7922 Create Run Distribution System 2026-02-26 15:37:55 -08:00
JasonHoku 820ff09df8 sorting optimization 3 2026-02-18 17:10:10 -08:00
JasonHoku f1dadf244c improve job skipping/resume logic, improve dash topbar organization 2026-02-18 13:16:23 -08:00
JasonHoku 8e9a35272f Add remote vae custom endpoint option 2026-02-18 03:52:42 -08:00
JasonHoku e3e933fc08 Implement prompt combinators: AND, CAT, AVG(), BREAK. Consolidate dashboard topbar 2026-02-16 12:41:20 -08:00
JasonHoku d74a51dd15 UI updates, model based prompting, attention mode selection, recursive cartesian prompting, detect connected node changes for smarter job resuming, eta progress bar in ui, condensed dashboard top bar, close modal hotkeys, 2026-02-16 00:21:58 -08:00
JasonHoku acf5bfffc7 Implement text encoder outputs extra conditioning data 2026-02-15 12:30:53 -08:00
JasonHoku bde885cf15 fix cancel job call 2026-02-15 00:43:30 -08:00
JasonHoku 41d7881c3e when user cancels job during text encoding step, actually cancel the full run, not just a single text encoding step 2026-02-15 00:12:47 -08:00
JasonHoku f7ec7cca23 implement vae selection in UI & vae iteration tools 2026-02-14 23:36:38 -08:00
JasonHoku d178bd064f Change cache busting static js serve technique to conform to ComfyUI best practices 2026-02-14 23:13:13 -08:00
JasonHoku ff9ec1aa9b Seed behavior, load any directory into the dashboard, better lora omit triggerword logic, builder validation & more ui changes. 2026-02-14 17:53:33 -08:00
JasonHoku d0aacb906e Config Builder View Lora CivitAI Data Buttons, Cleaner Manifest, Auto Card & Row Sizes In Grid, Fixed Config Builder Lora Always Combining Loras, Easier Lora UI Settings 2026-02-13 00:23:20 -08:00
JasonHoku 30894c4c82 Massive Overhaul, Config Builder Updates, Fixes, Smarter Optional Caching, UI Improvements, Filter Improvements & More! 2026-02-10 16:30:10 -08:00
JasonHoku beb3402d93 Fixed Non Remote Vae Decode Image Saving Meta Mismatch, Fixed Config Meta Saving & R Reload Hotkey Filter Updates 2026-02-06 14:48:12 -08:00
JasonHoku 9d1afab458 Major Refactor, Optimizations & New Features: Move & MetaPack Favorited, Random Lora Selection, Lora & Model Entire Folder Loading, Smart JSON Node, WIP Config Builder 2026-02-06 00:07:47 -08:00