Wires the existing add_random_seeds_to_gens parameter (already in
generation_orchestrator.py:824) through the full Run Settings pipeline:
1. Builder UI: state default + _addRunSetting widget (int, 0-100, default 0)
2. config_builder_node.py: emits into session_settings in configs_json
3. sampler_node.py: reads from session_settings, overrides the local variable
The generation loop already handles it — generates N extra images per config
with random seeds when > 0. Previously hardcoded to 0 with no UI path.
Based on PR #21 by external contributor, rebased onto current main with
full pipeline wiring.
Tests: 118/118 pass.
Lets the Builder UI know whether the ComfyUI-USCG-CivitAI companion is
installed, so it can show small inline install notices in the trigger-
words section and the 2 'Lookup Metadata from CivitAI' buttons.
Both config_builder_node.py and lora_utils.py now import from .civitai
instead of .network_utils. network_utils.py becomes unreferenced and
gets deleted in the next commit.
Adds a new SUB-GROUP 4 in the Builder UI's "Extra Model & Sampling
Options" section with all 7 params from ComfyUI's built-in
PatchModelAddDownscale node:
- block_number (int, default 3)
- downscale_factor (float, default 2.0)
- start_percent / end_percent (float 0-1, default 0.0 / 0.35)
- downscale_after_skip (bool, default true)
- downscale_method / upscale_method (combo: bicubic/nearest-exact/
bilinear/area/bislerp, default bicubic)
Toggle checkbox controls whether the patch is applied. State plumbs:
config_array.use_deep_shrink/* (JS) -> state_to_configs_json -> per-
config entries -> expand_configs base_combos -> generate_image -> looks
up PatchModelAddDownscale via NODE_CLASS_MAPPINGS and calls .patch() to
patch the model before sampling. Logs an "Applied
PatchModelAddDownscale" line on each gen for visibility.
Mirrors the existing model_sampling_override / use_advanced_sampling
patterns for consistency. Hidden on LTX video config arrays since the
patch targets the SDXL/SD UNet.
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
User feedback: 1 is a more sensible default for typical generation —
smaller VAE batches keep VRAM lower, and flushing every gen makes the
dashboard show progress immediately.
Updated everywhere:
- sampler_node run_tests fallback defaults (post-widget-removal)
- conf-builder-main.js initial state + migration backfill
- conf-builder-config-management.js renderRunSettingsSection
state-init defaults + _addRunSetting defaultValue
- config_builder_node.py state_to_configs_json emit fallback +
except-clause fallback for both fields
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
session_name is now carried inside configs_json via _session_settings
(emitted unconditionally as of e570f6b, honored by sampler_node.run_tests).
The dedicated output socket was redundant — and now that the
SamplerGridTester's session_name widget is gone (commit 30e3aa9),
nothing on the downstream side reads it anyway.
Workflows that wired BuilderUI.session_name -> somewhere will have that
wire silently dropped by ComfyUI on load. No action needed for users
who only use the configs_json wire (the typical setup).
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Three issues in 7a2c3c9:
1. start_at_job's onchange handler used setDirtyCanvas() instead of
saveState() — changes never reached the lora_config widget value.
Fixed to call saveState().
2. The 6 run-settings emissions were gated on "non-default" values
(e.g. lora_triggerwords_mode only emitted when != "None"). Result:
a user setting Builder UI to its default could not override the
Generator widget if the user had previously set that widget to
something non-default. Builder UI is now authoritative — emit all
values unconditionally. start_at_job and image_format also
switched to unconditional emission for consistency.
3. session_name had no plumbing path. Added emission in
state_to_configs_json and an override branch in sampler_node so
the Builder UI's session_name field overrides the generator widget.
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Two bugs in state_to_configs_json's VAE emission:
1. Bypass (unchecked) VAEs were still sent through — vae_bypass_states
was never consulted in the filter. Now filtered alongside the
None/empty check.
2. When no VAE remained (empty list, all bypassed, or only "None"),
the config emitted "vae": "None" — the orchestrator interpreted
that as a model filename and threw "vae model with filename 'None'
not found". Now the "vae" key is OMITTED entirely so the generator
falls back to its default behavior (no per-config VAE override),
matching the pattern already used for text_encoders/clip_type/etc.
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Phase 1 of consolidating run-level config into the Builder UI. The
Builder UI's "Run Settings" section is now rendered at the TOP of the UI
(was previously below config arrays) and gains six new fields with help
tooltips:
- overwrite_existing (bool, default false)
- flush_batch_every (int, default 4)
- lora_triggerwords_mode (enum: None / Append To End / Append To Start /
Read From Config, default None)
- save_conditioning_cache_to_file (bool, default false)
- enable_model_cache (bool, default false)
- vae_batch_size (int, default 4, range -1..64)
State plumbs through state_to_configs_json -> _session_settings ->
sampler_node.run_tests -> run_generation_loop. Builder UI values
override the corresponding widgets on UltimateSamplerGrid when set
(non-default). Widget values remain the fallback so existing workflows
keep working without changes.
Logs an "⚙️ <name> overridden by Builder UI: <value>" line whenever an
override fires, so it's obvious in the console.
Next: once the user has tested this thoroughly, the corresponding
widgets on the SamplerGridTester node can be removed/hidden to
simplify the generator UX (deferred — coordinate with user).
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
These keys legitimately aren't set in pre-orchestrator configs:
- seed: filled by expand_configs (node-level seed widget or per-entry override)
- denoise: filled by run_generation_loop from the denoise widget
- clip_type: only set when model_type != "checkpoint"
The validator was a stale leftover from the pre-single-source-of-truth era.
Trimming false positives. Still warns on actual typos / dropped fields.
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Adds a dropdown to the Builder UI's Run Settings section letting users
pick the saved image file format. Default remains webp (current
behavior). State plumbed through state_to_configs_json ->
_session_settings -> orchestrator -> save_image_to_disk.
PNG users will see lossless saves; JPG users smaller files at quality 95.
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
When the user types '0.5, 1.0' they want 2 outputs (lora at 0.5, lora
at 1.0 — both model and clip mirroring), not 4 outputs (Cartesian
m×c). The bug was that we wrote both _model AND _clip side-channel
arrays, so Python emitted 'name:[m]:[c]' which the orchestrator
correctly interpreted as Cartesian.
JS: collapse the two-input compare section to a single 'Strengths:'
input. Never write _clip to lora_weight_arrays.
Python: process_lora_array now emits 'name:[m_arr]' (no clip part)
when only _model array is present. The generator's existing
parse_lora_definition defaults clip=model when the third segment
is missing, giving N configs with locked semantics.
Drops the Cartesian path entirely. Backward compat retained: if a
saved workflow has both arrays (legacy), the dual-bracket form is
still emitted so the orchestrator can Cartesian-expand as before.
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Both runtime (generate_config) and preview now invoke
state_to_configs_json — single source of truth, drift-proof.
The Builder UI will fetch this endpoint instead of running a
parallel JS transformer (next commit removes that JS code).
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Eliminates the JS<->Python drift bug class by making one Python function
the source of truth for state -> configs_json. Both the runtime
(generate_config) and the new preview endpoint (next commit) call it.
Adds golden test for the lora-strength-arrays bracket case that just
broke (regression guard).
Also loads the real config_builder_node module in conftest.py (instead
of a bare stub) so that tests against UltimateConfigBuilder methods work
correctly. Stubs network_utils before loading to satisfy the relative
import.
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
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>
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>
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>
- 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>
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>
Added to JS convertStateToConfigs() and Python generate_config()
session settings dict.
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
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>
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>
- 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>
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>
- 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>
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>
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>
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>