Recraft API
Recraft是一款面向专业设计师、插画师和营销人员的 AI 工具。它包括光栅和矢量图像生成、样式创建、品牌风格和颜色的图像生成、图像矢量化和背景去除。
Generate Image - 文生图
POST
https://api.ttapi.io/recraft/images/generations
根据提示词生成一张或者多张图像。
Headers
Content-Type
application/json
TT-API-KEY
用于请求授权 TT-API 的API密钥
Body
prompt
string
是
生成图像描述词 注意:Recraft支持多语言理解能力,但实测英文最佳。
n
int
是
生成图像数量 默认为1,可选1-6 不同图片数量将扣减不同quota
text_layout
object
否
style
string
否
substyle
string
否
size
string
否
图像尺寸,可选范围:
1024x1024
1365x1024
1024x1365
1536x1024
1024x1536
1820x1024
1024x1820
1024x2048
2048x1024
1434x1024
1024x1434
1024x1280
1280x1024
1024x1707
1707x1024 默认:1024x1024
model
string
否
模型版本,可选范围: recraftv3 recraftv2 默认recraftv3
negative_prompt
string
否
生成图像中不希望包含的内容
controls
object
否
请求示例
返回示例
Image To Image - 图生图
POST
https://api.ttapi.io/recraft/images/imageToImage
根据上传图像和提示词生成一张或者多张图像。
Headers
Content-Type
application/json
TT-API-KEY
用于请求授权 TT-API 的API密钥
Body
image
string
是
参考图URL
prompt
string
是
生成图像描述词 注意:Recraft支持多语言理解能力,但实测英文最佳。
strength
number
是
定义与原始图像的差异,应在0-1之间 其中0表示几乎相同,1表示极不相似
n
int
是
生成图像数量 默认为1,可选1-6 不同图片数量将扣减不同quota
style
string
否
substyle
string
否
model
string
否
模型版本,可选范围: recraftv3 recraftv2 默认recraftv3
negative_prompt
string
否
生成图像中不希望包含的内容
controls
object
否
Inpaint image - 图像重绘
POST
https://api.ttapi.io/recraft/images/inpaint
根据上传图像和提示词生成一张或者多张图像。
Headers
Content-Type
application/json
TT-API-KEY
用于请求授权 TT-API 的API密钥
Body
image
string
是
参考图URL
mask
string
是
需要重绘的图片的URL地址 一张跟原图尺寸一样的黑白通道的蒙版(就是图中只包括黑色与白色) 其中白色部分是重绘圈出来的部分 其余部分是黑色
prompt
string
是
生成图像描述词 注意:Recraft支持多语言理解能力,但实测英文最佳。
n
int
是
生成图像数量 默认为1,可选1-6 不同图片数量将扣减不同quota
style
string
否
substyle
string
否
model
string
否
模型版本,可选范围: recraftv3 recraftv2 默认recraftv3
negative_prompt
string
否
生成图像中不希望包含的内容
Replace Background - 背景替换
POST
https://api.ttapi.io/recraft/images/replaceBackground
替换图像背景操作,检测图像的背景并根据给出的提示进行修改。
Headers
Content-Type
application/json
TT-API-KEY
用于请求授权 TT-API 的API密钥
Body
image
string
是
参考图URL
prompt
string
是
生成图像描述词 注意:Recraft支持多语言理解能力,但实测英文最佳。
n
int
是
生成图像数量 默认为1,可选1-6 不同图片数量将扣减不同quota
style
string
否
substyle
string
否
model
string
否
模型版本,可选范围: recraftv3 recraftv2 默认recraftv3
negative_prompt
string
否
生成图像中不希望包含的内容
Vectorize Image - 矢量图像转化
POST
https://api.ttapi.io/recraft/images/vectorize
将给定的光栅图像转换为矢量图像。
Headers
Content-Type
application/json
TT-API-KEY
用于请求授权 TT-API 的API密钥
Body
image
string
是
图片URL
Remove Background - 删除图片背景
POST
https://api.ttapi.io/recraft/images/removeBackground
将给定的图片背景识别并删除。
Headers
Content-Type
application/json
TT-API-KEY
用于请求授权 TT-API 的API密钥
Body
image
string
是
图片URL
Crisp Upscale - 清晰放大
POST
https://api.ttapi.io/recraft/images/crispUpscale
清晰放大给定图像,提高图像分辨率,使图像更清晰 更干净。
Headers
Content-Type
application/json
TT-API-KEY
用于请求授权 TT-API 的API密钥
Body
image
string
是
图片URL
Creative Upscale - 创意放大
POST
https://api.ttapi.io/recraft/images/creativeUpscale
增强给定的图像,提高分辨率,重点是细化小细节和面孔。
Headers
Content-Type
application/json
TT-API-KEY
用于请求授权 TT-API 的API密钥
Body
image
string
是
图片URL
Last updated
Was this helpful?