Xintao commited on
Commit
2ba5174
1 Parent(s): c645ce1

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +5 -1
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=2)
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()