Compare commits

...
5 Commits
10 changed files with 25 additions and 21 deletions
+1 -1
View File
@@ -3,7 +3,7 @@ import os
import logging
version_code = [8, 19]
version_code = [8, 20, 1]
version = f"V{version_code[0]}.{version_code[1]}" + (f'.{version_code[2]}' if len(version_code) > 2 else '')
my_path = os.path.dirname(__file__)
+4 -4
View File
@@ -57,14 +57,14 @@ preview_bridge_last_mask_cache = {}
current_prompt = None
SCHEDULERS = comfy.samplers.KSampler.SCHEDULERS + ['AYS SDXL', 'AYS SD1', 'AYS SVD', 'GITS[coeff=1.2]', 'LTXV[default]', 'OSS FLUX', 'OSS Wan']
SCHEDULERS = comfy.samplers.KSampler.SCHEDULERS + ['AYS SDXL', 'AYS SD1', 'AYS SVD', 'GITS[coeff=1.2]', 'LTXV[default]', 'OSS FLUX', 'OSS Wan', 'OSS Chroma']
def is_execution_model_version_supported():
try:
import comfy_execution # noqa: F401
return True
except:
except Exception:
return False
@@ -2346,7 +2346,7 @@ class SafeToGPU:
if model_management.get_free_memory(device) > self.size * 1.3:
try:
obj.to(device)
except:
except Exception:
logging.warning(f"[Impact Pack] The model is not moved to the '{device}' due to insufficient memory. [1]")
else:
logging.warning(f"[Impact Pack] The model is not moved to the '{device}' due to insufficient memory. [2]")
@@ -2395,7 +2395,7 @@ try:
previewer = Latent2RGBPreviewer(latent_format.latent_rgb_factors)
return previewer
except:
except Exception:
logging.error("#########################################################################")
logging.error("[ERROR] ComfyUI-Impact-Pack: Please update ComfyUI to the latest version.")
logging.error("#########################################################################")
+4 -4
View File
@@ -377,7 +377,7 @@ class DetailerForEach:
if cnet_pils is not None:
cnet_pil_list.extend(cnet_pils)
if not (enhanced_image is None):
if enhanced_image is not None:
# don't latent composite-> converting to latent caused poor quality
# use image paste
image = image.cpu()
@@ -388,7 +388,7 @@ class DetailerForEach:
if detailer_hook is not None:
image = detailer_hook.post_paste(image)
if not (enhanced_image is None):
if enhanced_image is not None:
# Convert enhanced_pil_alpha to RGBA mode
enhanced_image_alpha = utils.tensor_convert_rgba(enhanced_image)
new_seg_image = enhanced_image.numpy() # alpha should not be applied to seg_image
@@ -672,7 +672,7 @@ class LatentPixelScale:
return {"required": {
"samples": ("LATENT", ),
"scale_method": (s.upscale_methods,),
"scale_factor": ("FLOAT", {"default": 1.5, "min": 0.1, "max": 10000, "step": 0.1}),
"scale_factor": ("FLOAT", {"default": 1.5, "min": 0.1, "max": 10000, "step": 0.05}),
"vae": ("VAE", ),
"use_tiled_vae": ("BOOLEAN", {"default": False, "label_on": "enabled", "label_off": "disabled"}),
},
@@ -2468,7 +2468,7 @@ class ImpactSchedulerAdapter:
def INPUT_TYPES(s):
return {"required": {
"scheduler": (comfy.samplers.KSampler.SCHEDULERS, {"defaultInput": True, }),
"extra_scheduler": (['None', 'AYS SDXL', 'AYS SD1', 'AYS SVD', 'GITS[coeff=1.2]', 'LTXV[default]', 'OSS FLUX', 'OSS Wan'],),
"extra_scheduler": (['None', 'AYS SDXL', 'AYS SD1', 'AYS SVD', 'GITS[coeff=1.2]', 'LTXV[default]', 'OSS FLUX', 'OSS Wan', 'OSS Chroma'],),
}}
CATEGORY = "ImpactPack/Util"
+1 -1
View File
@@ -14,7 +14,7 @@ import comfy.model_management as mm
try:
from comfy_extras.nodes_custom_sampler import Noise_EmptyNoise, Noise_RandomNoise
import node_helpers
except:
except Exception:
logging.warning("\n#############################################\n[Impact Pack] ComfyUI is an outdated version.\n#############################################\n")
raise Exception("[Impact Pack] ComfyUI is an outdated version.")
+4 -3
View File
@@ -12,6 +12,7 @@ import torchvision
import impact.core as core
import impact.impact_pack as impact_pack
from impact.utils import to_tensor
import impact.utils as utils
from segment_anything import SamPredictor, sam_model_registry
import numpy as np
import nodes
@@ -145,7 +146,7 @@ async def sam_detect(request):
plabs.append(0)
detected_masks = core.sam_predict(sam_predictor, points, plabs, None, threshold)
mask = core.combine_masks2(detected_masks)
mask = utils.combine_masks2(detected_masks)
if mask is None:
return web.Response(status=400)
@@ -373,7 +374,7 @@ def onprompt_for_switch(json_data):
if 'BOOLEAN' == input_node['inputs']['typ']:
try:
onprompt_cond_branch_info[k] = input_node['inputs']['value'].lower() == "true"
except:
except Exception:
pass
else:
onprompt_cond_branch_info[k] = cond_input
@@ -507,7 +508,7 @@ def onprompt_populate_wildcards(json_data):
else:
logging.info(f"[Impact Pack] Only `ImpactInt`, `Seed (rgthree)` and `Primitive` Node are allowed as the seed for '{v['class_type']}'. It will be ignored. ")
continue
except:
except Exception:
continue
else:
input_seed = int(inputs['seed'])
+2 -2
View File
@@ -654,7 +654,7 @@ class ImpactControlBridge:
# so extra_pnginfo is useless in here
try:
workflow = core.current_prompt['extra_data']['extra_pnginfo']['workflow']
except:
except Exception:
logging.info("[Impact Pack] core.current_prompt['extra_data']['extra_pnginfo']['workflow']")
return 0
@@ -713,7 +713,7 @@ class ImpactControlBridge:
PromptServer.instance.send_sync("impact-bridge-continue", {"node_id": unique_id, 'actives': list(should_be_active_nodes)})
nodes.interrupt_processing()
elif behavior == "Mute" or behavior == True:
elif behavior == "Mute" or behavior == True: # noqa: E712
# mute
should_be_mute_nodes = active_nodes + bypass_nodes
if len(should_be_mute_nodes) > 0:
+3 -3
View File
@@ -1130,7 +1130,7 @@ class DilateMaskInSEGS:
def doit(self, segs, dilation):
new_segs = []
for seg in segs[1]:
mask = core.dilate_mask(seg.cropped_mask, dilation)
mask = utils.dilate_mask(seg.cropped_mask, dilation)
seg = SEG(seg.cropped_image, mask, seg.confidence, seg.crop_region, seg.bbox, seg.label, seg.control_net_wrapper)
new_segs.append(seg)
@@ -1178,7 +1178,7 @@ class Dilate_SEG_ELT:
CATEGORY = "ImpactPack/Util"
def doit(self, seg, dilation):
mask = core.dilate_mask(seg.cropped_mask, dilation)
mask = utils.dilate_mask(seg.cropped_mask, dilation)
seg = SEG(seg.cropped_image, mask, seg.confidence, seg.crop_region, seg.bbox, seg.label, seg.control_net_wrapper)
return (seg,)
@@ -1963,7 +1963,7 @@ class SEGSUpscaler:
positive, negative, denoise,
noise_mask=cropped_mask, control_net_wrapper=seg.control_net_wrapper,
inpaint_model=inpaint_model, noise_mask_feather=noise_mask_feather, scheduler_func_opt=scheduler_func_opt)
if not (enhanced_image is None):
if enhanced_image is not None:
new_image = new_image.cpu()
enhanced_image = enhanced_image.cpu()
left = seg.crop_region[0]
+2 -2
View File
@@ -139,7 +139,7 @@ def process(text, seed=None):
if b is not None:
b = b.strip()
else:
b = "-1"
b = a
if r is not None:
if b is not None and is_numeric_string(a) and is_numeric_string(b):
@@ -572,7 +572,7 @@ def split_string_with_sep(input_string):
else:
try:
seed = int(matches[i][5:-1])
except:
except Exception:
seed = None
result_list.append(seed)
+1 -1
View File
@@ -1,7 +1,7 @@
[project]
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."
version = "8.19"
version = "8.20.1"
license = { file = "LICENSE.txt" }
dependencies = ["segment-anything", "scikit-image", "piexif", "transformers", "opencv-python-headless", "GitPython", "scipy>=1.11.4"]
+3
View File
@@ -0,0 +1,3 @@
[lint]
ignore = ["E402","E701"]
exclude = ["install.py", "*.ipynb"]