Removed stray references to shared.device_codeformer.

This commit is contained in:
Elias Oenal 2022-09-14 14:06:01 +02:00 committed by AUTOMATIC1111
parent 26f733a026
commit 3daf9cac46

View File

@ -47,13 +47,11 @@ def setup_codeformer():
def __init__(self): def __init__(self):
self.net = None self.net = None
self.face_helper = None self.face_helper = None
if shared.device.type == 'mps': # CodeFormer currently does not support mps backend
shared.device_codeformer = torch.device('cpu')
def create_models(self): def create_models(self):
if self.net is not None and self.face_helper is not None: if self.net is not None and self.face_helper is not None:
self.net.to(shared.device_codeformer) self.net.to(devices.device_codeformer)
return self.net, self.face_helper return self.net, self.face_helper
net = net_class(dim_embd=512, codebook_size=1024, n_head=8, n_layers=9, connect_list=['32', '64', '128', '256']).to(devices.device_codeformer) net = net_class(dim_embd=512, codebook_size=1024, n_head=8, n_layers=9, connect_list=['32', '64', '128', '256']).to(devices.device_codeformer)
@ -66,7 +64,7 @@ def setup_codeformer():
self.net = net self.net = net
self.face_helper = face_helper self.face_helper = face_helper
self.net.to(shared.device_codeformer) self.net.to(devices.device_codeformer)
return net, face_helper return net, face_helper