lllyasviel commited on
Commit
dbf3ae5
·
1 Parent(s): cd7cecf
Files changed (2) hide show
  1. modules/core.py +5 -4
  2. modules/samplers_advanced.py +1 -1
modules/core.py CHANGED
@@ -11,8 +11,7 @@ import comfy.utils
11
  from comfy.sd import load_checkpoint_guess_config
12
  from nodes import VAEDecode, EmptyLatentImage, CLIPTextEncode
13
  from comfy.sample import prepare_mask, broadcast_cond, load_additional_models, cleanup_additional_models
14
- from modules.samplers_advanced import KSamplerAdvanced
15
-
16
 
17
  opCLIPTextEncode = CLIPTextEncode()
18
  opEmptyLatentImage = EmptyLatentImage()
@@ -81,7 +80,9 @@ def close_all_preview():
81
 
82
 
83
  @torch.no_grad()
84
- def ksampler(model, positive, negative, latent, seed=None, steps=30, cfg=9.0, sampler_name='dpmpp_2m_sde', scheduler='karras', denoise=1.0, disable_noise=False, start_step=None, last_step=None, force_full_denoise=False):
 
 
85
  seed = seed if isinstance(seed, int) else random.randint(1, 2 ** 64)
86
 
87
  device = comfy.model_management.get_torch_device()
@@ -123,7 +124,7 @@ def ksampler(model, positive, negative, latent, seed=None, steps=30, cfg=9.0, sa
123
 
124
  models = load_additional_models(positive, negative, model.model_dtype())
125
 
126
- sampler = KSamplerAdvanced(real_model, steps=steps, device=device, sampler=sampler_name, scheduler=scheduler,
127
  denoise=denoise, model_options=model.model_options)
128
 
129
  samples = sampler.sample(noise, positive_copy, negative_copy, cfg=cfg, latent_image=latent_image,
 
11
  from comfy.sd import load_checkpoint_guess_config
12
  from nodes import VAEDecode, EmptyLatentImage, CLIPTextEncode
13
  from comfy.sample import prepare_mask, broadcast_cond, load_additional_models, cleanup_additional_models
14
+ from modules.samplers_advanced import KSampler, KSamplerWithRefiner
 
15
 
16
  opCLIPTextEncode = CLIPTextEncode()
17
  opEmptyLatentImage = EmptyLatentImage()
 
80
 
81
 
82
  @torch.no_grad()
83
+ def ksampler(model, positive, negative, latent, seed=None, steps=30, cfg=9.0, sampler_name='dpmpp_2m_sde',
84
+ scheduler='karras', denoise=1.0, disable_noise=False, start_step=None, last_step=None,
85
+ force_full_denoise=False):
86
  seed = seed if isinstance(seed, int) else random.randint(1, 2 ** 64)
87
 
88
  device = comfy.model_management.get_torch_device()
 
124
 
125
  models = load_additional_models(positive, negative, model.model_dtype())
126
 
127
+ sampler = KSampler(real_model, steps=steps, device=device, sampler=sampler_name, scheduler=scheduler,
128
  denoise=denoise, model_options=model.model_options)
129
 
130
  samples = sampler.sample(noise, positive_copy, negative_copy, cfg=cfg, latent_image=latent_image,
modules/samplers_advanced.py CHANGED
@@ -1,7 +1,7 @@
1
  from comfy.samplers import *
2
 
3
 
4
- class KSamplerAdvanced:
5
  SCHEDULERS = ["normal", "karras", "exponential", "simple", "ddim_uniform"]
6
  SAMPLERS = ["euler", "euler_ancestral", "heun", "dpm_2", "dpm_2_ancestral",
7
  "lms", "dpm_fast", "dpm_adaptive", "dpmpp_2s_ancestral", "dpmpp_sde", "dpmpp_sde_gpu",
 
1
  from comfy.samplers import *
2
 
3
 
4
+ class KSamplerWithRefiner:
5
  SCHEDULERS = ["normal", "karras", "exponential", "simple", "ddim_uniform"]
6
  SAMPLERS = ["euler", "euler_ancestral", "heun", "dpm_2", "dpm_2_ancestral",
7
  "lms", "dpm_fast", "dpm_adaptive", "dpmpp_2s_ancestral", "dpmpp_sde", "dpmpp_sde_gpu",