Spaces:
Running
Running
Update app.py
Browse files
app.py
CHANGED
@@ -21,7 +21,7 @@ dtype = torch.float16 if device != 'cpu' else torch.float32
|
|
21 |
def magnify_image(image, scale_factor=2):
|
22 |
start_time = time.time()
|
23 |
try:
|
24 |
-
if image.size[0] >
|
25 |
message = 'Failed! Image too large, please resize to <1000x1000 or clone the repo and code to allow larger images on your local machine.'
|
26 |
else:
|
27 |
image = magnifier.magnify(image, scale_factor=scale_factor)
|
@@ -35,8 +35,8 @@ with gr.Blocks() as demo:
|
|
35 |
if not os.path.exists('imgs'):
|
36 |
os.mkdir('imgs')
|
37 |
|
38 |
-
gr.Markdown('# Free Image Scale Up Demo')
|
39 |
-
gr.Markdown('##
|
40 |
gr.Markdown('## Powered by Waifu2x')
|
41 |
gr.Markdown("## Author: [yangheng95](https://github.com/yangheng95) Github:[Github](https://github.com/yangheng95/SuperResolutionAnimeDiffusion)")
|
42 |
|
|
|
21 |
def magnify_image(image, scale_factor=2):
|
22 |
start_time = time.time()
|
23 |
try:
|
24 |
+
if image.size[0] > 500 or image.size[1] > 500:
|
25 |
message = 'Failed! Image too large, please resize to <1000x1000 or clone the repo and code to allow larger images on your local machine.'
|
26 |
else:
|
27 |
image = magnifier.magnify(image, scale_factor=scale_factor)
|
|
|
35 |
if not os.path.exists('imgs'):
|
36 |
os.mkdir('imgs')
|
37 |
|
38 |
+
gr.Markdown('# Free Anime Image Scale Up Demo')
|
39 |
+
gr.Markdown('## 免费动漫插图图片分辨率放大 (最大支持500x500)')
|
40 |
gr.Markdown('## Powered by Waifu2x')
|
41 |
gr.Markdown("## Author: [yangheng95](https://github.com/yangheng95) Github:[Github](https://github.com/yangheng95/SuperResolutionAnimeDiffusion)")
|
42 |
|