Spaces:
Running
on
A10G
Running
on
A10G
Update app.py
Browse files
app.py
CHANGED
@@ -62,6 +62,10 @@ def inference(img, version, scale):
|
|
62 |
img_mode = None
|
63 |
|
64 |
h, w = img.shape[0:2]
|
|
|
|
|
|
|
|
|
65 |
if h < 300:
|
66 |
img = cv2.resize(img, (w * 2, h * 2), interpolation=cv2.INTER_LANCZOS4)
|
67 |
|
@@ -143,5 +147,5 @@ demo = gr.Interface(
|
|
143 |
# ['10045.png', 'v1.4', 2, 50]]).launch()
|
144 |
examples=[['AI-generate.jpg', 'v1.4', 2], ['lincoln.jpg', 'v1.4', 2], ['Blake_Lively.jpg', 'v1.4', 2],
|
145 |
['10045.png', 'v1.4', 2]])
|
146 |
-
demo.queue(concurrency_count=
|
147 |
demo.launch()
|
|
|
62 |
img_mode = None
|
63 |
|
64 |
h, w = img.shape[0:2]
|
65 |
+
if h > 3500 or w > 3500:
|
66 |
+
print('too large size')
|
67 |
+
return None, None
|
68 |
+
|
69 |
if h < 300:
|
70 |
img = cv2.resize(img, (w * 2, h * 2), interpolation=cv2.INTER_LANCZOS4)
|
71 |
|
|
|
147 |
# ['10045.png', 'v1.4', 2, 50]]).launch()
|
148 |
examples=[['AI-generate.jpg', 'v1.4', 2], ['lincoln.jpg', 'v1.4', 2], ['Blake_Lively.jpg', 'v1.4', 2],
|
149 |
['10045.png', 'v1.4', 2]])
|
150 |
+
demo.queue(concurrency_count=1)
|
151 |
demo.launch()
|