Skip to content

Commit 8fbf756

Browse files
committed
Fixed image resolution settings not outputting to config_json
1 parent 836a7b3 commit 8fbf756

4 files changed

Lines changed: 50 additions & 2 deletions

File tree

config_builder_node.py

Lines changed: 39 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -521,7 +521,14 @@ def generate_config(
521521

522522
configs_output = []
523523
total_lora_configs = 0
524-
524+
525+
# ============================================================================
526+
# SYNC WARNING: This config-building loop MUST stay in sync with the JS-side
527+
# convertStateToConfigs() in web/conf_builder/conf-builder-utilities.js.
528+
# That function generates the preview JSON in the Builder UI.
529+
# If you add a new config field here, add it there too (and vice versa).
530+
# Fields consumed by config_utils.expand_configs() must be output by BOTH.
531+
# ============================================================================
525532
for config_array in config_arrays:
526533
# Parse values from this config array
527534
sampler_list = self.parse_comma_list(config_array.get("samplers", "euler"))
@@ -603,6 +610,37 @@ def generate_config(
603610
if lora_triggerwords_append_settings and any(v != "none" for v in lora_triggerwords_append_settings.values()):
604611
config["lora_triggerwords_append_settings"] = lora_triggerwords_append_settings
605612

613+
# Per-config resolutions (override sampler's resolutions_json)
614+
raw_resolutions = config_array.get("resolutions", [])
615+
if raw_resolutions and len(raw_resolutions) > 0:
616+
# Convert "WxH" strings to [W, H] arrays for config_utils.expand_configs()
617+
parsed_res = []
618+
for r in raw_resolutions:
619+
if isinstance(r, str) and "x" in r:
620+
parts = r.split("x")
621+
parsed_res.append([int(parts[0]), int(parts[1])])
622+
elif isinstance(r, (list, tuple)) and len(r) == 2:
623+
parsed_res.append([int(r[0]), int(r[1])])
624+
if parsed_res:
625+
config["resolutions"] = parsed_res
626+
627+
# Attention mode(s) for testing different attention implementations
628+
attention_modes = config_array.get("attention_modes", ["default"])
629+
if isinstance(attention_modes, list):
630+
filtered = [a for a in attention_modes if a and a != "default"]
631+
if filtered:
632+
config["attention_mode"] = filtered if len(filtered) > 1 else filtered[0]
633+
elif isinstance(attention_modes, str) and attention_modes != "default":
634+
config["attention_mode"] = attention_modes
635+
636+
# Model prompt prefix/suffix (quality tags prepended/appended to prompts)
637+
model_prompt_prefix = config_array.get("model_prompt_prefix", "")
638+
if model_prompt_prefix and model_prompt_prefix.strip():
639+
config["model_prompt_prefix"] = model_prompt_prefix.strip()
640+
model_prompt_suffix = config_array.get("model_prompt_suffix", "")
641+
if model_prompt_suffix and model_prompt_suffix.strip():
642+
config["model_prompt_suffix"] = model_prompt_suffix.strip()
643+
606644
# Add extra model & sampling options if enabled
607645
if model_sampling_override and model_sampling_override != "none":
608646
config["model_sampling_override"] = model_sampling_override

pyproject.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
[project]
22
name = "ultimate-auto-sampler-config-grid-testing-suite"
33
description = "Test Everything All In One Run!!! Testing & benchmarking tool for samplers, schedulers, CFG scales, multiple prompts, img2img denoise values, Models, Weights, LoRA and more! Features infinite-canvas dashboard image grids with virtual scrolling that can handle thousands of images! Smart caching, powerful sorting, filters, favoriting, reviewing, automatic resume on interrupt, and real-time visualization. Test entire checkpoint folders, stack multiple LoRAs, generate random seed variations, and export optimized configs, save sessions. Includes powerful UI for building AIO comparison runs, fullscreen mode, keyboard navigation, smart filtering by parameters, civitai model data info, and one-click regeneration workflow, and SO MUCH MORE. Perfect for sampler output optimization and parameter tuning."
4-
version = "1.16.0"
4+
version = "1.16.1"
55
license = {file = "LICENSE"}
66
classifiers = [
77
# # For OS-independent nodes (works on all operating systems)

web/conf_builder/conf-builder-config-management.js

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4427,6 +4427,9 @@ export function updatePreview(node) {
44274427
if (!preview) return;
44284428
const configs = convertStateToConfigs(node.state);
44294429

4430+
// NOTE: This preview shows what convertStateToConfigs() produces (JS-side).
4431+
// The ACTUAL configs_json output comes from generate_config() in config_builder_node.py.
4432+
// Both must output the same fields — see SYNC WARNING in each file.
44304433
// Build the full output object matching what configs_json will contain
44314434
const output = { configs };
44324435
if (node.state.distribution_enabled) {

web/conf_builder/conf-builder-utilities.js

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -477,6 +477,13 @@ export function getIterationCount(configArray) {
477477
}
478478

479479
// --- CONFIG CONVERSION ---
480+
// ============================================================================
481+
// SYNC WARNING: This function MUST stay in sync with the Python-side
482+
// generate_config() in config_builder_node.py.
483+
// That function produces the actual configs_json consumed by the sampler node.
484+
// If you add a new config field here, add it there too (and vice versa).
485+
// Fields consumed by config_utils.expand_configs() must be output by BOTH.
486+
// ============================================================================
480487

481488
export function convertStateToConfigs(state) {
482489
const configs = [];

0 commit comments

Comments
 (0)