ltdrdata / ComfyUI-Impact-Pack

Custom nodes pack for ComfyUI This custom node helps to conveniently enhance images through Detector, Detailer, Upscaler, Pipe, and more.
GNU General Public License v3.0
1.89k stars 183 forks source link

Error in BBOXDetectorSEGS #52

Closed GalaxyTimeMachine closed 1 year ago

GalaxyTimeMachine commented 1 year ago

I had a working workflow, updated to 9c13ec6, replaced the mmdetdetector node with ultralyticsdetector node and no get this error when trying to use it:

Traceback (most recent call last):
  File "F:\ComfyUI_windows_portable\ComfyUI\execution.py", line 144, in recursive_execute
    output_data, output_ui = get_output_data(obj, input_data_all)
  File "F:\ComfyUI_windows_portable\ComfyUI\execution.py", line 74, in get_output_data
    return_values = map_node_over_list(obj, input_data_all, obj.FUNCTION, allow_interrupt=True)
  File "F:\ComfyUI_windows_portable\ComfyUI\execution.py", line 67, in map_node_over_list
    results.append(getattr(obj, func)(**slice_dict(input_data_all, i)))
  File "F:\ComfyUI_windows_portable\ComfyUI\custom_nodes\ComfyUI-Impact-Pack\modules\impact\detectors.py", line 83, in doit
    segs = bbox_detector.detect(image, threshold, dilation, crop_factor, drop_size)
  File "F:\ComfyUI_windows_portable\ComfyUI\custom_nodes\ComfyUI-Impact-Pack\subpack\impact\subcore.py", line 94, in detect
    detected_results = inference_bbox(self.bbox_model, core.tensor2pil(image), threshold)
  File "F:\ComfyUI_windows_portable\ComfyUI\custom_nodes\ComfyUI-Impact-Pack\subpack\impact\subcore.py", line 48, in inference_bbox
    results[0].append(pred[0].names[i])
KeyError: 1

If you need the workflow, it's in this image. SDXL0 9_Refiner_00006_

GalaxyTimeMachine commented 1 year ago

I've gone back to using the MMDETDetectorProvidor and that works without any error.

GalaxyTimeMachine commented 1 year ago

I can confirm this is also caused by the pythongosssss ComfyUI\web\extensions\pysssss\CustomScripts\presetText.js again. Removed that script and this now works correctly.

GalaxyTimeMachine commented 1 year ago

I've also opened: https://github.com/pythongosssss/ComfyUI-Custom-Scripts/issues/20

Davikar commented 1 year ago

Hmm, I have this issue as well, but I don't have the pythongosssss extension... I have; ComfyUI Impact Pack ComfyUI_experiments/sampler_tonemap ComfyUI Cutoff Tiled sampling for ComfyUI Efficiency Nodes for ComfyUI UltimateSDUpscale OpenPose Editor

ltdrdata commented 1 year ago

This is patched. Check that.

Davikar commented 1 year ago

I am still getting that error message.

ltdrdata commented 1 year ago

I am still getting that error message.

In that case goto subpack dir inside ComfyUI-Impact-Pack in cmd.

custom_nodes/ComfyUI-Impact-Pack/subpack

And execute "git pull".

Davikar commented 1 year ago

I am still getting that error message.

In that case goto subpack dir inside ComfyUI-Impact-Pack in cmd.

And execute "git pull".

I did. It's up to date. I noticed that it's not exactly the same though,

Error occurred when executing FaceDetailer:

1

File "C:\AI\ComfyUI\ComfyUI\execution.py", line 144, in recursive_execute
output_data, output_ui = get_output_data(obj, input_data_all)
File "C:\AI\ComfyUI\ComfyUI\execution.py", line 74, in get_output_data
return_values = map_node_over_list(obj, input_data_all, obj.FUNCTION, allow_interrupt=True)
File "C:\AI\ComfyUI\ComfyUI\execution.py", line 67, in map_node_over_list
results.append(getattr(obj, func)(**slice_dict(input_data_all, i)))
File "C:\AI\ComfyUI\ComfyUI\custom_nodes\ComfyUI-Impact-Pack\modules\impact\impact_pack.py", line 805, in doit
enhanced_img, cropped_enhanced, cropped_enhanced_alpha, mask = FaceDetailer.enhance_face(
File "C:\AI\ComfyUI\ComfyUI\custom_nodes\ComfyUI-Impact-Pack\modules\impact\impact_pack.py", line 773, in enhance_face
segs = bbox_detector.detect(image, bbox_threshold, bbox_dilation, bbox_crop_factor, drop_size)
File "C:\AI\ComfyUI\ComfyUI\custom_nodes\ComfyUI-Impact-Pack\subpack\impact\subcore.py", line 94, in detect
detected_results = inference_bbox(self.bbox_model, core.tensor2pil(image), threshold)
File "C:\AI\ComfyUI\ComfyUI\custom_nodes\ComfyUI-Impact-Pack\subpack\impact\subcore.py", line 48, in inference_bbox
results[0].append(pred[0].names[i])
ltdrdata commented 1 year ago

I am still getting that error message.

In that case goto subpack dir inside ComfyUI-Impact-Pack in cmd.

And execute "git pull".

I did. It's up to date. I noticed that it's not exactly the same though,

Error occurred when executing FaceDetailer:

1

File "C:\AI\ComfyUI\ComfyUI\execution.py", line 144, in recursive_execute
output_data, output_ui = get_output_data(obj, input_data_all)
File "C:\AI\ComfyUI\ComfyUI\execution.py", line 74, in get_output_data
return_values = map_node_over_list(obj, input_data_all, obj.FUNCTION, allow_interrupt=True)
File "C:\AI\ComfyUI\ComfyUI\execution.py", line 67, in map_node_over_list
results.append(getattr(obj, func)(**slice_dict(input_data_all, i)))
File "C:\AI\ComfyUI\ComfyUI\custom_nodes\ComfyUI-Impact-Pack\modules\impact\impact_pack.py", line 805, in doit
enhanced_img, cropped_enhanced, cropped_enhanced_alpha, mask = FaceDetailer.enhance_face(
File "C:\AI\ComfyUI\ComfyUI\custom_nodes\ComfyUI-Impact-Pack\modules\impact\impact_pack.py", line 773, in enhance_face
segs = bbox_detector.detect(image, bbox_threshold, bbox_dilation, bbox_crop_factor, drop_size)
File "C:\AI\ComfyUI\ComfyUI\custom_nodes\ComfyUI-Impact-Pack\subpack\impact\subcore.py", line 94, in detect
detected_results = inference_bbox(self.bbox_model, core.tensor2pil(image), threshold)
File "C:\AI\ComfyUI\ComfyUI\custom_nodes\ComfyUI-Impact-Pack\subpack\impact\subcore.py", line 48, in inference_bbox
results[0].append(pred[0].names[i])

It's not updated definitely. show me the log of "git branch -al" and "git log" on subpack dir.

Davikar commented 1 year ago
$ git branch -al
* Main
  remotes/origin/HEAD -> origin/Main
  remotes/origin/Main
  remotes/origin/feature/sub

theda@DaviKar MINGW64 /c/AI/ComfyUI/ComfyUI/custom_nodes/ComfyUI-Impact-Pack (Main)
$ git log
commit 5635039be17d76aba634a3b20abd46f9208caf2b (HEAD -> Main, origin/Main, origin/HEAD)
Author: Dr.Lt.Data <128333288+ltdrdata@users.noreply.github.com>
Date:   Mon Jul 24 08:11:21 2023 +0900

    Update config.py

commit 2d1582a6196965152215c6756afefbd1f4a10724
Author: Dr.Lt.Data <dr.lt.data@gmail.com>
Date:   Mon Jul 24 08:05:01 2023 +0900

    bugfix: subpack crash

commit 9c13ec64cc81a406dec6416c20562087af079df9
Author: Dr.Lt.Data <dr.lt.data@gmail.com>
Date:   Sun Jul 23 23:10:10 2023 +0900

    bugfix: failed to activate mmdet nodes
ltdrdata commented 1 year ago
$ git branch -al
* Main
  remotes/origin/HEAD -> origin/Main
  remotes/origin/Main
  remotes/origin/feature/sub

theda@DaviKar MINGW64 /c/AI/ComfyUI/ComfyUI/custom_nodes/ComfyUI-Impact-Pack (Main)
$ git log
commit 5635039be17d76aba634a3b20abd46f9208caf2b (HEAD -> Main, origin/Main, origin/HEAD)
Author: Dr.Lt.Data <128333288+ltdrdata@users.noreply.github.com>
Date:   Mon Jul 24 08:11:21 2023 +0900

    Update config.py

commit 2d1582a6196965152215c6756afefbd1f4a10724
Author: Dr.Lt.Data <dr.lt.data@gmail.com>
Date:   Mon Jul 24 08:05:01 2023 +0900

    bugfix: subpack crash

commit 9c13ec64cc81a406dec6416c20562087af079df9
Author: Dr.Lt.Data <dr.lt.data@gmail.com>
Date:   Sun Jul 23 23:10:10 2023 +0900

    bugfix: failed to activate mmdet nodes

Are you sure you are in custom_nodes/ComfyUI-Impact-Pack/subpack/ dir? That log shows that you are in custom_nodes/ComfyUI-Impact-Pack/.

To make sure, share me the screenshot on subpack dir.

dir and dir .git

If the .git directory is absent, the subpack repository may not be recognized and could be perceived as part of the parent repository.

Davikar commented 1 year ago

Ahhh, I didn't see that subpack dir was a separate thing. It's updated and working now! 👍🏻

ltdrdata commented 1 year ago

Ahhh, I didn't see that subpack dir was a separate thing. It's updated and working now! 👍🏻

In fact, after updating the Impact pack, the subpack should be automatically updated upon starting, but there seems to be an issue, and it appears that this is not working correctly.

Now I'd identified the reason.. Because I didn't familiar with submodule. Thanks a lot. I fixed that issue.