From b565f987cce2f2794351b8b1f63301befc99eebb Mon Sep 17 00:00:00 2001 From: Justin John Date: Tue, 14 Nov 2023 09:56:53 +0530 Subject: [PATCH 1/6] Added submodules --- .gitmodules | 9 --------- animation/Rerender_A_Video/deps/ControlNet | 1 - animation/Rerender_A_Video/deps/ebsynth | 1 - animation/Rerender_A_Video/deps/gmflow | 1 - animation/Rerender_A_Video/webUI.py | 21 ++++----------------- 5 files changed, 4 insertions(+), 29 deletions(-) delete mode 160000 animation/Rerender_A_Video/deps/ControlNet delete mode 160000 animation/Rerender_A_Video/deps/ebsynth delete mode 160000 animation/Rerender_A_Video/deps/gmflow diff --git a/.gitmodules b/.gitmodules index 2ecdc0f..e69de29 100644 --- a/.gitmodules +++ b/.gitmodules @@ -1,9 +0,0 @@ -[submodule "animation/Rerender_A_Video/deps/ControlNet"] - path = animation/Rerender_A_Video/deps/ControlNet - url = https://github.com/lllyasviel/ControlNet.git -[submodule "animation/Rerender_A_Video/deps/ebsynth"] - path = animation/Rerender_A_Video/deps/ebsynth - url = https://github.com/SingleZombie/ebsynth/ -[submodule "animation/Rerender_A_Video/deps/gmflow"] - path = animation/Rerender_A_Video/deps/gmflow - url = https://github.com/haofeixu/gmflow/ diff --git a/animation/Rerender_A_Video/deps/ControlNet b/animation/Rerender_A_Video/deps/ControlNet deleted file mode 160000 index d3284fc..0000000 --- a/animation/Rerender_A_Video/deps/ControlNet +++ /dev/null @@ -1 +0,0 @@ -Subproject commit d3284fcd0972c510635a4f5abe2eeb71dc0de524 diff --git a/animation/Rerender_A_Video/deps/ebsynth b/animation/Rerender_A_Video/deps/ebsynth deleted file mode 160000 index 02ec8c4..0000000 --- a/animation/Rerender_A_Video/deps/ebsynth +++ /dev/null @@ -1 +0,0 @@ -Subproject commit 02ec8c4e4d4a568057363ae8b8f8bb8f7e4898c2 diff --git a/animation/Rerender_A_Video/deps/gmflow b/animation/Rerender_A_Video/deps/gmflow deleted file mode 160000 index af2d869..0000000 --- a/animation/Rerender_A_Video/deps/gmflow +++ /dev/null @@ -1 +0,0 @@ -Subproject commit af2d869a6fa38b0b076d6f28ab5af1f64beca335 diff --git a/animation/Rerender_A_Video/webUI.py b/animation/Rerender_A_Video/webUI.py index 88a09e7..3a69102 100644 --- a/animation/Rerender_A_Video/webUI.py +++ b/animation/Rerender_A_Video/webUI.py @@ -24,7 +24,7 @@ from deps.ControlNet.annotator.util import HWC3 from deps.ControlNet.cldm.model import create_model, load_state_dict from deps.gmflow.gmflow.gmflow import GMFlow from flow.flow_utils import get_warped_and_mask -from sd_model_cfg import model_dict,loRA_dict +from sd_model_cfg import model_dict from src.config import RerenderConfig from src.controller import AttentionControl from src.ddim_v_hacked import DDIMVSampler @@ -172,7 +172,7 @@ video_frame_count = None def create_cfg(input_path, prompt, image_resolution, control_strength, color_preserve, left_crop, right_crop, top_crop, bottom_crop, control_type, low_threshold, high_threshold, ddim_steps, scale, - seed, sd_model,loRA_weights, a_prompt, n_prompt, interval, keyframe_count, + seed, sd_model, a_prompt, n_prompt, interval, keyframe_count, x0_strength, use_constraints, cross_start, cross_end, style_update_freq, warp_start, warp_end, mask_start, mask_end, ada_start, ada_end, mask_strength, inner_strength, @@ -206,7 +206,6 @@ def create_cfg(input_path, prompt, image_resolution, control_strength, interval=interval, crop=[left_crop, right_crop, top_crop, bottom_crop], sd_model=sd_model, - loRA_weights=loRA_weights, ddim_steps=ddim_steps, scale=scale, control_type=control_type, @@ -240,13 +239,11 @@ def cfg_to_input(filename): ] sd_model = inversed_model_dict.get(cfg.sd_model, 'Stable Diffusion 1.5') - loRA_weights = inversed_model_dict.get(cfg.loRA_weights,"None") - args = [ cfg.input_path, cfg.prompt, cfg.image_resolution, cfg.control_strength, cfg.color_preserve, *cfg.crop, cfg.control_type, cfg.canny_low, - cfg.canny_high, cfg.ddim_steps, cfg.scale, cfg.seed, sd_model,loRA_weights, + cfg.canny_high, cfg.ddim_steps, cfg.scale, cfg.seed, sd_model, cfg.a_prompt, cfg.n_prompt, cfg.interval, keyframe_count, cfg.x0_strength, use_constraints, *cfg.cross_period, cfg.style_update_freq, *cfg.warp_period, *cfg.mask_period, @@ -296,9 +293,6 @@ def process1(*args): global global_state global_state.update_sd_model(cfg.sd_model, cfg.control_type, cfg.freeu_args) - # TODO: support Koha loRA - # global_state.update_loRA_weights() - global_state.update_controller(cfg.inner_strength, cfg.mask_period, cfg.cross_period, cfg.ada_period, cfg.warp_period, cfg.loose_cfattn) @@ -760,13 +754,6 @@ with block: sd_model = gr.Dropdown(sd_model_list, label='Base model', value='Stable Diffusion 1.5') - - loRA_weights_list = list(loRA_dict.keys()) - loRA_weights = gr.Dropdown(loRA_weights_list, - label="loRA", - value="None") - - a_prompt = gr.Textbox(label='Added prompt', value='best quality, extremely detailed') n_prompt = gr.Textbox( @@ -928,7 +915,7 @@ with block: prompt, image_resolution, control_strength, color_preserve, left_crop, right_crop, top_crop, bottom_crop, control_type, low_threshold, high_threshold, ddim_steps, scale, seed, - sd_model,loRA_weights, a_prompt, n_prompt, interval, keyframe_count, + sd_model, a_prompt, n_prompt, interval, keyframe_count, x0_strength, use_constraints[0], cross_start, cross_end, style_update_freq, warp_start, warp_end, mask_start, mask_end, ada_start, ada_end, mask_strength, From 67f5c66db4aa662faab7ce9657b35dbb566f8ea5 Mon Sep 17 00:00:00 2001 From: Justin John Date: Tue, 14 Nov 2023 10:02:35 +0530 Subject: [PATCH 2/6] Added submodules --- animation/Rerender_A_Video/.gitmodules | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/animation/Rerender_A_Video/.gitmodules b/animation/Rerender_A_Video/.gitmodules index 8b13789..1074534 100644 --- a/animation/Rerender_A_Video/.gitmodules +++ b/animation/Rerender_A_Video/.gitmodules @@ -1 +1,9 @@ - +[submodule "animation/Rerender_A_Video/deps/ControlNet"] + path = animation/Rerender_A_Video/deps/ControlNet + url = https://github.com/lllyasviel/ControlNet.git +[submodule "animation/Rerender_A_Video/deps/ebsynth"] + path = animation/Rerender_A_Video/deps/ebsynth + url = https://github.com/SingleZombie/ebsynth/ +[submodule "animation/Rerender_A_Video/deps/gmflow"] + path = animation/Rerender_A_Video/deps/gmflow + url = https://github.com/haofeixu/gmflow/ \ No newline at end of file From 4756fd64f3b6e5e9c158210d60ae4b5faeb28d86 Mon Sep 17 00:00:00 2001 From: Justin John Date: Tue, 14 Nov 2023 10:06:24 +0530 Subject: [PATCH 3/6] update webUI.py --- animation/Rerender_A_Video/webUI.py | 23 ++++++++++++++++++----- 1 file changed, 18 insertions(+), 5 deletions(-) diff --git a/animation/Rerender_A_Video/webUI.py b/animation/Rerender_A_Video/webUI.py index 3a69102..3ec1ce0 100644 --- a/animation/Rerender_A_Video/webUI.py +++ b/animation/Rerender_A_Video/webUI.py @@ -24,7 +24,7 @@ from deps.ControlNet.annotator.util import HWC3 from deps.ControlNet.cldm.model import create_model, load_state_dict from deps.gmflow.gmflow.gmflow import GMFlow from flow.flow_utils import get_warped_and_mask -from sd_model_cfg import model_dict +from sd_model_cfg import model_dict,loRA_dict from src.config import RerenderConfig from src.controller import AttentionControl from src.ddim_v_hacked import DDIMVSampler @@ -172,7 +172,7 @@ video_frame_count = None def create_cfg(input_path, prompt, image_resolution, control_strength, color_preserve, left_crop, right_crop, top_crop, bottom_crop, control_type, low_threshold, high_threshold, ddim_steps, scale, - seed, sd_model, a_prompt, n_prompt, interval, keyframe_count, + seed, sd_model,loRA_weights, a_prompt, n_prompt, interval, keyframe_count, x0_strength, use_constraints, cross_start, cross_end, style_update_freq, warp_start, warp_end, mask_start, mask_end, ada_start, ada_end, mask_strength, inner_strength, @@ -206,6 +206,7 @@ def create_cfg(input_path, prompt, image_resolution, control_strength, interval=interval, crop=[left_crop, right_crop, top_crop, bottom_crop], sd_model=sd_model, + loRA_weights=loRA_weights, ddim_steps=ddim_steps, scale=scale, control_type=control_type, @@ -239,11 +240,13 @@ def cfg_to_input(filename): ] sd_model = inversed_model_dict.get(cfg.sd_model, 'Stable Diffusion 1.5') + loRA_weights = inversed_model_dict.get(cfg.loRA_weights,"None") + args = [ cfg.input_path, cfg.prompt, cfg.image_resolution, cfg.control_strength, cfg.color_preserve, *cfg.crop, cfg.control_type, cfg.canny_low, - cfg.canny_high, cfg.ddim_steps, cfg.scale, cfg.seed, sd_model, + cfg.canny_high, cfg.ddim_steps, cfg.scale, cfg.seed, sd_model,loRA_weights, cfg.a_prompt, cfg.n_prompt, cfg.interval, keyframe_count, cfg.x0_strength, use_constraints, *cfg.cross_period, cfg.style_update_freq, *cfg.warp_period, *cfg.mask_period, @@ -293,6 +296,9 @@ def process1(*args): global global_state global_state.update_sd_model(cfg.sd_model, cfg.control_type, cfg.freeu_args) + # TODO: support Koha loRA + # global_state.update_loRA_weights() + global_state.update_controller(cfg.inner_strength, cfg.mask_period, cfg.cross_period, cfg.ada_period, cfg.warp_period, cfg.loose_cfattn) @@ -754,6 +760,13 @@ with block: sd_model = gr.Dropdown(sd_model_list, label='Base model', value='Stable Diffusion 1.5') + + loRA_weights_list = list(loRA_dict.keys()) + loRA_weights = gr.Dropdown(loRA_weights_list, + label="loRA", + value="None") + + a_prompt = gr.Textbox(label='Added prompt', value='best quality, extremely detailed') n_prompt = gr.Textbox( @@ -915,7 +928,7 @@ with block: prompt, image_resolution, control_strength, color_preserve, left_crop, right_crop, top_crop, bottom_crop, control_type, low_threshold, high_threshold, ddim_steps, scale, seed, - sd_model, a_prompt, n_prompt, interval, keyframe_count, + sd_model,loRA_weights, a_prompt, n_prompt, interval, keyframe_count, x0_strength, use_constraints[0], cross_start, cross_end, style_update_freq, warp_start, warp_end, mask_start, mask_end, ada_start, ada_end, mask_strength, @@ -994,4 +1007,4 @@ with block: run_button2.click(fn=process2, inputs=ips, outputs=[result_keyframe]) run_button3.click(fn=process3, inputs=ips_process3, outputs=[result_video]) -block.launch(server_name='localhost') +block.launch(server_name='localhost') \ No newline at end of file From c868e8c766ac8de9b40192f9b14ef3c1cd5251b2 Mon Sep 17 00:00:00 2001 From: Justin John Date: Tue, 14 Nov 2023 10:14:41 +0530 Subject: [PATCH 4/6] Added ControlNet submodule at specific commit --- .gitmodules | 3 +++ animation/Rerender_A_Video/.gitmodules | 9 --------- animation/Rerender_A_Video/deps/ControlNet | 1 + 3 files changed, 4 insertions(+), 9 deletions(-) create mode 160000 animation/Rerender_A_Video/deps/ControlNet diff --git a/.gitmodules b/.gitmodules index e69de29..bc8298c 100644 --- a/.gitmodules +++ b/.gitmodules @@ -0,0 +1,3 @@ +[submodule "animation/Rerender_A_Video/deps/ControlNet"] + path = animation/Rerender_A_Video/deps/ControlNet + url = https://github.com/lllyasviel/ControlNet diff --git a/animation/Rerender_A_Video/.gitmodules b/animation/Rerender_A_Video/.gitmodules index 1074534..e69de29 100644 --- a/animation/Rerender_A_Video/.gitmodules +++ b/animation/Rerender_A_Video/.gitmodules @@ -1,9 +0,0 @@ -[submodule "animation/Rerender_A_Video/deps/ControlNet"] - path = animation/Rerender_A_Video/deps/ControlNet - url = https://github.com/lllyasviel/ControlNet.git -[submodule "animation/Rerender_A_Video/deps/ebsynth"] - path = animation/Rerender_A_Video/deps/ebsynth - url = https://github.com/SingleZombie/ebsynth/ -[submodule "animation/Rerender_A_Video/deps/gmflow"] - path = animation/Rerender_A_Video/deps/gmflow - url = https://github.com/haofeixu/gmflow/ \ No newline at end of file diff --git a/animation/Rerender_A_Video/deps/ControlNet b/animation/Rerender_A_Video/deps/ControlNet new file mode 160000 index 0000000..d3284fc --- /dev/null +++ b/animation/Rerender_A_Video/deps/ControlNet @@ -0,0 +1 @@ +Subproject commit d3284fcd0972c510635a4f5abe2eeb71dc0de524 From fec9b325495ebf60e519025b556f28fb71d5f8b0 Mon Sep 17 00:00:00 2001 From: Justin John Date: Tue, 14 Nov 2023 10:22:00 +0530 Subject: [PATCH 5/6] Added ebsynth submodule at specific commit --- .gitmodules | 3 +++ animation/Rerender_A_Video/deps/ebsynth | 1 + 2 files changed, 4 insertions(+) create mode 160000 animation/Rerender_A_Video/deps/ebsynth diff --git a/.gitmodules b/.gitmodules index bc8298c..7bca3b7 100644 --- a/.gitmodules +++ b/.gitmodules @@ -1,3 +1,6 @@ [submodule "animation/Rerender_A_Video/deps/ControlNet"] path = animation/Rerender_A_Video/deps/ControlNet url = https://github.com/lllyasviel/ControlNet +[submodule "animation/Rerender_A_Video/deps/ebsynth"] + path = animation/Rerender_A_Video/deps/ebsynth + url = https://github.com/SingleZombie/ebsynth diff --git a/animation/Rerender_A_Video/deps/ebsynth b/animation/Rerender_A_Video/deps/ebsynth new file mode 160000 index 0000000..02ec8c4 --- /dev/null +++ b/animation/Rerender_A_Video/deps/ebsynth @@ -0,0 +1 @@ +Subproject commit 02ec8c4e4d4a568057363ae8b8f8bb8f7e4898c2 From 2fdbb65620677498870ccdedbb8ddcfc024d05a3 Mon Sep 17 00:00:00 2001 From: Justin John Date: Tue, 14 Nov 2023 10:25:41 +0530 Subject: [PATCH 6/6] Added gmflow submodule at specific commit --- .gitmodules | 3 +++ animation/Rerender_A_Video/deps/gmflow | 1 + 2 files changed, 4 insertions(+) create mode 160000 animation/Rerender_A_Video/deps/gmflow diff --git a/.gitmodules b/.gitmodules index 7bca3b7..d75d754 100644 --- a/.gitmodules +++ b/.gitmodules @@ -4,3 +4,6 @@ [submodule "animation/Rerender_A_Video/deps/ebsynth"] path = animation/Rerender_A_Video/deps/ebsynth url = https://github.com/SingleZombie/ebsynth +[submodule "animation/Rerender_A_Video/deps/gmflow"] + path = animation/Rerender_A_Video/deps/gmflow + url = https://github.com/SingleZombie/ebsynth diff --git a/animation/Rerender_A_Video/deps/gmflow b/animation/Rerender_A_Video/deps/gmflow new file mode 160000 index 0000000..af2d869 --- /dev/null +++ b/animation/Rerender_A_Video/deps/gmflow @@ -0,0 +1 @@ +Subproject commit af2d869a6fa38b0b076d6f28ab5af1f64beca335