Spaces:
Paused
Paused
lllyasviel
commited on
Commit
·
b4852a5
1
Parent(s):
1a904ba
entry.py
CHANGED
@@ -1,5 +1,6 @@
|
|
1 |
import os
|
2 |
import torch
|
|
|
3 |
|
4 |
from omegaconf import OmegaConf
|
5 |
from sgm.util import instantiate_from_config
|
@@ -7,5 +8,9 @@ from sgm.util import instantiate_from_config
|
|
7 |
config_path = './sd_xl_base.yaml'
|
8 |
config = OmegaConf.load(config_path)
|
9 |
model = instantiate_from_config(config.model).cpu()
|
|
|
|
|
|
|
|
|
10 |
|
11 |
a = 0
|
|
|
1 |
import os
|
2 |
import torch
|
3 |
+
import safetensors.torch
|
4 |
|
5 |
from omegaconf import OmegaConf
|
6 |
from sgm.util import instantiate_from_config
|
|
|
8 |
config_path = './sd_xl_base.yaml'
|
9 |
config = OmegaConf.load(config_path)
|
10 |
model = instantiate_from_config(config.model).cpu()
|
11 |
+
model.eval()
|
12 |
+
|
13 |
+
sd = safetensors.torch.load_file('./sd_xl_base_1.0.safetensors')
|
14 |
+
model.load_state_dict(sd, strict=False)
|
15 |
|
16 |
a = 0
|