4141except : pass
4242audio_extensions = ['mp3' , 'mp4' , 'wav' , 'ogg' ]
4343
44-
44+ path_cwd = "ComfyUI/custom_nodes/ComfyUI-DeepFuze" if os . path . isdir ( "ComfyUI/custom_nodes/ComfyUI-DeepFuze" ) else "custom_nodes/ComfyUI-DeepFuze"
4545
4646video_extensions = ['webm' , 'mp4' , 'mkv' , 'gif' ]
4747
@@ -861,7 +861,7 @@ def pad(image):
861861 command .extend (['--execution-providers' ,"coreml" ])
862862 print (command )
863863 if platform == "win32" :
864- result = subprocess .run (command ,cwd = "ComfyUI/custom_nodes/ComfyUI-DeepFuze" ,stdout = subprocess .PIPE )
864+ result = subprocess .run (command ,cwd = path_cwd ,stdout = subprocess .PIPE )
865865 else :
866866 result = subprocess .run (command ,cwd = "custom_nodes/ComfyUI-DeepFuze" ,stdout = subprocess .PIPE )
867867 # audio_file = os.path.join(audio_dir,str(time.time()).replace(".","")+".wav")
@@ -888,7 +888,7 @@ def pad(image):
888888 command .extend (['--execution-providers' ,"coreml" ])
889889 print (command )
890890 if platform == "win32" :
891- result = subprocess .run (command ,cwd = "ComfyUI/custom_nodes/ComfyUI-DeepFuze" ,stdout = subprocess .PIPE )
891+ result = subprocess .run (command ,cwd = path_cwd ,stdout = subprocess .PIPE )
892892 else :
893893 result = subprocess .run (command ,cwd = "custom_nodes/ComfyUI-DeepFuze" ,stdout = subprocess .PIPE )
894894
@@ -912,7 +912,7 @@ def pad(image):
912912 elif device == "mps" :
913913 command .extend (['--execution-providers' ,"coreml" ])
914914 if platform == "win32" :
915- result = subprocess .run (command ,cwd = "ComfyUI/custom_nodes/ComfyUI-DeepFuze" ,stdout = subprocess .PIPE )
915+ result = subprocess .run (command ,cwd = path_cwd ,stdout = subprocess .PIPE )
916916 else :
917917 result = subprocess .run (command ,cwd = "custom_nodes/ComfyUI-DeepFuze" ,stdout = subprocess .PIPE )
918918 # temp_file = "/".join(faceswap_filename.split("/")[:-1]) + "_"+faceswap_filename.split("/")[-1]
@@ -1272,7 +1272,7 @@ def pad(image):
12721272 command .extend (['--execution-providers' ,"coreml" ])
12731273 print (command )
12741274 if platform == "win32" :
1275- result = subprocess .run (command ,cwd = "ComfyUI/custom_nodes/ComfyUI-DeepFuze" ,stdout = subprocess .PIPE )
1275+ result = subprocess .run (command ,cwd = path_cwd ,stdout = subprocess .PIPE )
12761276 else :
12771277 result = subprocess .run (command ,cwd = "custom_nodes/ComfyUI-DeepFuze" ,stdout = subprocess .PIPE )
12781278 # print(result.stdout.splitlines()[-1])
@@ -1296,7 +1296,7 @@ def pad(image):
12961296 command .extend (['--execution-providers' ,"coreml" ])
12971297 print (command )
12981298 if platform == "win32" :
1299- result = subprocess .run (command ,cwd = "ComfyUI/custom_nodes/ComfyUI-DeepFuze" ,stdout = subprocess .PIPE )
1299+ result = subprocess .run (command ,cwd = path_cwd ,stdout = subprocess .PIPE )
13001300 else :
13011301 result = subprocess .run (command ,cwd = "custom_nodes/ComfyUI-DeepFuze" ,stdout = subprocess .PIPE )
13021302 filename = enhanced_filename
@@ -1321,7 +1321,7 @@ def pad(image):
13211321 elif device == "mps" :
13221322 command .extend (['--execution-providers' ,"coreml" ])
13231323 if platform == "win32" :
1324- result = subprocess .run (command ,cwd = "ComfyUI/custom_nodes/ComfyUI-DeepFuze" ,stdout = subprocess .PIPE )
1324+ result = subprocess .run (command ,cwd = path_cwd ,stdout = subprocess .PIPE )
13251325 else :
13261326 result = subprocess .run (command ,cwd = "custom_nodes/ComfyUI-DeepFuze" ,stdout = subprocess .PIPE )
13271327 temp_file = enhanced_filename .replace (".mp4" ,"_.mp4" ) # "/".join(enhanced_filename.split("/")[:-1]) + "_"+enhanced_filename.split("/")[-1]
@@ -1428,7 +1428,7 @@ def generate_audio(self, audio, text,device,supported_language,llm_response=""):
14281428 '--device' , device
14291429 ]
14301430 if platform == "win32" :
1431- result = subprocess .run (command ,cwd = "ComfyUI/custom_nodes/ComfyUI-DeepFuze" ,stdout = subprocess .PIPE )
1431+ result = subprocess .run (command ,cwd = path_cwd ,stdout = subprocess .PIPE )
14321432 else :
14331433 result = subprocess .run (command , cwd = "custom_nodes/ComfyUI-DeepFuze" ,capture_output = True , text = True )
14341434
@@ -1495,7 +1495,7 @@ def test(self, images, face_mask_padding_left, face_mask_padding_right,face_mask
14951495 ]
14961496 print (command )
14971497 if platform == "win32" :
1498- result = subprocess .run (command ,cwd = "ComfyUI/custom_nodes/ComfyUI-DeepFuze" ,stdout = subprocess .PIPE )
1498+ result = subprocess .run (command ,cwd = path_cwd ,stdout = subprocess .PIPE )
14991499 else :
15001500 result = subprocess .run (command ,cwd = "custom_nodes/ComfyUI-DeepFuze" ,stdout = subprocess .PIPE )
15011501 print (result .stdout )
0 commit comments