File tree Expand file tree Collapse file tree 2 files changed +34
-0
lines changed
sdkit/models/model_loader Expand file tree Collapse file tree 2 files changed +34
-0
lines changed Original file line number Diff line number Diff line change 11import torch
2+
3+ # hack for basicsr https://github.com/XPixelGroup/BasicSR/pull/650
4+ # credit: https://github.com/AUTOMATIC1111/stable-diffusion-webui/pull/14186/files
5+
6+ import sys
7+
8+ try :
9+ import torchvision .transforms .functional_tensor
10+ except ImportError :
11+ try :
12+ import torchvision .transforms .functional as functional
13+
14+ sys .modules ["torchvision.transforms.functional_tensor" ] = functional
15+ except ImportError :
16+ pass
17+ # /hack
18+
219from gfpgan import GFPGANer
320
421from sdkit import Context
Original file line number Diff line number Diff line change 11import os
22
33import torch
4+
5+ # hack for basicsr https://github.com/XPixelGroup/BasicSR/pull/650
6+ # credit: https://github.com/AUTOMATIC1111/stable-diffusion-webui/pull/14186/files
7+
8+ import sys
9+
10+ try :
11+ import torchvision .transforms .functional_tensor
12+ except ImportError :
13+ try :
14+ import torchvision .transforms .functional as functional
15+
16+ sys .modules ["torchvision.transforms.functional_tensor" ] = functional
17+ except ImportError :
18+ pass
19+ # /hack
20+
421from basicsr .archs .rrdbnet_arch import RRDBNet
522from realesrgan import RealESRGANer
623
You can’t perform that action at this time.
0 commit comments