Spaces:
Paused
Paused
Update diffusion_webui/upscaler_models/codeformer_upscaler.py
Browse files
diffusion_webui/upscaler_models/codeformer_upscaler.py
CHANGED
|
@@ -3,9 +3,6 @@ from codeformer.app import inference_app
|
|
| 3 |
|
| 4 |
|
| 5 |
class CodeformerUpscalerGenerator:
|
| 6 |
-
def __init__(self):
|
| 7 |
-
self.pipe = None
|
| 8 |
-
|
| 9 |
def generate_image(
|
| 10 |
self,
|
| 11 |
image_path: str,
|
|
@@ -14,8 +11,8 @@ class CodeformerUpscalerGenerator:
|
|
| 14 |
upscale: int,
|
| 15 |
codeformer_fidelity: int,
|
| 16 |
):
|
| 17 |
-
|
| 18 |
-
|
| 19 |
image=image_path,
|
| 20 |
background_enhance=background_enhance,
|
| 21 |
face_upsample=face_upsample,
|
|
@@ -23,7 +20,7 @@ class CodeformerUpscalerGenerator:
|
|
| 23 |
codeformer_fidelity=codeformer_fidelity,
|
| 24 |
)
|
| 25 |
|
| 26 |
-
return [
|
| 27 |
|
| 28 |
def app():
|
| 29 |
with gr.Blocks():
|
|
|
|
| 3 |
|
| 4 |
|
| 5 |
class CodeformerUpscalerGenerator:
|
|
|
|
|
|
|
|
|
|
| 6 |
def generate_image(
|
| 7 |
self,
|
| 8 |
image_path: str,
|
|
|
|
| 11 |
upscale: int,
|
| 12 |
codeformer_fidelity: int,
|
| 13 |
):
|
| 14 |
+
|
| 15 |
+
pipe = inference_app(
|
| 16 |
image=image_path,
|
| 17 |
background_enhance=background_enhance,
|
| 18 |
face_upsample=face_upsample,
|
|
|
|
| 20 |
codeformer_fidelity=codeformer_fidelity,
|
| 21 |
)
|
| 22 |
|
| 23 |
+
return [pipe]
|
| 24 |
|
| 25 |
def app():
|
| 26 |
with gr.Blocks():
|