diff --git a/modules/impact/config.py b/modules/impact/config.py index d01ae427..ef573531 100644 --- a/modules/impact/config.py +++ b/modules/impact/config.py @@ -1,7 +1,7 @@ import configparser import os -version_code = [6, 0, 2] +version_code = [6, 0, 3] version = f"V{version_code[0]}.{version_code[1]}" + (f'.{version_code[2]}' if len(version_code) > 2 else '') dependency_version = 22 diff --git a/modules/impact/impact_sampling.py b/modules/impact/impact_sampling.py index 5c74a8d7..ea1eb45f 100644 --- a/modules/impact/impact_sampling.py +++ b/modules/impact/impact_sampling.py @@ -143,15 +143,6 @@ def touched_callback(step, x0, x, total_steps): disable_pbar = not comfy.utils.PROGRESS_BAR_ENABLED - if negative != 'NegativePlaceholder': - guider = comfy.samplers.CFGGuider(model) - guider.set_conds(positive, negative) - guider.set_cfg(cfg) - else: - guider = nodes_custom_sampler.Guider_Basic(model) - positive = node_helpers.conditioning_set_values(positive, {"guidance": cfg}) - guider.set_conds(positive) - device = mm.get_torch_device() noise = noise.to(device) @@ -159,7 +150,20 @@ def touched_callback(step, x0, x, total_steps): if noise_mask is not None: noise_mask = noise_mask.to(device) - samples = guider.sample(noise, latent_image, sampler, sigmas, denoise_mask=noise_mask, callback=touched_callback, disable_pbar=disable_pbar, seed=noise_seed) + if negative != 'NegativePlaceholder': + # This way is incompatible with Advanced ControlNet, yet. + # guider = comfy.samplers.CFGGuider(model) + # guider.set_conds(positive, negative) + # guider.set_cfg(cfg) + samples = comfy.sample.sample_custom(model, noise, cfg, sampler, sigmas, positive, negative, latent_image, + noise_mask=noise_mask, callback=touched_callback, + disable_pbar=disable_pbar, seed=noise_seed) + else: + guider = nodes_custom_sampler.Guider_Basic(model) + positive = node_helpers.conditioning_set_values(positive, {"guidance": cfg}) + guider.set_conds(positive) + samples = guider.sample(noise, latent_image, sampler, sigmas, denoise_mask=noise_mask, callback=touched_callback, disable_pbar=disable_pbar, seed=noise_seed) + samples = samples.to(comfy.model_management.intermediate_device()) out["samples"] = samples diff --git a/pyproject.toml b/pyproject.toml index b61afb70..81a7c767 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,7 +1,7 @@ [project] name = "comfyui-impact-pack" description = "This extension offers various detector nodes and detailer nodes that allow you to configure a workflow that automatically enhances facial details. And provide iterative upscaler." -version = "6.0.2" +version = "6.0.3" license = { file = "LICENSE.txt" } dependencies = ["segment-anything", "scikit-image", "piexif", "transformers", "opencv-python-headless", "GitPython", "scipy>=1.11.4"]