diff --git a/workflows/comfy/ComfyLauncher/ComfyRunnerForSidecar.py b/workflows/comfy/ComfyLauncher/ComfyRunnerForSidecar.py index 235f59a..71f0274 100644 --- a/workflows/comfy/ComfyLauncher/ComfyRunnerForSidecar.py +++ b/workflows/comfy/ComfyLauncher/ComfyRunnerForSidecar.py @@ -22,14 +22,12 @@ V2V_WORKFLOWS_DIRECTORY = os.environ.get("V2V_WORKFLOWS_DIRECTORY", COMFY_ROOT_DIRECTORY = os.environ.get("COMFY_ROOT_DIRECTORY", "/app/ComfyUI") -MAIN_IPA_WORKFLOW = os.environ.get("MAIN_IPA_WORKFLOW", "ipa_API_03-05-2024/yae_vid2vid_main(+IPA)_03-05_API.json") -FACE_DETAILER_WORKFLOW = os.environ.get("FACE_DETAILER_WORKFLOW", "yae_vid2vid_FaceDetailer_03-05_API.json") -UPSCALER_WORKFLOW = os.environ.get("UPSCALER_WORKFLOW", "yae_vid2vid_Upscale_03-05_API.json") -MAIN_IPA_WORKFLOW = os.environ.get("MAIN_IPA_WORKFLOW", "ipa_API_27-05-2024/yae_vid2vid_mainAYS_29-05_API.json") -FACE_DETAILER_WORKFLOW = os.environ.get("FACE_DETAILER_WORKFLOW", "ipa_API_27-05-2024/yae_vid2vid_FaceDetailerlipsCN_22-05_API.json") -UPSCALER_WORKFLOW = os.environ.get("UPSCALER_WORKFLOW", "ipa_API_27-05-2024/yae_vid2vid_UpscaleAYS_27-05_API.json") +MAIN_IPA_WORKFLOW = os.environ.get("MAIN_IPA_WORKFLOW", "3-06-2024/yae_vid2vid_main_29-06_API.json") +FACE_DETAILER_WORKFLOW = os.environ.get("FACE_DETAILER_WORKFLOW", "3-06-2024/yae_vid2vid_FaceDetailer_1-07_API.json") +UPSCALER_WORKFLOW = os.environ.get("UPSCALER_WORKFLOW", "3-06-2024/yae_vid2vid_Upscale_28-06_API.json") CINEMATIC_WORKFLOW = os.environ.get("CINEMATIC_WORKFLOW", "ipa_API_27-05-2024/yae_vid2vid_better_mainupscaler_29-05_API.json") + class PipelineType(IntEnum): BASE = auto() IPA = auto() @@ -87,6 +85,7 @@ def convert_pipline_output_to_input(left): def restore_last_pipeline_output(left): + print("Restoring last pipeline output to input from: " + str(left)) right = Path(COMFY_ROOT_DIRECTORY) / "output" / "vid2vid/SparseUpscaleInterp_00001.mp4" shutil.copy(left, right) @@ -218,7 +217,11 @@ def main(): input_video = Path(COMFY_ROOT_DIRECTORY) / "output" / f"vid2vid/SparseUpscaleInterp_0000{output_index}.mp4" output_index = output_index + 1 output_video = Path(COMFY_ROOT_DIRECTORY) / "output" / f"vid2vid/SparseUpscaleInterp_0000{output_index}.mp4" - invoke_facefusion(input_audio, input_video, output_video) + try: + invoke_facefusion(input_audio, input_video, output_video) + except Exception as e: + print("Facefusion failed!") + print(e) # check if output_video file exists if not output_video.exists(): print("Facefusion failed!") @@ -291,13 +294,20 @@ def generate_prompt_for_style(style_name, positive_prompt, negative_prompt, work workflow_json = json.load(open(workflow_directory / workflow_json_filename)) mapping_json = json.load(open(mappings_directory / mapping_json_filename)) - json_mods = style_json["modifications"] - jsonpath_mods = get_jsonpath_mods(json_mods, mapping_json, pos_in=positive_prompt, neg_in=negative_prompt, pipeline_type=pipeline_type, - denoise_first_pass=denoise_first_pass, - enable_lipsync=enable_lipsync, - disable_lcm=disable_lcm, - global_ipa_image_filename=global_ipa_image_filename, - global_ipa_strength=global_ipa_strength) + json_mods = {key: value for key, value in style_json["modifications"].items() if not key.startswith("cn_")} + + jsonpath_mods = get_jsonpath_mods( + json_mods, + mapping_json, + pos_in=positive_prompt, + neg_in=negative_prompt, + pipeline_type=pipeline_type, + denoise_first_pass=denoise_first_pass, + enable_lipsync=enable_lipsync, + disable_lcm=disable_lcm, + global_ipa_image_filename=global_ipa_image_filename, + global_ipa_strength=global_ipa_strength + ) print(*jsonpath_mods.items(), sep="\n") diff --git a/workflows/comfy/Dockerfile b/workflows/comfy/Dockerfile index ea422b3..b9d6d85 100644 --- a/workflows/comfy/Dockerfile +++ b/workflows/comfy/Dockerfile @@ -64,15 +64,15 @@ RUN chmod -R 777 /app # download & install comfy ui and its dependencies RUN python3 install.py --comfy-ui-url https://github.com/comfyanonymous/ComfyUI.git --comfy-ui-commit ece5acb8e8025d8ca26aa880f604d971d245475d -RUN python3 -m venv ComfyUI/venv -RUN ComfyUI/venv/bin/python -m pip install -r ComfyUI/requirements.txt --extra-index-url https://aiinfra.pkgs.visualstudio.com/PublicPackages/_packaging/onnxruntime-cuda-12/pypi/simple/ && \ - ComfyUI/venv/bin/python -m pip cache purge +RUN python3 -m venv venv +RUN venv/bin/python -m pip install -r ComfyUI/requirements.txt --extra-index-url https://aiinfra.pkgs.visualstudio.com/PublicPackages/_packaging/onnxruntime-cuda-12/pypi/simple/ && \ + venv/bin/python -m pip cache purge COPY --chown=appuser:appgroup required_requirements.txt /app/required_requirements.txt -RUN ComfyUI/venv/bin/python -m pip install -r required_requirements.txt --extra-index-url https://aiinfra.pkgs.visualstudio.com/PublicPackages/_packaging/onnxruntime-cuda-12/pypi/simple/ && \ - ComfyUI/venv/bin/python -m pip uninstall onnxruntime onnxruntime-gpu -y && \ - ComfyUI/venv/bin/python -m pip install onnxruntime-gpu ort-nightly-gpu --extra-index-url https://aiinfra.pkgs.visualstudio.com/PublicPackages/_packaging/onnxruntime-cuda-12/pypi/simple/ && \ - ComfyUI/venv/bin/python -m pip cache purge +RUN venv/bin/python -m pip install -r required_requirements.txt --extra-index-url https://aiinfra.pkgs.visualstudio.com/PublicPackages/_packaging/onnxruntime-cuda-12/pypi/simple/ && \ + venv/bin/python -m pip uninstall onnxruntime onnxruntime-gpu -y && \ + venv/bin/python -m pip install onnxruntime-gpu ort-nightly-gpu --extra-index-url https://aiinfra.pkgs.visualstudio.com/PublicPackages/_packaging/onnxruntime-cuda-12/pypi/simple/ && \ + venv/bin/python -m pip cache purge COPY --chown=appuser:appgroup repos.json /app/repos.json RUN python3 install.py --repos-json repos.json diff --git a/workflows/comfy/repos.json b/workflows/comfy/repos.json index 55d5003..8f4b298 100644 --- a/workflows/comfy/repos.json +++ b/workflows/comfy/repos.json @@ -1,132 +1,142 @@ [ - { - "folder": "ComfyUI/custom_nodes/was-node-suite-comfyui", - "commit": "6c3fed70655b737dc9b59da1cadb3c373c08d8ed", - "url": "https://github.com/WASasquatch/was-node-suite-comfyui.git" - }, - { - "folder": "ComfyUI/custom_nodes/ComfyUI_FizzNodes", - "commit": "0e05436071d18db18900a6e796c1358a4e9b10a3", - "url": "https://github.com/FizzleDorf/ComfyUI_FizzNodes.git" - }, - { - "folder": "ComfyUI/custom_nodes/ComfyUI-VideoHelperSuite", - "commit": "47e56f3e42c3ab4fb33f1407c2c40b5391226621", - "url": "https://github.com/Kosinkadink/ComfyUI-VideoHelperSuite.git" - }, - { - "folder": "ComfyUI/custom_nodes/ComfyUI-Custom-Scripts", - "commit": "3f2c021e50be2fed3c9d1552ee8dcaae06ad1fe5", - "url": "https://github.com/pythongosssss/ComfyUI-Custom-Scripts.git" - }, - { - "folder": "ComfyUI/custom_nodes/ComfyUI-Advanced-ControlNet", - "commit": "33d9884b76e8d7a2024691c5d98308e7e61bf38d", - "url": "https://github.com/Kosinkadink/ComfyUI-Advanced-ControlNet.git" - }, - { - "folder": "ComfyUI/custom_nodes/ComfyUI-Logic", - "commit": "fb8897351f715ea75eebf52e74515b6d07c693b8", - "url": "https://github.com/theUpsider/ComfyUI-Logic.git" - }, - { - "folder": "ComfyUI/custom_nodes/ComfyUI-AnimateDiff-Evolved", - "commit": "b693c681731202152cd8dd45714bb7bc34a4ca6b", - "url": "https://github.com/Kosinkadink/ComfyUI-AnimateDiff-Evolved.git" - }, - { - "folder": "ComfyUI/custom_nodes/ComfyUI-Impact-Pack", - "commit": "a7076b39685bcb3bf9d5c7180f5e538839c2ccb0", - "url": "https://github.com/ltdrdata/ComfyUI-Impact-Pack.git" - }, - { - "folder": "ComfyUI/custom_nodes/ComfyUI-Video-Matting", - "commit": "940fcc5a56d4b47a6c3507d827c56b083c388f3e", - "url": "https://github.com/Fannovel16/ComfyUI-Video-Matting.git" - }, - { - "folder": "ComfyUI/custom_nodes/comfyui_segment_anything", - "commit": "ab6395596399d5048639cdab7e44ec9fae857a93", - "url": "https://github.com/storyicon/comfyui_segment_anything.git" - }, - { - "folder": "ComfyUI/custom_nodes/ComfyUi_NNLatentUpscale", - "commit": "08105da31dbd7a54569661e135835e73bd8064b0", - "url": "https://github.com/Ttl/ComfyUi_NNLatentUpscale.git" - }, - { - "folder": "ComfyUI/custom_nodes/ComfyUI_IPAdapter_plus", - "commit": "20125bf9394b1bc98ef3228277a31a3a52c72fc2", - "url": "https://github.com/cubiq/ComfyUI_IPAdapter_plus.git" - }, - { - "folder": "ComfyUI/custom_nodes/comfy-image-saver", - "commit": "65e6903eff274a50f8b5cd768f0f96baf37baea1", - "url": "https://github.com/giriss/comfy-image-saver.git" - }, - { - "folder": "ComfyUI/custom_nodes/ComfyUI_essentials", - "commit": "84d25b99c2e3e82142c2de6656fcda55e5ce1318", - "url": "https://github.com/cubiq/ComfyUI_essentials.git" - }, - { - "folder": "ComfyUI/custom_nodes/efficiency-nodes-comfyui", - "commit": "3b7e89d969c02b80ff3662f34813679167b835fa", - "url": "https://github.com/jags111/efficiency-nodes-comfyui.git" - }, - { - "folder": "ComfyUI/custom_nodes/rgthree-comfy", - "commit": "017a1595cdfb75d34d91f4d8abceab89202d0c81", - "url": "https://github.com/rgthree/rgthree-comfy.git" - }, - { - "folder": "ComfyUI/custom_nodes/ComfyUI-Frame-Interpolation", - "commit": "1c4c4b4f9a99e7e6eb7c5a5f3fdc7c9dfd319357", - "url": "https://github.com/Fannovel16/ComfyUI-Frame-Interpolation.git" - }, - { - "folder": "ComfyUI/custom_nodes/comfyui_controlnet_aux", - "commit": "ac8702cc38feb6cf3fe4f8e11d2792a86cb56cc4", - "url": "https://github.com/Fannovel16/comfyui_controlnet_aux.git" - }, - { - "folder": "ComfyUI/custom_nodes/ComfyUI-Manager", - "commit": "1758f4b3dfed65db813a52cc87d72dcd5088d1fb", - "url": "https://github.com/ltdrdata/ComfyUI-Manager.git" - }, - { - "folder": "ComfyUI/custom_nodes/rembg-comfyui-node", - "commit": "fac7df6c3f42e158a2829b511b37f13e4cc834eb", - "url": "https://github.com/Jcd1230/rembg-comfyui-node.git" - }, - { - "folder": "ComfyUI/custom_nodes/ComfyUI_Comfyroll_CustomNodes", - "commit": "d78b780ae43fcf8c6b7c6505e6ffb4584281ceca", - "url": "https://github.com/Suzie1/ComfyUI_Comfyroll_CustomNodes.git" - }, - { - "folder": "ComfyUI/custom_nodes/ComfyUI-Crystools", - "commit": "bfbfd121a245d04ce7d06ccc36acdb9873c47d9d", - "url": "https://github.com/crystian/ComfyUI-Crystools.git" - }, - { - "folder": "ComfyUI/custom_nodes/ComfyUI-KJNodes", - "commit": "b2d5ab3fcdc81c807f4049255abb65d38b608992", - "url": "https://github.com/kijai/ComfyUI-KJNodes.git" - }, - { - "folder": "ComfyUI/custom_nodes/comfy_mtb", - "commit": "f9d2ebf91d09fc214fecf7501a5490b33c30aca2", - "url": "https://github.com/melMass/comfy_mtb.git" - }, - { - "folder": "ComfyUI/custom_nodes/comfyui-art-venture", - "commit": "c33412288fbdcd132265c9029a38001fd9696aa5", - "url": "https://github.com/sipherxyz/comfyui-art-venture.git" - }, - { - "folder": "ComfyUI/custom_nodes/ComfyMath", - "commit": "be9beab9923ccf5c5e4132dc1653bcdfa773ed70", - "url": "https://github.com/evanspearman/ComfyMath" - } + { + "folder": "ComfyUI/custom_nodes/ComfyUI-Logic", + "commit": "fb8897351f715ea75eebf52e74515b6d07c693b8", + "url": "https://github.com/theUpsider/ComfyUI-Logic.git" + }, + { + "folder": "ComfyUI/custom_nodes/comfyui-auto-nodes-layout", + "commit": "82bf0511c973e4c2a486a29a7ec9a3c8fe3d01a1", + "url": "https://github.com/phineas-pta/comfyui-auto-nodes-layout" + }, + { + "folder": "ComfyUI/custom_nodes/ComfyUI-Advanced-ControlNet", + "commit": "33d9884b76e8d7a2024691c5d98308e7e61bf38d", + "url": "https://github.com/Kosinkadink/ComfyUI-Advanced-ControlNet.git" + }, + { + "folder": "ComfyUI/custom_nodes/ComfyUI-Video-Matting", + "commit": "178bf956ddb817d065b1b073ec04582ad60335bb", + "url": "https://github.com/Fannovel16/ComfyUI-Video-Matting.git" + }, + { + "folder": "ComfyUI/custom_nodes/ComfyUI-KJNodes", + "commit": "2ead4fae1dddfe65d951248d98a1ff11dd50ab7a", + "url": "https://github.com/kijai/ComfyUI-KJNodes.git" + }, + { + "folder": "ComfyUI/custom_nodes/ComfyMath", + "commit": "be9beab9923ccf5c5e4132dc1653bcdfa773ed70", + "url": "https://github.com/evanspearman/ComfyMath" + }, + { + "folder": "ComfyUI/custom_nodes/comfyui-art-venture", + "commit": "16fb21d67bdd6883cf7be0e976aec812c568ed3e", + "url": "https://github.com/sipherxyz/comfyui-art-venture" + }, + { + "folder": "ComfyUI/custom_nodes/comfyui-various", + "commit": "ec58185387c75b74ee93d6f835ff480772dbc64d", + "url": "https://github.com/jamesWalker55/comfyui-various" + }, + { + "folder": "ComfyUI/custom_nodes/ComfyUI_Comfyroll_CustomNodes", + "commit": "d78b780ae43fcf8c6b7c6505e6ffb4584281ceca", + "url": "https://github.com/Suzie1/ComfyUI_Comfyroll_CustomNodes.git" + }, + { + "folder": "ComfyUI/custom_nodes/ComfyUI-Manager", + "commit": "6c553d1228978352767f4914c4dd7787b00f6769", + "url": "https://github.com/ltdrdata/ComfyUI-Manager.git" + }, + { + "folder": "ComfyUI/custom_nodes/ComfyUI-Impact-Pack", + "commit": "a26fe487ef5c46506bd75872c82a3cfb002f7ea1", + "url": "https://github.com/ltdrdata/ComfyUI-Impact-Pack.git" + }, + { + "folder": "ComfyUI/custom_nodes/was-node-suite-comfyui", + "commit": "587ad8cbcb287027152f635eed0bd8047a9cb956", + "url": "https://github.com/WASasquatch/was-node-suite-comfyui.git" + }, + { + "folder": "ComfyUI/custom_nodes/ComfyUI_FizzNodes", + "commit": "2ad19c1c3ad424b732fa0bc16ffb02284676a5da", + "url": "https://github.com/FizzleDorf/ComfyUI_FizzNodes.git" + }, + { + "folder": "ComfyUI/custom_nodes/ComfyUI_essentials", + "commit": "0283ce45272fc0737e3420c0aa2c5c30a74f7a36", + "url": "https://github.com/cubiq/ComfyUI_essentials.git" + }, + { + "folder": "ComfyUI/custom_nodes/ComfyUI-AnimateDiff-Evolved", + "commit": "7c75983c2c36a11a250c4aec34b49e229485b4ab", + "url": "https://github.com/Kosinkadink/ComfyUI-AnimateDiff-Evolved.git" + }, + { + "folder": "ComfyUI/custom_nodes/ComfyUI-Frame-Interpolation", + "commit": "5e11679995c68f33891c306a393915feefe234b5", + "url": "https://github.com/Fannovel16/ComfyUI-Frame-Interpolation.git" + }, + { + "folder": "ComfyUI/custom_nodes/comfy-image-saver", + "commit": "65e6903eff274a50f8b5cd768f0f96baf37baea1", + "url": "https://github.com/giriss/comfy-image-saver.git" + }, + { + "folder": "ComfyUI/custom_nodes/ComfyUI_IPAdapter_plus", + "commit": "d76bdbd2b59cb4164adb662359dc59b5aa213548", + "url": "https://github.com/cubiq/ComfyUI_IPAdapter_plus.git" + }, + { + "folder": "ComfyUI/custom_nodes/ComfyUI-VideoHelperSuite", + "commit": "f94597739f20dac331f9918a245149b6b00a60f2", + "url": "https://github.com/Kosinkadink/ComfyUI-VideoHelperSuite.git" + }, + { + "folder": "ComfyUI/custom_nodes/ComfyUI-Crystools", + "commit": "bfbfd121a245d04ce7d06ccc36acdb9873c47d9d", + "url": "https://github.com/crystian/ComfyUI-Crystools.git" + }, + { + "folder": "ComfyUI/custom_nodes/ComfyUI-Custom-Scripts", + "commit": "edc5321bfd3d8f77cace0a69b46e129d99b53c3d", + "url": "https://github.com/pythongosssss/ComfyUI-Custom-Scripts.git" + }, + { + "folder": "ComfyUI/custom_nodes/comfyui_segment_anything", + "commit": "681d977c2cc244de729fd9e08145ff365c609262", + "url": "https://github.com/storyicon/comfyui_segment_anything.git" + }, + { + "folder": "ComfyUI/custom_nodes/efficiency-nodes-comfyui", + "commit": "3b7e89d969c02b80ff3662f34813679167b835fa", + "url": "https://github.com/jags111/efficiency-nodes-comfyui.git" + }, + { + "folder": "ComfyUI/custom_nodes/comfy_mtb", + "commit": "1070edd0245fb235183d5f38cd1bebf6e0405f97", + "url": "https://github.com/melMass/comfy_mtb.git" + }, + { + "folder": "ComfyUI/custom_nodes/comfyui_controlnet_aux", + "commit": "6f1ba1c10df84af6d356119ccf4ebcf796a10e1c", + "url": "https://github.com/Fannovel16/comfyui_controlnet_aux.git" + }, + { + "folder": "ComfyUI/custom_nodes/rembg-comfyui-node", + "commit": "fac7df6c3f42e158a2829b511b37f13e4cc834eb", + "url": "https://github.com/Jcd1230/rembg-comfyui-node.git" + }, + { + "folder": "ComfyUI/custom_nodes/ComfyUi_NNLatentUpscale", + "commit": "08105da31dbd7a54569661e135835e73bd8064b0", + "url": "https://github.com/Ttl/ComfyUi_NNLatentUpscale.git" + }, + { + "folder": "ComfyUI/custom_nodes/rgthree-comfy", + "commit": "9021670e9ff887d40e031334fc9f3e92c599d161", + "url": "https://github.com/rgthree/rgthree-comfy.git" + } ]