Gourieff / comfyui-reactor-node

Fast and Simple Face Swap Extension Node for ComfyUI
GNU General Public License v3.0
1.08k stars 114 forks source link

I need your help~~~ #309

Open sparkshou opened 1 month ago

sparkshou commented 1 month ago

First, confirm

What happened?

reactor doesnt work,i dont know how to fix it~

Steps to reproduce the problem

Your workflow

Sysinfo

windows

Relevant console log

13:09:10 - ReActor - STATUS - Working: source face index [0], target face index [0]
13:09:10 - ReActor - STATUS - Analyzing Source Image...
13:09:17 - ReActor - STATUS - Analyzing Target Image...
13:09:19 - ReActor - STATUS - Detecting Source Face, Index = 0
13:09:19 - ReActor - STATUS - Detected: -21- y.o. Male
13:09:25 - ReActor - STATUS - Detecting Target Face, Index = 0
13:09:25 - ReActor - STATUS - Detected: -26- y.o. Female
13:09:25 - ReActor - STATUS - Swapping Source into Target
13:09:32 - ReActor - STATUS - Restoring the face with CodeFormer (weight: 0.5)
*** Error running postprocess_image: D:\Program Files (x86)\stable diffusion\extensions\sd-webui-reactor\scripts\reactor_faceswap.py
    Traceback (most recent call last):
      File "D:\Program Files (x86)\stable diffusion\modules\scripts.py", line 897, in postprocess_image
        script.postprocess_image(p, pp, *script_args)
      File "D:\Program Files (x86)\stable diffusion\extensions\sd-webui-reactor\scripts\reactor_faceswap.py", line 450, in postprocess_image
        result, output, swapped = swap_face(
      File "D:\Program Files (x86)\stable diffusion\extensions\sd-webui-reactor\scripts\reactor_swapper.py", line 616, in swap_face
        result_image, output, swapped = operate(source_img,target_img,target_img_orig,model,source_faces_index,faces_index,source_faces,target_faces,gender_source,gender_target,source_face,wrong_gender,source_age,source_gender,output,swapped,mask_face,entire_mask_image,enhancement_options,detection_options)
      File "D:\Program Files (x86)\stable diffusion\extensions\sd-webui-reactor\scripts\reactor_swapper.py", line 812, in operate
        result_image = enhance_image(result_image, enhancement_options)
      File "D:\Program Files (x86)\stable diffusion\extensions\sd-webui-reactor\scripts\reactor_swapper.py", line 217, in enhance_image
        result_image = restore_face(result_image, enhancement_options)
      File "D:\Program Files (x86)\stable diffusion\extensions\sd-webui-reactor\scripts\reactor_swapper.py", line 172, in restore_face
        numpy_image = codeformer_model.codeformer.restore(
      File "D:\Program Files (x86)\stable diffusion\modules\codeformer_model.py", line 55, in restore
        return self.restore_with_helper(np_image, restore_face)
      File "D:\Program Files (x86)\stable diffusion\modules\face_restoration_utils.py", line 156, in restore_with_helper
        self.send_model_to(self.get_device())
      File "D:\Program Files (x86)\stable diffusion\modules\face_restoration_utils.py", line 132, in send_model_to
        if self.face_helper:
      File "D:\Program Files (x86)\stable diffusion\python\lib\functools.py", line 981, in __get__
        val = self.func(instance)
      File "D:\Program Files (x86)\stable diffusion\modules\face_restoration_utils.py", line 126, in face_helper
        return create_face_helper(self.get_device())
      File "D:\Program Files (x86)\stable diffusion\modules\face_restoration_utils.py", line 47, in create_face_helper
        return FaceRestoreHelper(
      File "D:\Program Files (x86)\stable diffusion\python\lib\site-packages\facexlib\utils\face_restoration_helper.py", line 99, in __init__
        self.face_det = init_detection_model(det_model, half=False, device=self.device, model_rootpath=model_rootpath)
      File "D:\Program Files (x86)\stable diffusion\python\lib\site-packages\facexlib\detection\__init__.py", line 22, in init_detection_model
        load_net = torch.load(model_path, map_location=lambda storage, loc: storage)
      File "D:\Program Files (x86)\stable diffusion\modules\safe.py", line 108, in load
        return load_with_extra(filename, *args, extra_handler=global_extra_handler, **kwargs)
      File "D:\Program Files (x86)\stable diffusion\modules\safe.py", line 156, in load_with_extra
        return unsafe_torch_load(filename, *args, **kwargs)
      File "D:\Program Files (x86)\stable diffusion\python\lib\site-packages\torch\serialization.py", line 1040, in load
        return _legacy_load(opened_file, map_location, pickle_module, **pickle_load_args)
      File "D:\Program Files (x86)\stable diffusion\python\lib\site-packages\torch\serialization.py", line 1276, in _legacy_load
        typed_storage._untyped_storage._set_from_file(
    RuntimeError: unexpected EOF, expected 11537 more bytes. The file might be corrupted.

---

Additional information

No response