comfyui-reactor-node icon indicating copy to clipboard operation
comfyui-reactor-node copied to clipboard

[Feature]: Efficiency Improvement

Open hben35096 opened this issue 2 years ago • 2 comments

Feature description

Hello, I am currently using this plugin for face swapping in videos, and the results are excellent. However, I've noticed that the GPU usage during the node processing is almost zero, and the CPU usage is also quite low. It takes around ten minutes to process a few seconds of video. Is it possible to utilize more GPUs or additional CPUs to improve efficiency? image image

Additionally, I have another question regarding some minor visual distortions (screen shaking) around the facial area after face swapping. Could this be due to the facial detection range being too large (I suspect it's because the masking range is rectangular)? If the issue is related to the masking range, would increasing the detection accuracy, for example, using YOLO segmentation, help control the impact within the facial region?

hben35096 avatar Dec 15 '23 11:12 hben35096

Hello, I am currently using this plugin for face swapping in videos, and the results are excellent. However, I've noticed that the GPU usage during the node processing is almost zero, and the CPU usage is also quite low. It takes around ten minutes to process a few seconds of video. Is it possible to utilize more GPUs or additional CPUs to improve efficiency?

Hi, yes, I have in plans to add threads parameter to increase the processing speed

Additionally, I have another question regarding some minor visual distortions (screen shaking) around the facial area after face swapping. Could this be due to the facial detection range being too large (I suspect it's because the masking range is rectangular)? If the issue is related to the masking range, would increasing the detection accuracy, for example, using YOLO segmentation, help control the impact within the facial region?

That's right, mask is rectangular (in current version for ComfyUI), it will be resolved soon

Gourieff avatar Dec 16 '23 05:12 Gourieff

Hello, I am currently using this plugin for face swapping in videos, and the results are excellent. However, I've noticed that the GPU usage during the node processing is almost zero, and the CPU usage is also quite low. It takes around ten minutes to process a few seconds of video. Is it possible to utilize more GPUs or additional CPUs to improve efficiency?

Hi, yes, I have in plans to add threads parameter to increase the processing speed

Additionally, I have another question regarding some minor visual distortions (screen shaking) around the facial area after face swapping. Could this be due to the facial detection range being too large (I suspect it's because the masking range is rectangular)? If the issue is related to the masking range, would increasing the detection accuracy, for example, using YOLO segmentation, help control the impact within the facial region?

That's right, mask is rectangular (in current version for ComfyUI), it will be resolved soon

I have two YOLO8 seg models for facial detection here. Please check if they are suitable; you can download them from the ComfyUI manager. If further improvement in detection accuracy is needed, I can attempt to train the next version at some point. https://github.com/hben35096/assets/releases/tag/yolo8

hben35096 avatar Dec 16 '23 06:12 hben35096