diff --git a/comfyui_svd.py b/comfyui_svd.py index a1ba649..fbf6735 100644 --- a/comfyui_svd.py +++ b/comfyui_svd.py @@ -68,6 +68,7 @@ def get_batch(keys, value_dict, N, T, device): def load_model( config: str, + script_directory: str, device: str, num_frames: int, num_steps: int, @@ -75,6 +76,7 @@ def load_model( ): config = OmegaConf.load(config) + config.model.params.ckpt_path = os.path.join(script_directory, config.model.params.ckpt_path) config.model.params.conditioner_config.params.emb_models[0].params.open_clip_embedding_config.params.init_device = device config.model.params.sampler_config.params.num_steps = num_steps config.model.params.sampler_config.params.guider_config.params.num_frames = (num_frames) @@ -127,12 +129,13 @@ class SVDimg2vid: torch.cuda.ipc_collect() device: str = "cuda" - + script_directory = os.path.dirname(os.path.abspath(__file__)) - model_config = f"{script_directory}/svd/configs/{version}.yaml" + model_config = os.path.join(script_directory, "svd", "configs", f"{version}.yaml") model = load_model( model_config, + script_directory, device, num_frames, num_steps, diff --git a/requirements.txt b/requirements.txt index a2ac99a..eaa8e7f 100644 --- a/requirements.txt +++ b/requirements.txt @@ -2,6 +2,7 @@ einops omegaconf pytorch-lightning==2.0.1 open-clip-torch>=2.20.0 +hatchling sgm @ git+https://github.com/Stability-AI/generative-models xformers>=0.0.20 kornia==0.6.9 \ No newline at end of file diff --git a/svd/configs/svd.yaml b/svd/configs/svd.yaml index 6aa8da6..3c45cdd 100644 --- a/svd/configs/svd.yaml +++ b/svd/configs/svd.yaml @@ -3,7 +3,7 @@ model: params: scale_factor: 0.18215 disable_first_stage_autocast: True - ckpt_path: custom_nodes/ComfyUI-SVD/svd/checkpoints/svd.safetensors + ckpt_path: svd/checkpoints/svd.safetensors denoiser_config: target: sgm.modules.diffusionmodules.denoiser.Denoiser diff --git a/svd/configs/svd_image_decoder.yaml b/svd/configs/svd_image_decoder.yaml index 48b4f15..f83c644 100644 --- a/svd/configs/svd_image_decoder.yaml +++ b/svd/configs/svd_image_decoder.yaml @@ -3,7 +3,7 @@ model: params: scale_factor: 0.18215 disable_first_stage_autocast: True - ckpt_path: custom_nodes/ComfyUI-SVD/svd/checkpoints/svd_image_decoder.safetensors + ckpt_path: svd/checkpoints/svd_image_decoder.safetensors denoiser_config: target: sgm.modules.diffusionmodules.denoiser.Denoiser diff --git a/svd/configs/svd_xt.yaml b/svd/configs/svd_xt.yaml index c42231b..fe992e0 100644 --- a/svd/configs/svd_xt.yaml +++ b/svd/configs/svd_xt.yaml @@ -3,7 +3,7 @@ model: params: scale_factor: 0.18215 disable_first_stage_autocast: True - ckpt_path: custom_nodes/ComfyUI-SVD/svd/checkpoints/svd_xt.safetensors + ckpt_path: svd/checkpoints/svd_xt.safetensors denoiser_config: target: sgm.modules.diffusionmodules.denoiser.Denoiser diff --git a/svd/configs/svd_xt_image_decoder.yaml b/svd/configs/svd_xt_image_decoder.yaml index b4c9728..0d57e52 100644 --- a/svd/configs/svd_xt_image_decoder.yaml +++ b/svd/configs/svd_xt_image_decoder.yaml @@ -3,7 +3,7 @@ model: params: scale_factor: 0.18215 disable_first_stage_autocast: True - ckpt_path: custom_nodes/ComfyUI-SVD/svd/checkpoints/svd_xt_image_decoder.safetensors + ckpt_path: svd/checkpoints/svd_xt_image_decoder.safetensors denoiser_config: target: sgm.modules.diffusionmodules.denoiser.Denoiser