fixed: switch nodes – compatibility fix from subgraph feature
refactor: ruff check https://github.com/ltdrdata/ComfyUI-Impact-Pack/issues/1071
This commit is contained in:
+1
-1
@@ -117,7 +117,7 @@ NODE_CLASS_MAPPINGS = {
|
||||
"UnsamplerHookProvider": UnsamplerHookProvider, # noqa: F405
|
||||
"CoreMLDetailerHookProvider": CoreMLDetailerHookProvider, # noqa: F405
|
||||
"PreviewDetailerHookProvider": PreviewDetailerHookProvider, # noqa: F405
|
||||
"BlackPatchRetryHookProvider": BlackPatchRetryHookProvider,
|
||||
"BlackPatchRetryHookProvider": BlackPatchRetryHookProvider, # noqa: F405
|
||||
"CustomSamplerDetailerHookProvider": CustomSamplerDetailerHookProvider, # noqa: F405
|
||||
"LamaRemoverDetailerHookProvider": LamaRemoverDetailerHookProvider, # noqa: F405
|
||||
|
||||
|
||||
@@ -367,6 +367,13 @@ app.registerExtension({
|
||||
if(!link_info)
|
||||
return;
|
||||
|
||||
// HOTFIX: subgraph
|
||||
const stackTrace = new Error().stack;
|
||||
|
||||
if(stackTrace.includes('convertToSubgraph')) {
|
||||
return;
|
||||
}
|
||||
|
||||
if(type == 2) {
|
||||
// connect output
|
||||
if(connected){
|
||||
@@ -512,6 +519,12 @@ app.registerExtension({
|
||||
const onConnectionsChange = nodeType.prototype.onConnectionsChange;
|
||||
nodeType.prototype.onConnectionsChange = function (type, index, connected, link_info) {
|
||||
const stackTrace = new Error().stack;
|
||||
|
||||
// HOTFIX: subgraph
|
||||
if(stackTrace.includes('convertToSubgraph')) {
|
||||
return;
|
||||
}
|
||||
|
||||
if(stackTrace.includes('loadGraphData')) {
|
||||
if(this.widgets?.[0]) {
|
||||
this.widgets[0].options.max = this.inputs.length-3;
|
||||
|
||||
@@ -3,7 +3,7 @@ import os
|
||||
import logging
|
||||
|
||||
|
||||
version_code = [8, 22]
|
||||
version_code = [8, 22, 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__)
|
||||
|
||||
@@ -528,7 +528,7 @@ class DetailerForEachAutoRetry:
|
||||
|
||||
is_mask_all_zeros = (seg.cropped_mask == 0).all().item()
|
||||
if is_mask_all_zeros:
|
||||
print(f"Detailer: segment skip [empty mask]")
|
||||
print("Detailer: segment skip [empty mask]")
|
||||
continue
|
||||
|
||||
if noise_mask:
|
||||
@@ -575,6 +575,11 @@ class DetailerForEachAutoRetry:
|
||||
break
|
||||
|
||||
orig_cropped_image = cropped_image.clone()
|
||||
|
||||
# initialize
|
||||
enhanced_image = cropped_image
|
||||
cnet_pils = None
|
||||
|
||||
if not (isinstance(model, str) and model == "DUMMY"):
|
||||
for retry in range(max_retries):
|
||||
enhanced_image, cnet_pils = core.enhance_detail(cropped_image, model, clip, vae, guide_size, guide_size_for_bbox, max_size,
|
||||
@@ -596,14 +601,11 @@ class DetailerForEachAutoRetry:
|
||||
raise Exception("Max retries reached")
|
||||
else:
|
||||
print("Detect bad patch, retrying...")
|
||||
else:
|
||||
enhanced_image = cropped_image
|
||||
cnet_pils = None
|
||||
|
||||
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()
|
||||
@@ -614,7 +616,7 @@ class DetailerForEachAutoRetry:
|
||||
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
|
||||
|
||||
+1
-1
@@ -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.22"
|
||||
version = "8.22.1"
|
||||
license = { file = "LICENSE.txt" }
|
||||
dependencies = ["segment-anything", "scikit-image", "piexif", "transformers", "opencv-python-headless", "GitPython", "scipy>=1.11.4"]
|
||||
|
||||
|
||||
Reference in New Issue
Block a user