root commited on
Commit
de67b51
1 Parent(s): e783b2d

Front-Back connect test

Browse files
Files changed (1) hide show
  1. app.py +4 -2
app.py CHANGED
@@ -6,6 +6,7 @@ import requests
6
  import json
7
  from PIL import Image
8
  import ui_functions as uifn
 
9
 
10
  txt2img_defaults = {
11
  'prompt': '',
@@ -128,8 +129,9 @@ def call_JS(sd_method, **kwargs):
128
  def img2img(*args):
129
 
130
  # 处理image
131
- args[-2] = args[-2].tolist()
132
- args[-3] = args[-3].tolist()
 
133
 
134
  url = "http://flagart.baai.ac.cn/api/img2img/"
135
  d = {"data":args}
 
6
  import json
7
  from PIL import Image
8
  import ui_functions as uifn
9
+ import numpy
10
 
11
  txt2img_defaults = {
12
  'prompt': '',
 
129
  def img2img(*args):
130
 
131
  # 处理image
132
+ for i, item in enumerate(args):
133
+ if type(item) == numpy.ndarray:
134
+ args[i] = item.tolist()
135
 
136
  url = "http://flagart.baai.ac.cn/api/img2img/"
137
  d = {"data":args}