feat(run-settings): add 'Additional Random Seeds' to Builder UI

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.
This commit is contained in:
Jason Hoku
2026-05-26 11:50:48 -07:00
parent 4d29280209
commit 23185fa521
3 changed files with 13 additions and 0 deletions
+4
View File
@@ -876,6 +876,10 @@ class UltimateConfigBuilder:
# session_name moves into session_settings too so the Generator's
# session_name widget can be removed (Phase 2).
session_settings["session_name"] = str(state.get("session_name", "my_session"))
try:
session_settings["add_random_seeds_to_gens"] = int(state.get("add_random_seeds_to_gens", 0))
except (TypeError, ValueError):
session_settings["add_random_seeds_to_gens"] = 0
if session_settings:
output_obj["_session_settings"] = session_settings
+6
View File
@@ -320,6 +320,12 @@ class SamplerGridTester:
if "session_name" in session_settings:
session_name = str(session_settings["session_name"])
print(f"[GridTester] ⚙️ session_name overridden by Builder UI: {session_name}")
if "add_random_seeds_to_gens" in session_settings:
try:
add_random_seeds_to_gens = int(session_settings["add_random_seeds_to_gens"])
print(f"[GridTester] ⚙️ add_random_seeds_to_gens overridden by Builder UI: {add_random_seeds_to_gens}")
except (TypeError, ValueError):
pass
return run_generation_loop(
self,
@@ -6878,6 +6878,7 @@ export function renderRunSettingsSection(node, container) {
if (node.state.save_conditioning_cache_to_file === undefined) node.state.save_conditioning_cache_to_file = false;
if (node.state.enable_model_cache === undefined) node.state.enable_model_cache = false;
if (node.state.vae_batch_size === undefined) node.state.vae_batch_size = 1;
if (node.state.add_random_seeds_to_gens === undefined) node.state.add_random_seeds_to_gens = 0;
const section = document.createElement("div");
section.className = "cb-section full-width";
@@ -7035,6 +7036,8 @@ export function renderRunSettingsSection(node, container) {
tooltip: "Experimental: intelligent model/LoRA caching with async background preloading. Speeds up generation when switching LoRAs frequently. Loads cached LoRAs from RAM instead of disk. Disable to reduce RAM/VRAM usage." });
_addRunSetting(content, { stateKey: "vae_batch_size", label: "VAE Batch Size", kind: "int", min: -1, max: 64, defaultValue: 1,
tooltip: "How many images to encode/decode per VAE pass. Lower = less VRAM. -1 = process all at once. Default: 4." });
_addRunSetting(content, { stateKey: "add_random_seeds_to_gens", label: "Additional Random Seeds", kind: "int", min: 0, max: 100, defaultValue: 0,
tooltip: "Generate this many extra images per config using additional random seeds. 0 = disabled." });
section.appendChild(header);
section.appendChild(content);