bluestarburst
commited on
Commit
•
0f38a31
1
Parent(s):
d1f4ed8
Upload folder using huggingface_hub
Browse files- handler.py +5 -2
handler.py
CHANGED
@@ -20,9 +20,12 @@ from animatediff.utils.util import load_weights
|
|
20 |
class EndpointHandler():
|
21 |
def __init__(self, model_path: str = "bluestarburst/AnimateDiff-SceneFusion"):
|
22 |
|
23 |
-
|
|
|
24 |
|
25 |
-
inference_config =
|
|
|
|
|
26 |
|
27 |
### >>> create validation pipeline >>> ###
|
28 |
tokenizer = CLIPTokenizer.from_pretrained(model_path, subfolder="models/StableDiffusion/tokenizer")
|
|
|
20 |
class EndpointHandler():
|
21 |
def __init__(self, model_path: str = "bluestarburst/AnimateDiff-SceneFusion"):
|
22 |
|
23 |
+
inference_config_path = "configs/inference-v3.yaml"
|
24 |
+
hf_hub_download(repo_id="bluestarburst/AnimateDiff-SceneFusion", filename="configs/inference/inference-v3.yaml", output_dir="configs")
|
25 |
|
26 |
+
inference_config = OmegaConf.load(inference_config_path)
|
27 |
+
|
28 |
+
# inference_config = {'unet_additional_kwargs': {'unet_use_cross_frame_attention': False, 'unet_use_temporal_attention': False, 'use_motion_module': True, 'motion_module_resolutions': [1, 2, 4, 8], 'motion_module_mid_block': False, 'motion_module_decoder_only': False, 'motion_module_type': 'Vanilla', 'motion_module_kwargs': {'num_attention_heads': 8, 'num_transformer_block': 1, 'attention_block_types': ['Temporal_Self', 'Temporal_Self'], 'temporal_position_encoding': True, 'temporal_position_encoding_max_len': 24, 'temporal_attention_dim_div': 1}}, 'noise_scheduler_kwargs': {'DDIMScheduler': {'num_train_timesteps': 1000, 'beta_start': 0.00085, 'beta_end': 0.012, 'beta_schedule': 'linear', 'steps_offset': 1, 'clip_sample': False}, 'EulerAncestralDiscreteScheduler': {'num_train_timesteps': 1000, 'beta_start': 0.00085, 'beta_end': 0.012, 'beta_schedule': 'linear'}, 'KDPM2AncestralDiscreteScheduler': {'num_train_timesteps': 1000, 'beta_start': 0.00085, 'beta_end': 0.012, 'beta_schedule': 'linear'}}}
|
29 |
|
30 |
### >>> create validation pipeline >>> ###
|
31 |
tokenizer = CLIPTokenizer.from_pretrained(model_path, subfolder="models/StableDiffusion/tokenizer")
|