53 lines
1.4 KiB
Python
53 lines
1.4 KiB
Python
import comfy.samplers
|
|
|
|
from .sampler_combo_common import (
|
|
DEFAULT_SAMPLER,
|
|
DEFAULT_SCHEDULER,
|
|
DEFAULT_STEPS,
|
|
MAX_PAIRS,
|
|
PRESETS_TYPE,
|
|
build_presets,
|
|
)
|
|
|
|
|
|
class SamplerComboConfigNode:
|
|
@classmethod
|
|
def INPUT_TYPES(cls):
|
|
required = {
|
|
"pair_count": ("INT", {
|
|
"default": 1,
|
|
"min": 1,
|
|
"max": MAX_PAIRS,
|
|
"step": 1,
|
|
}),
|
|
}
|
|
for i in range(1, MAX_PAIRS + 1):
|
|
required[f"label_{i}"] = ("STRING", {
|
|
"default": f"Preset {i}",
|
|
"multiline": False,
|
|
})
|
|
required[f"sampler_{i}"] = (
|
|
comfy.samplers.KSampler.SAMPLERS,
|
|
{"default": DEFAULT_SAMPLER},
|
|
)
|
|
required[f"scheduler_{i}"] = (
|
|
comfy.samplers.KSampler.SCHEDULERS,
|
|
{"default": DEFAULT_SCHEDULER},
|
|
)
|
|
required[f"steps_{i}"] = ("INT", {
|
|
"default": DEFAULT_STEPS,
|
|
"min": 1,
|
|
"max": 200,
|
|
"step": 1,
|
|
})
|
|
return {"required": required}
|
|
|
|
RETURN_TYPES = (PRESETS_TYPE,)
|
|
RETURN_NAMES = ("presets",)
|
|
FUNCTION = "build_combo"
|
|
CATEGORY = "sampling"
|
|
|
|
def build_combo(self, pair_count, **kwargs):
|
|
presets = build_presets(pair_count, kwargs)
|
|
return (presets,)
|