接口说明(新版)
更新时间:2025-11-04
图像特效
黑白图像上色
SDK 调用示例
Python
1# 读取图片
2def get_file_content(filePath):
3 with open(filePath, 'rb') as fp:
4 return fp.read()
5
6image = get_file_content('文件路径')
7
8# 调用黑白图像上色
9res_image = client.colourize(image)
10print(res_image)
接口详情
可参考API文档:黑白图像上色
图像风格转换
SDK 调用示例
Python
1# 读取图片
2def get_file_content(filePath):
3 with open(filePath, 'rb') as fp:
4 return fp.read()
5
6image = get_file_content('文件路径')
7
8# 调用图像风格转换
9res_image = client.styleTrans(image)
10print(res_image)
11
12# 如果有可选参数
13options = {}
14options['option'] = "cartoon"
15res_image = client.styleTrans(image, options)
16print(res_image)
接口详情
可参考API文档:图像风格转换
人像动漫化
SDK 调用示例
Python
1# 读取图片
2def get_file_content(filePath):
3 with open(filePath, 'rb') as fp:
4 return fp.read()
5
6image = get_file_content('文件路径')
7
8# 调用人物动漫化
9res_image = client.selfieAnime(image)
10print(res_image)
11
12# 如果有可选参数
13options['type'] = "anime"
14options['mask_id'] = 3
15res_image = client.selfieAnime(image, options)
16print(res_image)
接口详情
可参考API文档:人像动漫化
图像增强
图像去雾
SDK 调用示例
Python
1# 读取图片
2def get_file_content(filePath):
3 with open(filePath, 'rb') as fp:
4 return fp.read()
5
6image = get_file_content('文件路径')
7
8# 调用图像去雾
9res_image = client.dehaze(image)
10print(res_image)
接口详情
可参考API文档:图像去雾
图像对比度增强
SDK 调用示例
Python
1# 读取图片
2def get_file_content(filePath):
3 with open(filePath, 'rb') as fp:
4 return fp.read()
5
6image = get_file_content('文件路径')
7
8# 调用图像对比度增强
9res_image = client.contrastEnhance(image)
10print(res_image)
接口详情
可参考API文档:图像对比度增强
图像无损放大
SDK 调用示例
Python
1# 读取图片
2def get_file_content(filePath):
3 with open(filePath, 'rb') as fp:
4 return fp.read()
5
6image = get_file_content('文件路径')
7
8# 调用图像无损放大
9res_image = client.imageQualityEnhance(image)
10print(res_image)
接口详情
可参考API文档:图像无损放大
拉伸图像恢复
SDK 调用示例
Python
1# 读取图片
2def get_file_content(filePath):
3 with open(filePath, 'rb') as fp:
4 return fp.read()
5
6image = get_file_content('文件路径')
7
8# 拉伸图像恢复
9res_image = client.stretchRestore(image)
10print(res_image)
接口详情
可参考API文档:拉伸图像恢复
图像修复
SDK 调用示例
Python
1# 读取图片
2def get_file_content(filePath):
3 with open(filePath, 'rb') as fp:
4 return fp.read()
5
6image = get_file_content('文件路径')
7
8# 注意:上传宽高、位置坐标参数要比图片实际宽高小
9rectangle = [{'width': 92, 'top': 25, 'height': 36, 'left': 543}]
10
11# 调用图像修复
12res_image = client.inpaintingByMask(image, rectangle)
13print(res_image)
14
15# 如果有可选参数
16options = {}
17
18# 调用图像修复, 图片参数为本地图片
19res_image = client.inpaintingByMask(image, rectangle, options)
20print(res_image)
接口详情
可参考API文档:图像修复
图像清晰度增强
SDK 调用示例
Python
1# 读取图片
2def get_file_content(filePath):
3 with open(filePath, 'rb') as fp:
4 return fp.read()
5
6image = get_file_content('文件路径')
7
8# 调用图像清晰度增强
9res_image = client.imageDefinitionEnhance(image)
10print(res_image)
接口详情
可参考API文档:图像清晰度增强
