Upscale
POST
/v2/upscale提高稳定扩散生成的图像质量不可或缺的工具。您可以在此处获取指导:https://novita.ai/get-started/UseCase_ImageEnhancement.html#_15-upscale。
请求参数
Base64 编码图像
人工智能升级器是用大量数据训练的模型。
调整大小模式:0 表示“通过 upscaling_resize 缩放”,最大图像尺寸 < 2048,1 表示“通过 upscaling_resize_w 和 upscaling_resize_h 缩放”,最大图像尺寸 < 2048
图片的放大倍数,如果输入upscaling_resize:2,图片尺寸为512x512,将返回图片1024x1024(最大图片尺寸为2048)
目标图像宽度,最大图像尺寸为2048
目标图像高度,最大图像尺寸为2048
人工智能升级器是用大量数据训练的模型。
范围[0~1],Extras_upscaler_2可见性
范围[0~1],GFPGAN可见性
范围[0~1],CodeFormer可见性
范围[0~1],CodeFormer权重(0=最大效果,1=最小效果)
图像存储时间(秒)。范围 [0, 604800]
{
"image": "{{base64 encoded image}}",
"upscaler_1": "R-ESRGAN 4x+",
"resize_mode": 1,
"upscaling_resize": null,
"upscaling_resize_w": 1024,
"upscaling_resize_h": 1024,
"upscaling_crop": true,
"upscaler_2": "R-ESRGAN 4x+",
"extras_upscaler_2_visibility": 0.5,
"gfpgan_visibility": 0.5,
"codeformer_visibility": 0.5,
"codeformer_weight": 0.5,
"img_expire_ttl": null
}
示例代码
返回响应
CodeNormal = 0、CodeInternalError = -1、CodeInvalidJSON = 1、CodeModelNotExist = 2、CodeTaskIdNotExist = 3、CodeInvalidAuth = 4、CodeHostUnavailable = 5、CodeParamRangeOutOfLimit = 6、CodeCostBalanceFailure = 7、CodeSamplerNotExist = 8、CodeTimeout = 9
任务 ID,由 /v2/progress
使用
{
"code": null,
"msg": "",
"data": {
"task_id": "",
"warn": ""
}
}