From a017fcccb9dc2da41fc076c1b1be2572db99ae9c Mon Sep 17 00:00:00 2001 From: rgthree Date: Fri, 15 Sep 2023 23:04:01 -0400 Subject: [PATCH] Switch SDXL Config to KSampler Config, and add cfg --- __init__.py | 4 ++-- py/{sdxl_config.py => ksampler_config.py} | 25 +++++++++++++++-------- 2 files changed, 19 insertions(+), 10 deletions(-) rename py/{sdxl_config.py => ksampler_config.py} (59%) diff --git a/__init__.py b/__init__.py index 8347667..4810a30 100644 --- a/__init__.py +++ b/__init__.py @@ -24,7 +24,7 @@ from .py.power_prompt import RgthreePowerPrompt from .py.power_prompt_simple import RgthreePowerPromptSimple from .py.image_inset_crop import RgthreeImageInsetCrop from .py.context_big import RgthreeBigContext -from .py.sdxl_config import RgthreeSDXLConfig +from .py.ksampler_config import RgthreeKSamplerConfig from .py.sdxl_power_prompt_postive import RgthreeSDXLPowerPromptPositive from .py.sdxl_power_prompt_simple import RgthreeSDXLPowerPromptSimple @@ -40,7 +40,7 @@ NODE_CLASS_MAPPINGS = { RgthreeImageInsetCrop.NAME: RgthreeImageInsetCrop, RgthreePowerPrompt.NAME: RgthreePowerPrompt, RgthreePowerPromptSimple.NAME: RgthreePowerPromptSimple, - RgthreeSDXLConfig.NAME: RgthreeSDXLConfig, + RgthreeKSamplerConfig.NAME: RgthreeKSamplerConfig, RgthreeSDXLEmptyLatentImage.NAME: RgthreeSDXLEmptyLatentImage, RgthreeSDXLPowerPromptPositive.NAME: RgthreeSDXLPowerPromptPositive, RgthreeSDXLPowerPromptSimple.NAME: RgthreeSDXLPowerPromptSimple, diff --git a/py/sdxl_config.py b/py/ksampler_config.py similarity index 59% rename from py/sdxl_config.py rename to py/ksampler_config.py index 480fbd7..2d350dd 100644 --- a/py/sdxl_config.py +++ b/py/ksampler_config.py @@ -5,10 +5,10 @@ from nodes import MAX_RESOLUTION import comfy.samplers -class RgthreeSDXLConfig: - """Some basic config stuff I use for SDXL.""" +class RgthreeKSamplerConfig: + """Some basic config stuff I started using for SDXL, but useful in other spots too.""" - NAME = get_name('SDXL Config') + NAME = get_name('KSampler Config') CATEGORY = get_category() @classmethod @@ -18,12 +18,20 @@ class RgthreeSDXLConfig: "steps_total": ("INT", { "default": 30, "min": 1, - "max": MAX_RESOLUTION + "max": MAX_RESOLUTION, + "step": 1, }), "refiner_step": ("INT", { "default": 24, "min": 1, - "max": MAX_RESOLUTION + "max": MAX_RESOLUTION, + "step": 1, + }), + "cfg": ("INT", { + "default": 7, + "min": 1, + "max": MAX_RESOLUTION, + "step": 0.5, }), "sampler_name": (comfy.samplers.KSampler.SAMPLERS,), "scheduler": (comfy.samplers.KSampler.SCHEDULERS,), @@ -32,16 +40,17 @@ class RgthreeSDXLConfig: }, } - RETURN_TYPES = ("INT", "INT", comfy.samplers.KSampler.SAMPLERS, + RETURN_TYPES = ("INT", "INT", "INT", comfy.samplers.KSampler.SAMPLERS, comfy.samplers.KSampler.SCHEDULERS) - RETURN_NAMES = ("STEPS", "REFINER_STEP", "SAMPLER", "SCHEDULER") + RETURN_NAMES = ("STEPS", "REFINER_STEP", "CFG", "SAMPLER", "SCHEDULER") FUNCTION = "main" - def main(self, steps_total, refiner_step, sampler_name, scheduler): + def main(self, steps_total, refiner_step, cfg, sampler_name, scheduler): """main""" return ( steps_total, refiner_step, + cfg, sampler_name, scheduler, )