refactor: slim SamplerGridTester to configs_json + optional inputs

Removes 15 widgets from the SamplerGridTester INPUT_TYPES. The Builder
UI is now the single source for run-level settings via _session_settings
in configs_json. Optional inputs (6 inputs) and the hidden unique_id are
kept; everything else is replaced by hardcoded defaults at the top of
run_tests.

Removed widgets:
- ckpt_name, positive_text, negative_text, seed, denoise
- vae_batch_size, resolutions_json, session_name
- overwrite_existing, flush_batch_every, add_random_seeds_to_gens
- lora_triggerwords_mode, remote_vae_endpoint
- save_conditioning_cache_to_file, enable_model_cache

Defaults set internally (overridden by _session_settings when present):
- ckpt_name: first available checkpoint (fallback so standalone use with
  "model": "Default" does not crash the orchestrator with None)
- positive_text="", negative_text="", seed=0, denoise="1.0"
- vae_batch_size=4, resolutions_json='[[1024, 1024]]', session_name="my_session"
- overwrite_existing=False, flush_batch_every=4, add_random_seeds_to_gens=0
- lora_triggerwords_mode="None", remote_vae_endpoint="None"
- save_conditioning_cache_to_file=False, enable_model_cache=False

Existing workflows: ComfyUI silently drops widget values for removed
INPUT_TYPES keys. Workflows that ran on prior versions will use the new
internal defaults; users who customized those widgets need to set the
same values in the Builder UI Run Settings instead (the previous commit
made all Builder UI run-settings authoritative so they always override).

UX: the Generator node is now a near-empty box with one required input
(configs_json) and 6 optional sockets. The user-facing controls all
live in the Builder UI. This simplifies the graph and removes a
recurring source of confusion (widgets that were silently overridden).

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This commit is contained in:
Jason Hoku
2026-05-12 13:26:56 -07:00
co-authored by Claude Opus 4.7
parent e570f6b58b
commit 30e3aa9a94
+30 -33
View File
@@ -53,35 +53,11 @@ class SamplerGridTester:
def INPUT_TYPES(s):
return {
"required": {
"ckpt_name": (folder_paths.get_filename_list("checkpoints"), {"tooltip": "Default checkpoint model. Used when config has model set to 'Default'. Configs can also specify GGUF or diffusion models directly via model_type."}),
"positive_text": ("STRING", {"multiline": True, "default": "masterpiece, best quality, 1girl"}),
"negative_text": ("STRING", {"multiline": True, "default": "bad quality, worst quality, lowres"}),
"seed": ("INT", {"default": 0, "min": 0, "max": 0xffffffffffffffff}),
"denoise": ("STRING", {"default": "1.0", "multiline": False}),
"vae_batch_size": ("INT", {"default": 4, "min": -1, "max": 64}),
"configs_json": ("STRING", {"multiline": True, "default": '[{"sampler": "euler", "scheduler": "normal", "steps": 20, "cfg": 7.0}]'}),
"resolutions_json": ("STRING", {"default": '[[1024, 1024]]'}),
"session_name": ("STRING", {"default": "my_session"}),
"overwrite_existing": ("BOOLEAN", {"default": False, "tooltip": "True = Re-run everything. False = Skip already generated images (Resume)."}),
"flush_batch_every": ("INT", {"default": 4, "min": 0, "max": 64, "tooltip": "Update dashboard every X images. 0 = Use VAE Batch Size."}),
"add_random_seeds_to_gens": ("INT", {"default": 0, "min": 0, "max": 100, "tooltip": "Generate X extra images per config using consistent random seeds."}),
"lora_triggerwords_mode": (["None", "Append To End", "Append To Start", "Read From Config"], {
"default": "None",
"tooltip": "None = Don't fetch/append trigger words. Append To End = Add triggers at end of prompt (default behavior). Append To Start = Add triggers at start of prompt. Read From Config = Use lora_triggerwords_append_settings in config JSON to specify per-lora placement."
"configs_json": ("STRING", {
"multiline": True,
"default": '[{"sampler": "euler", "scheduler": "normal", "steps": 20, "cfg": 7.0}]',
"tooltip": "Configs JSON (typically wired from UltimateConfigBuilder). Carries all run settings, prompts, models, LoRAs, etc. via _session_settings.",
}),
"remote_vae_endpoint": (["None", "Auto (Experimental)", "SD", "SDXL", "Flux", "HunyuanVideo"], {
"default": "None",
"tooltip": "Offload VAE decoding to HuggingFace remote endpoints. Auto detects model type, or manually select endpoint. Ignores vae_batch_size and flush_batch_every when enabled."
}),
"save_conditioning_cache_to_file": ("BOOLEAN", {
"default": False,
"tooltip": "Save CLIP conditioning cache to disk. \n\n Pretty much only helps if you want to use the same prompts without changing models or loras and are planning to experiment with different values AND want to skip the text encoding step after stopping and restarting/resuming a job. \n\n WARNING: Can create very large files in your output/benchmarks folder if you use many prompts with many LoRAs on large runs. Automatically disabled when optional inputs (model/clip/conditioning) are connected, as changes cannot be reliably detected."
}),
"enable_model_cache": ("BOOLEAN", {
"default": False,
"tooltip": "\n\n Experimental WIP feature that cuts lora switching loading times. Very useful if you are using lots of loras and then switching out some of them on additional runs. Skips re-loading from disk and loads cached loras from RAM instead. \n\n This is currently hard-coded to work best on my 8gb VRAM and 64gb RAM setup, it should work fine on most systems unless you have more LoRAs than available RAM. \n\n Enable intelligent model/LoRA caching system with async background preloading. Dramatically speeds up generation by caching models and preloading next model in background. Disable for debugging or to reduce RAM/VRAM usage (can be much slower if your text encoding step takes a long time and you're doing lots of starting and stopping with the same prompt). \n\n WILL NOT AUTODELETE THE CACHED ENCODED PROMPTS. You'll need to delete them manually from the benchmark session's folder manually when you're done with them."
}),
},
"optional": {
"optional_model": ("MODEL",),
@@ -249,12 +225,33 @@ class SamplerGridTester:
return -1
def run_tests(self, ckpt_name, positive_text, negative_text, seed, denoise, vae_batch_size,
overwrite_existing, flush_batch_every, configs_json, resolutions_json,
session_name, unique_id, add_random_seeds_to_gens, lora_triggerwords_mode,
remote_vae_endpoint, save_conditioning_cache_to_file, enable_model_cache,
def run_tests(self, configs_json,
optional_model=None, optional_clip=None, optional_vae=None,
optional_positive=None, optional_negative=None, optional_latent=None):
optional_positive=None, optional_negative=None, optional_latent=None,
unique_id=None):
# === Defaults for removed widgets (all moved to Builder UI) ===
# These are read from _session_settings below when present, otherwise
# the hardcoded defaults here are used.
# ckpt_name: fall back to the first available checkpoint so that a
# standalone node (no Builder UI wired) with "model": "Default" does
# not crash the orchestrator with get_full_path(None).
_ckpt_list = folder_paths.get_filename_list("checkpoints")
ckpt_name = _ckpt_list[0] if _ckpt_list else None
positive_text = ""
negative_text = ""
seed = 0
denoise = "1.0"
vae_batch_size = 4
resolutions_json = '[[1024, 1024]]'
session_name = "my_session"
overwrite_existing = False
flush_batch_every = 4
add_random_seeds_to_gens = 0
lora_triggerwords_mode = "None"
remote_vae_endpoint = "None"
save_conditioning_cache_to_file = False
enable_model_cache = False
# Import the generation logic from the separate module
from .generation_orchestrator import run_generation_loop