cblink / baidu-cloud-ai-sdk
Package description here.
dev-master
2023-05-09 06:07 UTC
Requires
- guzzlehttp/guzzle: ^7.5
- symfony/cache: ^5.4
Requires (Dev)
- mockery/mockery: ^1.5
- phpunit/phpunit: ^9.6
This package is auto-updated.
Last update: 2024-12-09 09:37:48 UTC
README
百度AI绘画,文心AI绘画,基于百度智能云文心AI绘画相关的 PHP SDK,官方文档地址:https://cloud.baidu.com/doc/NLP/s/Ml9i5amtk
Installing
$ composer require cblink/baidu-cloud-ai-sdk -vvv
Usage
$c = new ApiClient(); //设置appkey和appsecret $c->setConfig($this->config); $service = new \Cblink\BaiduCloudAiSdk\ApiService(); //获取token(建议做缓存) //$token = $c->getToken(); //设置token $c->setToken($token); //发起画图请求(异步) $r = $c->request($service->getWenXinTxt2imgApi('美女', '1024*1024', '二次元')); //获取画图结果 $r = $c->request($service->getWenXinImgResultApi($r['taskId']));
Tip
- 画图结果违规的话是不会返回数据的
License
MIT