赞
踩
Stability AI在2024年4月18日开放了其最新的SD3 API。它的开放性使得更多的开发者可以接触到Stability AI的AI模型,可以预见到AI技术将会得到更广泛的应用。
API支持Text-to-Image、Image-to-Image两种模式。
AIGC文生图或图生图方向又多了一个选择。体验了下API能力,出图质量相对还是不错的。出图质量比Fooocus高,出图速度比Midjounery快。接口是实时响应,10s左右出结果。
API文档地址:https://platform.stability.ai/
点击右上角账户信息,可以查看API Keys获取key,查看Billing订购积分。
SD3接口地址:https://api.stability.ai/v2beta/stable-image/generate/sd3
当前Stability AI发布的API版本是 v2beta 版本。(几周前还是alpha版本)
接口请求规范参考文档说明即可。
image/* 接收图片字节数据。application/json 接收JSON格式结果,其中包含图片base64编码。
指定种子,允许出图时,参考种子对应的出图结果,进行微调,重新生成新的出图结果。
不指定种子,允许出图时,自由发散的去创作出图结果。
当mode 模式为image-to-image时,去除aspect_ratio 参数,增加参数image、strength
图像降噪是个图像领域的专业词汇,指减少数字图像中噪点的过程。
噪点,可以简单理解为,如果连续时间内,某个点相对同一位置产生的不同点来说误差较大,显得突兀,可以标记为噪点,降噪就是去除噪点的过程。使得图片看起来更加真实,符合人类视觉感受,符合客观规律。
此处使用Postman调用SD3 API,text-to-image。
提示词:Lighthouse on a cliff overlooking the ocean
模型:sd3-turbo
Postman请求明细:可以将以下代码,另存为Stability.postman_collection.json文件,导入到Postman工具。注意替换request.auth.bearer.value为可用的Stability API Key
{ "info": { "_postman_id": "92b9d0d1-fc78-4eed-a01c-de7fa58594d4", "name": "Stability", "schema": "https://schema.getpostman.com/json/collection/v2.1.0/collection.json", "_exporter_id": "7588473" }, "item": [ { "name": "Stable Diffusion 3.0", "protocolProfileBehavior": { "disabledSystemHeaders": { "accept": true } }, "request": { "auth": { "type": "bearer", "bearer": [ { "key": "token", "value": "sk-xxxxxxxxxxxxxx", "type": "string" } ] }, "method": "POST", "header": [ { "key": "content-type", "value": "multipart/form-data" }, { "key": "accept", "value": "application/json" } ], "body": { "mode": "formdata", "formdata": [ { "key": "prompt", "value": "Batman stood under the eaves, the moonlight shining on his black cape", "type": "text" }, { "key": "model", "value": "sd3-turbo", "description": "sd3 sd3-turbo", "type": "text" }, { "key": "aspect_ratio", "value": "9:16", "description": "16:9 1:1 21:9 2:3 3:2 4:5 5:4 9:16 9:21", "type": "text" }, { "key": "mode", "value": "text-to-image", "description": "text-to-image image-to-image", "type": "text" }, { "key": "seed", "value": "0", "type": "text" }, { "key": "output_format", "value": "png", "description": "jpeg png", "type": "text" } ] }, "url": { "raw": "https://api.stability.ai/v2beta/stable-image/generate/sd3", "protocol": "https", "host": [ "api", "stability", "ai" ], "path": [ "v2beta", "stable-image", "generate", "sd3" ] } }, "response": [] } ] }
调用情况如下所示:
指定相同的提示词:Lighthouse on a cliff overlooking the ocean
其中Stable Image Core和Fooocus明确指定了绘图风格 anime
Stable Diffusion 3.0
Stable Image Core
Fooocus 2.3.1
MidJounery
Fooocus官网:fooocus.cc
Stable Diffusion官网:stability.ai/stable-image
MidJounery官网:midjourney.com
Powered By niaonao
Copyright © 2003-2013 www.wpsshop.cn 版权所有,并保留所有权利。