diff --git a/nodes.py b/nodes.py index 231d4d4dee13..171e3e7d5b70 100644 --- a/nodes.py +++ b/nodes.py @@ -81,7 +81,7 @@ def INPUT_TYPES(s): def combine(self, conditioning_1, conditioning_2): return (conditioning_1 + conditioning_2, ) -class ConditioningAverage : +class ConditioningAverage: @classmethod def INPUT_TYPES(s): return {"required": {"conditioning_to": ("CONDITIONING", ), "conditioning_from": ("CONDITIONING", ), @@ -1520,7 +1520,7 @@ class KSamplerAdvanced: def INPUT_TYPES(s): return {"required": {"model": ("MODEL",), - "add_noise": (["enable", "disable"], ), + "add_noise": ("BOOLEAN", {"default": True, "label_on": "enable", "label_off": "disable"}), "noise_seed": ("INT", {"default": 0, "min": 0, "max": 0xffffffffffffffff, "control_after_generate": True}), "steps": ("INT", {"default": 20, "min": 1, "max": 10000}), "cfg": ("FLOAT", {"default": 8.0, "min": 0.0, "max": 100.0, "step":0.1, "round": 0.01}), @@ -1531,7 +1531,7 @@ def INPUT_TYPES(s): "latent_image": ("LATENT", ), "start_at_step": ("INT", {"default": 0, "min": 0, "max": 10000}), "end_at_step": ("INT", {"default": 10000, "min": 0, "max": 10000}), - "return_with_leftover_noise": (["disable", "enable"], ), + "return_with_leftover_noise": ("BOOLEAN", {"default": False, "label_on": "enable", "label_off": "disable"}), } } @@ -1541,12 +1541,8 @@ def INPUT_TYPES(s): CATEGORY = "sampling" def sample(self, model, add_noise, noise_seed, steps, cfg, sampler_name, scheduler, positive, negative, latent_image, start_at_step, end_at_step, return_with_leftover_noise, denoise=1.0): - force_full_denoise = True - if return_with_leftover_noise == "enable": - force_full_denoise = False - disable_noise = False - if add_noise == "disable": - disable_noise = True + force_full_denoise = not return_with_leftover_noise + disable_noise = not add_noise return common_ksampler(model, noise_seed, steps, cfg, sampler_name, scheduler, positive, negative, latent_image, denoise=denoise, disable_noise=disable_noise, start_step=start_at_step, last_step=end_at_step, force_full_denoise=force_full_denoise) class SaveImage: @@ -2026,7 +2022,7 @@ def expand_image(self, image, left, top, right, bottom, feathering): "CLIPTextEncode": "CLIP Text Encode (Prompt)", "CLIPSetLastLayer": "CLIP Set Last Layer", "ConditioningCombine": "Conditioning (Combine)", - "ConditioningAverage ": "Conditioning (Average)", + "ConditioningAverage": "Conditioning (Average)", "ConditioningConcat": "Conditioning (Concat)", "ConditioningSetArea": "Conditioning (Set Area)", "ConditioningSetAreaPercentage": "Conditioning (Set Area with Percentage)",