Spaces:
Runtime error
Runtime error
root
commited on
Commit
•
e783b2d
1
Parent(s):
efb7c62
Front-Back connect test
Browse files
app.py
CHANGED
@@ -126,6 +126,11 @@ def call_JS(sd_method, **kwargs):
|
|
126 |
return f"async (...x) => {{ return await SD.{sd_method}({{ x, ...{param_str} }}) ?? []; }}"
|
127 |
|
128 |
def img2img(*args):
|
|
|
|
|
|
|
|
|
|
|
129 |
url = "http://flagart.baai.ac.cn/api/img2img/"
|
130 |
d = {"data":args}
|
131 |
r = requests.post(url, json=d, headers={"Content-Type": "application/json", "Accept": "*/*", "Accept-Encoding": "gzip, deflate, br", "Connection": "keep-alive"})
|
@@ -403,7 +408,7 @@ if __name__ == "__main__":
|
|
403 |
img2img_mask_blur_strength, img2img_steps, img2img_sampling, img2img_toggles,
|
404 |
img2img_realesrgan_model_name, img2img_batch_count, img2img_cfg,
|
405 |
img2img_denoising, img2img_seed, img2img_height, img2img_width, img2img_resize,
|
406 |
-
img2img_image_editor
|
407 |
img2img_outputs = [output_img2img_gallery, output_img2img_seed, output_img2img_params,
|
408 |
output_img2img_stats]
|
409 |
|
|
|
126 |
return f"async (...x) => {{ return await SD.{sd_method}({{ x, ...{param_str} }}) ?? []; }}"
|
127 |
|
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}
|
136 |
r = requests.post(url, json=d, headers={"Content-Type": "application/json", "Accept": "*/*", "Accept-Encoding": "gzip, deflate, br", "Connection": "keep-alive"})
|
|
|
408 |
img2img_mask_blur_strength, img2img_steps, img2img_sampling, img2img_toggles,
|
409 |
img2img_realesrgan_model_name, img2img_batch_count, img2img_cfg,
|
410 |
img2img_denoising, img2img_seed, img2img_height, img2img_width, img2img_resize,
|
411 |
+
img2img_image_editor, img2img_image_mask, img2img_embeddings]
|
412 |
img2img_outputs = [output_img2img_gallery, output_img2img_seed, output_img2img_params,
|
413 |
output_img2img_stats]
|
414 |
|