Proper fix for portable installs
This commit is contained in:
+5
-2
@@ -68,6 +68,7 @@ def get_batch(keys, value_dict, N, T, device):
|
|||||||
|
|
||||||
def load_model(
|
def load_model(
|
||||||
config: str,
|
config: str,
|
||||||
|
script_directory: str,
|
||||||
device: str,
|
device: str,
|
||||||
num_frames: int,
|
num_frames: int,
|
||||||
num_steps: int,
|
num_steps: int,
|
||||||
@@ -75,6 +76,7 @@ def load_model(
|
|||||||
):
|
):
|
||||||
|
|
||||||
config = OmegaConf.load(config)
|
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.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.num_steps = num_steps
|
||||||
config.model.params.sampler_config.params.guider_config.params.num_frames = (num_frames)
|
config.model.params.sampler_config.params.guider_config.params.num_frames = (num_frames)
|
||||||
@@ -127,12 +129,13 @@ class SVDimg2vid:
|
|||||||
torch.cuda.ipc_collect()
|
torch.cuda.ipc_collect()
|
||||||
|
|
||||||
device: str = "cuda"
|
device: str = "cuda"
|
||||||
|
|
||||||
script_directory = os.path.dirname(os.path.abspath(__file__))
|
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 = load_model(
|
||||||
model_config,
|
model_config,
|
||||||
|
script_directory,
|
||||||
device,
|
device,
|
||||||
num_frames,
|
num_frames,
|
||||||
num_steps,
|
num_steps,
|
||||||
|
|||||||
@@ -2,6 +2,7 @@ einops
|
|||||||
omegaconf
|
omegaconf
|
||||||
pytorch-lightning==2.0.1
|
pytorch-lightning==2.0.1
|
||||||
open-clip-torch>=2.20.0
|
open-clip-torch>=2.20.0
|
||||||
|
hatchling
|
||||||
sgm @ git+https://github.com/Stability-AI/generative-models
|
sgm @ git+https://github.com/Stability-AI/generative-models
|
||||||
xformers>=0.0.20
|
xformers>=0.0.20
|
||||||
kornia==0.6.9
|
kornia==0.6.9
|
||||||
@@ -3,7 +3,7 @@ model:
|
|||||||
params:
|
params:
|
||||||
scale_factor: 0.18215
|
scale_factor: 0.18215
|
||||||
disable_first_stage_autocast: True
|
disable_first_stage_autocast: True
|
||||||
ckpt_path: custom_nodes/ComfyUI-SVD/svd/checkpoints/svd.safetensors
|
ckpt_path: svd/checkpoints/svd.safetensors
|
||||||
|
|
||||||
denoiser_config:
|
denoiser_config:
|
||||||
target: sgm.modules.diffusionmodules.denoiser.Denoiser
|
target: sgm.modules.diffusionmodules.denoiser.Denoiser
|
||||||
|
|||||||
@@ -3,7 +3,7 @@ model:
|
|||||||
params:
|
params:
|
||||||
scale_factor: 0.18215
|
scale_factor: 0.18215
|
||||||
disable_first_stage_autocast: True
|
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:
|
denoiser_config:
|
||||||
target: sgm.modules.diffusionmodules.denoiser.Denoiser
|
target: sgm.modules.diffusionmodules.denoiser.Denoiser
|
||||||
|
|||||||
@@ -3,7 +3,7 @@ model:
|
|||||||
params:
|
params:
|
||||||
scale_factor: 0.18215
|
scale_factor: 0.18215
|
||||||
disable_first_stage_autocast: True
|
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:
|
denoiser_config:
|
||||||
target: sgm.modules.diffusionmodules.denoiser.Denoiser
|
target: sgm.modules.diffusionmodules.denoiser.Denoiser
|
||||||
|
|||||||
@@ -3,7 +3,7 @@ model:
|
|||||||
params:
|
params:
|
||||||
scale_factor: 0.18215
|
scale_factor: 0.18215
|
||||||
disable_first_stage_autocast: True
|
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:
|
denoiser_config:
|
||||||
target: sgm.modules.diffusionmodules.denoiser.Denoiser
|
target: sgm.modules.diffusionmodules.denoiser.Denoiser
|
||||||
|
|||||||
Reference in New Issue
Block a user