diff --git a/sampler_node.py b/sampler_node.py index 23c6837..f913e12 100644 --- a/sampler_node.py +++ b/sampler_node.py @@ -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