mirror of
https://github.com/vladmandic/automatic
synced 2026-09-19 09:14:35 +02:00
add compatibility reexport for codeformers
This commit is contained in:
@@ -1,9 +1,6 @@
|
||||
import os
|
||||
import sys
|
||||
|
||||
import cv2
|
||||
import torch
|
||||
|
||||
import modules.face_restoration
|
||||
from modules import shared, devices, modelloader, errors
|
||||
from modules.paths import models_path
|
||||
@@ -88,7 +85,7 @@ def setup_model(dirname):
|
||||
cropped_face_t = cropped_face_t.unsqueeze(0).to(devices.device_codeformer)
|
||||
try:
|
||||
with devices.inference_context():
|
||||
output = self.net(cropped_face_t, w=w if w is not None else shared.opts.code_former_weight, adain=True)[0]
|
||||
output = self.net(cropped_face_t, w=w if w is not None else shared.opts.code_former_weight, adain=True)[0] # pylint: disable=not-callable
|
||||
restored_face = tensor2img(output, rgb2bgr=True, min_max=(-1, 1))
|
||||
del output
|
||||
devices.torch_gc()
|
||||
|
||||
Reference in New Issue
Block a user