package
Version:
v1.0.2
Opens a new window with list of versions in this module.
Published: May 9, 2024
License: Apache-2.0
Opens a new window with license information.
Imports: 6
Opens a new window with list of imports.
Imported by: 0
Opens a new window with list of known importers.
Documentation
¶
Package ernievilg 百度文心AI画图
func BuildWork(token, keyword, picType, picSize string) (taskID int, err error)
BuildWork 创建画图任务
token:GetToken函数获取,
keyword:图片描述,长度不超过64个字,prompt指南:https://wenxin.baidu.com/wenxin/docs#Ol7ece95m
picType:图片风格,目前支持风格有:油画、水彩画、卡通、粉笔画、儿童画、蜡笔画
picSize:图片尺寸,目前支持的有:1024*1024 方图、1024*1536 长图、1536*1024 横图。
传入的是尺寸数值,非文字。
taskID:任务ID,用于查询结果
type PicURL struct {
Image string `json:"image"`
Score interface{} `json:"score"`
}
PicURL ...
GetPic 获取图片内容
token由GetToken函数获取,taskID由BuildWork函数获取
PicURL:[x]struct{Image:图片链接,Score:评分}
API会返回x张图片,数量不确定的,随机的。
评分目前都是null,我不知道有什么用,既然API预留了,我也预留吧
stauts:结果状态,"30s"代表还在排队生成,"0"表示结果OK
Source Files
¶
Click to show internal directories.
Click to hide internal directories.