Upload app.py
Browse files
app.py
CHANGED
|
@@ -28,7 +28,7 @@ from PIL import Image
|
|
| 28 |
from SUPIR.util import HWC3, upscale_image, fix_resize, convert_dtype, create_SUPIR_model, load_QF_ckpt
|
| 29 |
from SUPIR.utils.colorfix import wavelet_reconstruction, adaptive_instance_normalization
|
| 30 |
from huggingface_hub import hf_hub_download
|
| 31 |
-
import
|
| 32 |
|
| 33 |
try:
|
| 34 |
from pillow_heif import register_heif_opener
|
|
@@ -64,16 +64,12 @@ def _safe_get_api_info(self, *args, **kwargs):
|
|
| 64 |
return {}
|
| 65 |
gr.Blocks.get_api_info = _safe_get_api_info
|
| 66 |
|
| 67 |
-
|
| 68 |
-
def
|
| 69 |
-
|
| 70 |
-
return
|
| 71 |
-
|
| 72 |
-
|
| 73 |
-
raise
|
| 74 |
-
print("Gradio route api_info hit schema bug; returning empty payload.")
|
| 75 |
-
return {}
|
| 76 |
-
gr_routes.api_info = _safe_api_info_route
|
| 77 |
|
| 78 |
|
| 79 |
def download_required_assets():
|
|
|
|
| 28 |
from SUPIR.util import HWC3, upscale_image, fix_resize, convert_dtype, create_SUPIR_model, load_QF_ckpt
|
| 29 |
from SUPIR.utils.colorfix import wavelet_reconstruction, adaptive_instance_normalization
|
| 30 |
from huggingface_hub import hf_hub_download
|
| 31 |
+
import gradio_client.utils as gr_client_utils
|
| 32 |
|
| 33 |
try:
|
| 34 |
from pillow_heif import register_heif_opener
|
|
|
|
| 64 |
return {}
|
| 65 |
gr.Blocks.get_api_info = _safe_get_api_info
|
| 66 |
|
| 67 |
+
_orig_grc_get_type = gr_client_utils.get_type
|
| 68 |
+
def _safe_grc_get_type(schema):
|
| 69 |
+
if isinstance(schema, bool):
|
| 70 |
+
return "Any"
|
| 71 |
+
return _orig_grc_get_type(schema)
|
| 72 |
+
gr_client_utils.get_type = _safe_grc_get_type
|
|
|
|
|
|
|
|
|
|
|
|
|
| 73 |
|
| 74 |
|
| 75 |
def download_required_assets():
|