Commit Graph
43 Commits
Author SHA1 Message Date
Jason Hoku cbc82026bc fix: route all config_builder prints through safe_print to avoid Windows OSError 2026-04-22 17:33:35 -07:00
Jason HokuandClaude Opus 4.6 9de031ad94 fix: safe_print in generate_config to survive Windows stdout corruption
Windows users occasionally see 'OSError [Errno 22] Invalid argument'
from colorama's write_plain_text when stdout gets into a bad state
(often after a long-running or interrupted session). This crashed the
Config Builder node at its very first print statement, breaking the
entire workflow.

Adds a module-level safe_print() helper that:
1. Tries normal print() first
2. Falls back to raw sys.__stdout__.write on OSError/ValueError
3. Silently drops the message if even that fails

generate_config() now aliases print = safe_print at the top so every
print call in the function is automatically resilient without renaming
each one.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-11 19:00:31 -07:00
Jason HokuandClaude Opus 4.6 4d362b8c6f feat: config schema validation warns on JS/Python field sync drift
Adds a validation check in generate_config() that compares each output
config's keys against the expected set (sampler, scheduler, steps, cfg,
model, lora, etc.). Logs a warning with the missing keys if any are
absent, catching dual-codepath sync drift before it causes runtime bugs.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-25 22:27:24 -07:00
Jason HokuandClaude Opus 4.6 7b437f0e2f feat: instant model loading with localStorage cache + background polling
Performance improvements for Builder UI model/LoRA loading:

localStorage persistent cache:
- Model lists cached to localStorage on first fetch
- On page reload, cached data renders instantly (no network wait)
- Cache expires after 24 hours, cleared on explicit Refresh Models
- Saves all categories: checkpoints, diffusion, GGUF, text encoders,
  VAEs, upscale models, samplers, schedulers, clip types

Background count polling:
- New /configbuilder/model_counts endpoint returns file counts per
  category (fast — uses folder_paths internal stat-based cache)
- Frontend polls every 30s, compares counts to last known values
- On change: auto-refreshes model lists and re-renders UI
- No manual Refresh Models needed when adding new models

Deduplicated /object_info:
- Shared _getObjectInfo() cache ensures the expensive /object_info
  endpoint is called at most once per session (was called 2-3x)
- getAvailableLoras() and getAvailableModels() share the cached response

Polling lifecycle:
- Starts after initial render, stops when node is removed
- Only active while ConfigBuilder node exists on canvas

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-25 11:13:18 -07:00
Jason HokuandClaude Opus 4.6 0691c26d77 feat: add Flux2 support — CLIP type, model sampling, and override
- Add "flux2" to clip_types and dual_clip_types lists so CLIPType.FLUX2
  is correctly passed to ComfyUI's text encoder loader
- Add "flux2" model_sampling_override option in Builder UI dropdown
- Implement ModelSamplingFlux2 handler using fixed shift (default 2.02,
  matching ComfyUI's Flux2 supported_models.py)
- Handle "flux2" in config_builder_node.py config generation with
  default shift value

Users with Flux2 models (Klein, etc.) should set:
- CLIP Type: flux2
- Model Sampling Override: Flux2
- For best results: enable Advanced Sampling with Flux2 Scheduler

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-20 20:50:46 -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 c0f4def625 feat: wire run_upscales_at_end through config export and Python
Added to JS convertStateToConfigs() and Python generate_config()
session settings dict.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-16 02:26:35 -07:00
Jason HokuandClaude Opus 4.6 d6ced4aebc fix: always include all config fields to prevent manifest data loss
Fields like vae, seed_behavior, model_type, attention_mode,
model_prompt_prefix/suffix, sampling overrides, lora_omit_triggers,
and trigger append settings are now always included with defaults
instead of being conditionally omitted. This prevents data loss when
sessions are reloaded from manifests with toggled-off sections.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-15 20:14:56 -07:00
Jason HokuandClaude Opus 4.6 77b30a3ca6 refactor: migrate config_builder_node.py CivitAI calls to network gateway
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-14 02:16:02 -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 7c1b6ffc8c feat: add upscale model discovery from ComfyUI folder system
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-08 20:33:30 -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
JasonHoku 8fbf7568d2 Fixed image resolution settings not outputting to config_json 2026-03-07 17:31:54 -08:00
JasonHokuandClaude Opus 4.6 9987d38f9b fix: Custom Prompts section — session load, checkbox toggle, and count display
Three bugs fixed:

1. Global Prompt data was incorrectly loaded into Custom Prompts when
   loading a session. Added _prompt_source flag ("global"/"custom") to
   configs so the round-trip loader can distinguish between them and
   restore global prompts to the correct section.

2. Checkbox toggle was not visually broken but appeared non-functional
   because bug #1 caused global prompts to populate custom prompt fields,
   making the state confusing. Now correctly separated.

3. Prompt combination count in the section header was only computed at
   render time and never updated when groups changed. Added live update
   via updatePromptCountDisplay() in the onChange callback.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-07 15:04:08 -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 2146e4926c Refactor Distribution Settings: always-visible toggle + embedded config
Distribution Settings section:
- Always visible at top with On/Off toggle
- Settings collapse when toggled off, expand when on
- No longer conditionally rendered

Distribution config output/input removal (clean break):
- Config Builder: RETURN_TYPES reduced from 3 to 2 outputs
- distribution_config embedded in configs_json as _distribution key
- Output format: {"configs": [...], "_distribution": {...}}
- Sampler node: Removed distribution_config optional input
- Sampler extracts _distribution from configs_json automatically
- Backward compatible: plain array configs_json still works
- JSON Preview shows full output including _distribution when enabled
- Session loader handles both old array and new object formats

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-05 15:59:10 -08:00
JasonHokuandClaude Opus 4.6 e71fe8ed91 Add Sync Models to Workers checkbox and config passthrough
New toggle in Distribution Settings section. Flag flows through
distribution_config JSON as sync_models_to_workers boolean.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-02 15:04:08 -08:00
JasonHokuandClaude Opus 4.6 39695f5e52 Implement Tasks 2-5: tag diff, sidebar nav, section reorg, headers
Task 2: Backend compares fresh CivitAI trainedWords with stored
loras_tags.json on force_refresh. Frontend shows diff banner with
Update/Keep buttons in the LoRA metadata modal.

Task 4: Per-config sidebar navigation — numbered cog icons per config
array with hover-expandable sub-section icons (Models, TE, VAE, LoRAs).
Section IDs added to all sub-sections for scroll targeting.

Task 5: Distribution Settings moved to top of layout. Extra Model &
Sampling Options moved inside Models as sub-section. TE header upgraded
to match section toggle style with brighter color. VAE header lightened
(#444 bg, #cc66ff text). LoRAs header brightened (#4499ff).

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-01 15:08:54 -08:00
JasonHoku 2c15fe035a fix remote vae on distribution worker 2026-02-28 21:56:12 -08:00
JasonHokuandClaude Opus 4.6 ee4451f3a2 Add custom lora trigger word editor with modal UI and backend endpoints
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-28 21:27:26 -08:00
JasonHokuandClaude Opus 4.6 87e37563f2 Enhance CivitAI modals: re-fetch button, save JSON, force_refresh
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-28 21:11:09 -08:00
JasonHokuandClaude Opus 4.6 feb8ebc5c4 feat: parse extra model & sampling options in config builder
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-27 18:22:00 -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 cfb75e7922 Create Run Distribution System 2026-02-26 15:37:55 -08:00
JasonHoku 731db142d9 builder ui updates, features & dash prompt analyize copy favorites to clipboard tool 2026-02-19 15:44:06 -08:00
JasonHoku 2e1c1d1fdf Fix caching and calling of model/lora civitai lookup 2026-02-16 16:19:07 -08:00
JasonHoku 67a8cf65dd Integrate New Security Rules From Comfy Registry Scans. 2026-02-16 16:03:05 -08:00
JasonHoku 9518630662 fix on/off model switch not outputting to config_json 2026-02-16 13:49:44 -08:00
JasonHoku f3582fb190 add model lookup on civitai button 2026-02-16 00:50:34 -08:00
JasonHoku 3c06847167 Add dropdown selection and list building options for availableSamplers/availableSchedulers in builder UI 2026-02-15 13:49:22 -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 527d86ed23 output seed_behavior in configs_json 2026-02-14 19:04:34 -08:00
JasonHoku 44da2da618 claude prompt in ui updates 1 2026-02-13 16:54:00 -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 def8d20ec0 Prevent adding None to lora list in Builder 2026-02-07 02:58:09 -08:00
JasonHoku cc66f47246 Fix Config Builder Model Output "None" Bug 2026-02-07 02:13:14 -08:00
JasonHoku 2e0aa47322 Fix Builder Steps Output As Int Instead Of Float 2026-02-07 02:01:45 -08:00
JasonHoku 30001a879f Fix Output Steps As Int Instead Of Float 2026-02-07 01:43:19 -08:00
JasonHoku 47cc06fb33 Config Builder Add Multi Lora & Model Loading Features For Folders & Multi Selections, Add Lora Trigger Tag Lookup & Omitting System 2026-02-07 00:18:43 -08:00
JasonHoku 4551971bcf Major Updates To Config Builder Node 2026-02-06 19:12:33 -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