Skip to content

人脸动漫化

请求地址

POST 方法:/api/image/animegan

请求参数

参数名类型必填说明
contentstring输入路径,图片或文件夹路径
max_poolint最大并发数,文件夹批处理时有效,示例:4

示例代码

python
import requests

url = 'http://127.0.0.1:5699/api/image/animegan'
data = {
    'content': '/path/to/image.jpg',
    'max_pool': 4
}
r = requests.post(url, data=data)
print(r.json())
import requests

url = 'http://127.0.0.1:5699/api/image/animegan'
data = {
    'content': '/path/to/image.jpg',
    'max_pool': 4
}
r = requests.post(url, data=data)
print(r.json())
js
let formData = new FormData();
formData.append("content", "/path/to/image.jpg");
formData.append("max_pool", 4);

fetch("http://127.0.0.1:5699/api/image/animegan", {
  method: "POST",
  body: formData,
})
  .then((response) => response.json())
  .then((data) => {
    console.log(data);
  });
let formData = new FormData();
formData.append("content", "/path/to/image.jpg");
formData.append("max_pool", 4);

fetch("http://127.0.0.1:5699/api/image/animegan", {
  method: "POST",
  body: formData,
})
  .then((response) => response.json())
  .then((data) => {
    console.log(data);
  });
bash
curl -X POST -F 'content=@/path/to/image.jpg' -F 'max_pool=4' http://127.0.0.1:5699/api/image/animegan
curl -X POST -F 'content=@/path/to/image.jpg' -F 'max_pool=4' http://127.0.0.1:5699/api/image/animegan

响应结果

json
{ "status": "success", "msg": "ok" }
{ "status": "success", "msg": "ok" }

Powered by 小白兔AI