root
commited on
Commit
·
63624e2
1
Parent(s):
22af2ed
from_pt
Browse files- handler.py +4 -5
handler.py
CHANGED
|
@@ -49,11 +49,10 @@ class EndpointHandler():
|
|
| 49 |
|
| 50 |
pretrained_base_model_path_unet = os.path.join(base_dir, 'pretrained_weights', 'stable-diffusion-v1-5', 'unet')
|
| 51 |
|
| 52 |
-
|
| 53 |
-
|
| 54 |
-
|
| 55 |
-
|
| 56 |
-
).to(dtype=self.weight_dtype, device="cuda")
|
| 57 |
|
| 58 |
inference_config_path = os.path.join(base_dir, 'configs', 'inference', 'inference_v2.yaml')
|
| 59 |
motion_module_path = os.path.join(base_dir, 'pretrained_weights', 'motion_module.pth')
|
|
|
|
| 49 |
|
| 50 |
pretrained_base_model_path_unet = os.path.join(base_dir, 'pretrained_weights', 'stable-diffusion-v1-5', 'unet')
|
| 51 |
|
| 52 |
+
reference_unet = UNet2DConditionModel.from_pretrained(
|
| 53 |
+
pretrained_base_model_path_unet,
|
| 54 |
+
from_pt=True
|
| 55 |
+
).to(device, dtype=self.weight_dtype)
|
|
|
|
| 56 |
|
| 57 |
inference_config_path = os.path.join(base_dir, 'configs', 'inference', 'inference_v2.yaml')
|
| 58 |
motion_module_path = os.path.join(base_dir, 'pretrained_weights', 'motion_module.pth')
|