-
Notifications
You must be signed in to change notification settings - Fork 6
Expand file tree
/
Copy path__init__.py
More file actions
26 lines (23 loc) · 980 Bytes
/
__init__.py
File metadata and controls
26 lines (23 loc) · 980 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
from .custom_samplers import SamplerDistance, SamplerDistanceAdvanced
from .presets_to_add import extra_samplers
def add_samplers():
from comfy.samplers import KSampler, k_diffusion_sampling
added = 0
samplers_names = [n for n in extra_samplers][::-1]
for sampler in samplers_names:
if sampler not in KSampler.SAMPLERS:
try:
idx = KSampler.SAMPLERS.index("uni_pc_bh2") # Last item in the samplers list
KSampler.SAMPLERS.insert(idx+1, sampler) # Add our custom samplers
setattr(k_diffusion_sampling, "sample_{}".format(sampler), extra_samplers[sampler])
added += 1
except ValueError as _err:
pass
if added > 0:
import importlib
importlib.reload(k_diffusion_sampling)
add_samplers()
NODE_CLASS_MAPPINGS = {
"SamplerDistance": SamplerDistance,
"SamplerDistanceAdvanced": SamplerDistanceAdvanced,
}