Compare commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
70d0540895 |
@@ -27,7 +27,7 @@ class SEGSDetailerForAnimateDiff:
|
|||||||
"sampler_name": (comfy.samplers.KSampler.SAMPLERS,),
|
"sampler_name": (comfy.samplers.KSampler.SAMPLERS,),
|
||||||
"scheduler": (core.SCHEDULERS,),
|
"scheduler": (core.SCHEDULERS,),
|
||||||
"denoise": ("FLOAT", {"default": 0.5, "min": 0.0001, "max": 1.0, "step": 0.01}),
|
"denoise": ("FLOAT", {"default": 0.5, "min": 0.0001, "max": 1.0, "step": 0.01}),
|
||||||
"basic_pipe": ("BASIC_PIPE",),
|
"basic_pipe": ("BASIC_PIPE", {"tooltip": "If the `ImpactDummyInput` is connected to the model in the basic_pipe, the inference stage is skipped."}),
|
||||||
"refiner_ratio": ("FLOAT", {"default": 0.2, "min": 0.0, "max": 1.0}),
|
"refiner_ratio": ("FLOAT", {"default": 0.2, "min": 0.0, "max": 1.0}),
|
||||||
},
|
},
|
||||||
"optional": {
|
"optional": {
|
||||||
@@ -60,7 +60,7 @@ class SEGSDetailerForAnimateDiff:
|
|||||||
new_segs = []
|
new_segs = []
|
||||||
cnet_image_list = []
|
cnet_image_list = []
|
||||||
|
|
||||||
if noise_mask_feather > 0 and 'denoise_mask_function' not in model.model_options:
|
if not (isinstance(model, str) and model == "DUMMY") and noise_mask_feather > 0 and 'denoise_mask_function' not in model.model_options:
|
||||||
model = nodes_differential_diffusion.DifferentialDiffusion().apply(model)[0]
|
model = nodes_differential_diffusion.DifferentialDiffusion().apply(model)[0]
|
||||||
|
|
||||||
for seg in segs[1]:
|
for seg in segs[1]:
|
||||||
@@ -94,13 +94,18 @@ class SEGSDetailerForAnimateDiff:
|
|||||||
for condition, details in negative
|
for condition, details in negative
|
||||||
]
|
]
|
||||||
|
|
||||||
enhanced_image_tensor, cnet_images = core.enhance_detail_for_animatediff(cropped_image_frames, model, clip, vae, guide_size, guide_size_for, max_size,
|
if not (isinstance(model, str) and model == "DUMMY"):
|
||||||
seg.bbox, seed, steps, cfg, sampler_name, scheduler,
|
enhanced_image_tensor, cnet_images = core.enhance_detail_for_animatediff(cropped_image_frames, model, clip, vae, guide_size, guide_size_for, max_size,
|
||||||
cropped_positive, cropped_negative, denoise, seg.cropped_mask,
|
seg.bbox, seed, steps, cfg, sampler_name, scheduler,
|
||||||
refiner_ratio=refiner_ratio, refiner_model=refiner_model,
|
cropped_positive, cropped_negative, denoise, seg.cropped_mask,
|
||||||
refiner_clip=refiner_clip, refiner_positive=refiner_positive,
|
refiner_ratio=refiner_ratio, refiner_model=refiner_model,
|
||||||
refiner_negative=refiner_negative, control_net_wrapper=seg.control_net_wrapper,
|
refiner_clip=refiner_clip, refiner_positive=refiner_positive,
|
||||||
noise_mask_feather=noise_mask_feather, scheduler_func=scheduler_func_opt)
|
refiner_negative=refiner_negative, control_net_wrapper=seg.control_net_wrapper,
|
||||||
|
noise_mask_feather=noise_mask_feather, scheduler_func=scheduler_func_opt)
|
||||||
|
else:
|
||||||
|
enhanced_image_tensor = cropped_image_frames
|
||||||
|
cnet_images = None
|
||||||
|
|
||||||
if cnet_images is not None:
|
if cnet_images is not None:
|
||||||
cnet_image_list.extend(cnet_images)
|
cnet_image_list.extend(cnet_images)
|
||||||
|
|
||||||
@@ -143,7 +148,7 @@ class DetailerForEachPipeForAnimateDiff:
|
|||||||
"scheduler": (core.SCHEDULERS,),
|
"scheduler": (core.SCHEDULERS,),
|
||||||
"denoise": ("FLOAT", {"default": 0.5, "min": 0.0001, "max": 1.0, "step": 0.01}),
|
"denoise": ("FLOAT", {"default": 0.5, "min": 0.0001, "max": 1.0, "step": 0.01}),
|
||||||
"feather": ("INT", {"default": 5, "min": 0, "max": 100, "step": 1}),
|
"feather": ("INT", {"default": 5, "min": 0, "max": 100, "step": 1}),
|
||||||
"basic_pipe": ("BASIC_PIPE", ),
|
"basic_pipe": ("BASIC_PIPE", {"tooltip": "If the `ImpactDummyInput` is connected to the model in the basic_pipe, the inference stage is skipped."}),
|
||||||
"refiner_ratio": ("FLOAT", {"default": 0.2, "min": 0.0, "max": 1.0}),
|
"refiner_ratio": ("FLOAT", {"default": 0.2, "min": 0.0, "max": 1.0}),
|
||||||
},
|
},
|
||||||
"optional": {
|
"optional": {
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
import configparser
|
import configparser
|
||||||
import os
|
import os
|
||||||
|
|
||||||
version_code = [8, 3]
|
version_code = [8, 3, 1]
|
||||||
version = f"V{version_code[0]}.{version_code[1]}" + (f'.{version_code[2]}' if len(version_code) > 2 else '')
|
version = f"V{version_code[0]}.{version_code[1]}" + (f'.{version_code[2]}' if len(version_code) > 2 else '')
|
||||||
|
|
||||||
dependency_version = 24
|
dependency_version = 24
|
||||||
|
|||||||
@@ -192,7 +192,7 @@ class DetailerForEach:
|
|||||||
return {"required": {
|
return {"required": {
|
||||||
"image": ("IMAGE", ),
|
"image": ("IMAGE", ),
|
||||||
"segs": ("SEGS", ),
|
"segs": ("SEGS", ),
|
||||||
"model": ("MODEL",),
|
"model": ("MODEL", {"tooltip": "If the `ImpactDummyInput` is connected to the model, the inference stage is skipped."}),
|
||||||
"clip": ("CLIP",),
|
"clip": ("CLIP",),
|
||||||
"vae": ("VAE",),
|
"vae": ("VAE",),
|
||||||
"guide_size": ("FLOAT", {"default": 512, "min": 64, "max": nodes.MAX_RESOLUTION, "step": 8}),
|
"guide_size": ("FLOAT", {"default": 512, "min": 64, "max": nodes.MAX_RESOLUTION, "step": 8}),
|
||||||
@@ -413,7 +413,7 @@ class DetailerForEachPipe:
|
|||||||
"feather": ("INT", {"default": 5, "min": 0, "max": 100, "step": 1}),
|
"feather": ("INT", {"default": 5, "min": 0, "max": 100, "step": 1}),
|
||||||
"noise_mask": ("BOOLEAN", {"default": True, "label_on": "enabled", "label_off": "disabled"}),
|
"noise_mask": ("BOOLEAN", {"default": True, "label_on": "enabled", "label_off": "disabled"}),
|
||||||
"force_inpaint": ("BOOLEAN", {"default": True, "label_on": "enabled", "label_off": "disabled"}),
|
"force_inpaint": ("BOOLEAN", {"default": True, "label_on": "enabled", "label_off": "disabled"}),
|
||||||
"basic_pipe": ("BASIC_PIPE", ),
|
"basic_pipe": ("BASIC_PIPE", {"tooltip": "If the `ImpactDummyInput` is connected to the model in the basic_pipe, the inference stage is skipped."}),
|
||||||
"wildcard": ("STRING", {"multiline": True, "dynamicPrompts": False}),
|
"wildcard": ("STRING", {"multiline": True, "dynamicPrompts": False}),
|
||||||
"refiner_ratio": ("FLOAT", {"default": 0.2, "min": 0.0, "max": 1.0}),
|
"refiner_ratio": ("FLOAT", {"default": 0.2, "min": 0.0, "max": 1.0}),
|
||||||
|
|
||||||
@@ -470,7 +470,7 @@ class FaceDetailer:
|
|||||||
def INPUT_TYPES(s):
|
def INPUT_TYPES(s):
|
||||||
return {"required": {
|
return {"required": {
|
||||||
"image": ("IMAGE", ),
|
"image": ("IMAGE", ),
|
||||||
"model": ("MODEL",),
|
"model": ("MODEL", {"tooltip": "If the `ImpactDummyInput` is connected to the model, the inference stage is skipped."}),
|
||||||
"clip": ("CLIP",),
|
"clip": ("CLIP",),
|
||||||
"vae": ("VAE",),
|
"vae": ("VAE",),
|
||||||
"guide_size": ("FLOAT", {"default": 512, "min": 64, "max": nodes.MAX_RESOLUTION, "step": 8}),
|
"guide_size": ("FLOAT", {"default": 512, "min": 64, "max": nodes.MAX_RESOLUTION, "step": 8}),
|
||||||
@@ -1347,7 +1347,7 @@ class FaceDetailerPipe:
|
|||||||
def INPUT_TYPES(s):
|
def INPUT_TYPES(s):
|
||||||
return {"required": {
|
return {"required": {
|
||||||
"image": ("IMAGE", ),
|
"image": ("IMAGE", ),
|
||||||
"detailer_pipe": ("DETAILER_PIPE",),
|
"detailer_pipe": ("DETAILER_PIPE", {"tooltip": "If the `ImpactDummyInput` is connected to the model in the detailer_pipe, the inference stage is skipped."}),
|
||||||
"guide_size": ("FLOAT", {"default": 512, "min": 64, "max": nodes.MAX_RESOLUTION, "step": 8}),
|
"guide_size": ("FLOAT", {"default": 512, "min": 64, "max": nodes.MAX_RESOLUTION, "step": 8}),
|
||||||
"guide_size_for": ("BOOLEAN", {"default": True, "label_on": "bbox", "label_off": "crop_region"}),
|
"guide_size_for": ("BOOLEAN", {"default": True, "label_on": "bbox", "label_off": "crop_region"}),
|
||||||
"max_size": ("FLOAT", {"default": 1024, "min": 64, "max": nodes.MAX_RESOLUTION, "step": 8}),
|
"max_size": ("FLOAT", {"default": 1024, "min": 64, "max": nodes.MAX_RESOLUTION, "step": 8}),
|
||||||
|
|||||||
@@ -38,7 +38,7 @@ class SEGSDetailer:
|
|||||||
"denoise": ("FLOAT", {"default": 0.5, "min": 0.0001, "max": 1.0, "step": 0.01}),
|
"denoise": ("FLOAT", {"default": 0.5, "min": 0.0001, "max": 1.0, "step": 0.01}),
|
||||||
"noise_mask": ("BOOLEAN", {"default": True, "label_on": "enabled", "label_off": "disabled"}),
|
"noise_mask": ("BOOLEAN", {"default": True, "label_on": "enabled", "label_off": "disabled"}),
|
||||||
"force_inpaint": ("BOOLEAN", {"default": True, "label_on": "enabled", "label_off": "disabled"}),
|
"force_inpaint": ("BOOLEAN", {"default": True, "label_on": "enabled", "label_off": "disabled"}),
|
||||||
"basic_pipe": ("BASIC_PIPE",),
|
"basic_pipe": ("BASIC_PIPE", {"tooltip": "If the `ImpactDummyInput` is connected to the model in the basic_pipe, the inference stage is skipped."}),
|
||||||
"refiner_ratio": ("FLOAT", {"default": 0.2, "min": 0.0, "max": 1.0}),
|
"refiner_ratio": ("FLOAT", {"default": 0.2, "min": 0.0, "max": 1.0}),
|
||||||
"batch_size": ("INT", {"default": 1, "min": 1, "max": 100}),
|
"batch_size": ("INT", {"default": 1, "min": 1, "max": 100}),
|
||||||
|
|
||||||
@@ -76,7 +76,7 @@ class SEGSDetailer:
|
|||||||
new_segs = []
|
new_segs = []
|
||||||
cnet_pil_list = []
|
cnet_pil_list = []
|
||||||
|
|
||||||
if noise_mask_feather > 0 and 'denoise_mask_function' not in model.model_options:
|
if not (isinstance(model, str) and model == "DUMMY") and noise_mask_feather > 0 and 'denoise_mask_function' not in model.model_options:
|
||||||
model = nodes_differential_diffusion.DifferentialDiffusion().apply(model)[0]
|
model = nodes_differential_diffusion.DifferentialDiffusion().apply(model)[0]
|
||||||
|
|
||||||
for i in range(batch_size):
|
for i in range(batch_size):
|
||||||
@@ -113,13 +113,17 @@ class SEGSDetailer:
|
|||||||
for condition, details in negative
|
for condition, details in negative
|
||||||
]
|
]
|
||||||
|
|
||||||
enhanced_image, cnet_pils = core.enhance_detail(cropped_image, model, clip, vae, guide_size, guide_size_for, max_size,
|
if not (isinstance(model, str) and model == "DUMMY"):
|
||||||
seg.bbox, seed, steps, cfg, sampler_name, scheduler,
|
enhanced_image, cnet_pils = core.enhance_detail(cropped_image, model, clip, vae, guide_size, guide_size_for, max_size,
|
||||||
cropped_positive, cropped_negative, denoise, cropped_mask, force_inpaint,
|
seg.bbox, seed, steps, cfg, sampler_name, scheduler,
|
||||||
refiner_ratio=refiner_ratio, refiner_model=refiner_model,
|
cropped_positive, cropped_negative, denoise, cropped_mask, force_inpaint,
|
||||||
refiner_clip=refiner_clip, refiner_positive=refiner_positive, refiner_negative=refiner_negative,
|
refiner_ratio=refiner_ratio, refiner_model=refiner_model,
|
||||||
control_net_wrapper=seg.control_net_wrapper, cycle=cycle,
|
refiner_clip=refiner_clip, refiner_positive=refiner_positive, refiner_negative=refiner_negative,
|
||||||
inpaint_model=inpaint_model, noise_mask_feather=noise_mask_feather, scheduler_func=scheduler_func_opt)
|
control_net_wrapper=seg.control_net_wrapper, cycle=cycle,
|
||||||
|
inpaint_model=inpaint_model, noise_mask_feather=noise_mask_feather, scheduler_func=scheduler_func_opt)
|
||||||
|
else:
|
||||||
|
enhanced_image = cropped_image
|
||||||
|
cnet_pils = None
|
||||||
|
|
||||||
if cnet_pils is not None:
|
if cnet_pils is not None:
|
||||||
cnet_pil_list.extend(cnet_pils)
|
cnet_pil_list.extend(cnet_pils)
|
||||||
|
|||||||
+1
-1
@@ -1,7 +1,7 @@
|
|||||||
[project]
|
[project]
|
||||||
name = "comfyui-impact-pack"
|
name = "comfyui-impact-pack"
|
||||||
description = "This node pack offers various detector nodes and detailer nodes that allow you to configure a workflow that automatically enhances facial details. And provide iterative upscaler."
|
description = "This node pack offers various detector nodes and detailer nodes that allow you to configure a workflow that automatically enhances facial details. And provide iterative upscaler."
|
||||||
version = "8.3"
|
version = "8.3.1"
|
||||||
license = { file = "LICENSE.txt" }
|
license = { file = "LICENSE.txt" }
|
||||||
dependencies = ["segment-anything", "scikit-image", "piexif", "transformers", "opencv-python-headless", "GitPython", "scipy>=1.11.4"]
|
dependencies = ["segment-anything", "scikit-image", "piexif", "transformers", "opencv-python-headless", "GitPython", "scipy>=1.11.4"]
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user