|
|
@@ -4671,7 +4671,7 @@ class AnimeService
|
|
|
|
|
|
// 如果有首帧图片,添加到content中
|
|
|
if ($hasImage) {
|
|
|
- if (in_array($model, ['doubao-seedance-2-0-260128', 'doubao-seedance-2-0-fast-260128'])) {
|
|
|
+ if (in_array($model, ['doubao-seedance-2-0-260128', 'doubao-seedance-2-0-fast-260128', 'baidu-doubao-seedance-2-0-260128', 'baidu-doubao-seedance-2-0-fast-260128', 'baidu-doubao-seedance-2-0-mini-260615'])) {
|
|
|
$videoParams['content'][] = [
|
|
|
'type' => 'image_url',
|
|
|
'image_url' => [
|
|
|
@@ -4811,7 +4811,7 @@ class AnimeService
|
|
|
$videoParams['video_duration'] = max(4, min(12, ceil($audioDuration)));
|
|
|
}
|
|
|
$task = $this->aiVideoGenerationService->createKuaikuaiVideoTask($videoParams);
|
|
|
- } elseif ($canUseAudio && in_array($model, ['doubao-seedance-2-0-260128', 'doubao-seedance-2-0-fast-260128'])) {
|
|
|
+ } elseif ($canUseAudio && in_array($model, ['doubao-seedance-2-0-260128', 'doubao-seedance-2-0-fast-260128', 'baidu-doubao-seedance-2-0-260128', 'baidu-doubao-seedance-2-0-fast-260128', 'baidu-doubao-seedance-2-0-mini-260615'])) {
|
|
|
// 检查是否为 Seedance 2.0 模型,如果是则需要处理配音音频
|
|
|
// 添加配音音频到content中
|
|
|
$videoParams['content'][] = [
|
|
|
@@ -4857,11 +4857,40 @@ class AnimeService
|
|
|
* @param string $model
|
|
|
* @return bool
|
|
|
*/
|
|
|
- private function isKuaikuaiSeedanceModel(string $model): bool
|
|
|
+ public function isKuaikuaiSeedanceModel(string $model): bool
|
|
|
{
|
|
|
return in_array($model, ['seed-2-fast', 'seed-2-mini', 'seed-2.5', 'seed-2'], true);
|
|
|
}
|
|
|
|
|
|
+ /**
|
|
|
+ * 是否为百度AI网关Seedance 2.0系列模型(系统内使用 baidu- 前缀名,请求网关时映射为 doubao- 原名)
|
|
|
+ *
|
|
|
+ * @param string $model
|
|
|
+ * @return bool
|
|
|
+ */
|
|
|
+ public function isBaiduSeedanceModel(string $model): bool
|
|
|
+ {
|
|
|
+ return in_array($model, [
|
|
|
+ 'baidu-doubao-seedance-2-0-260128',
|
|
|
+ 'baidu-doubao-seedance-2-0-fast-260128',
|
|
|
+ 'baidu-doubao-seedance-2-0-mini-260615',
|
|
|
+ ], true);
|
|
|
+ }
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 是否为 Seedance 2.0 系列模型(百度 doubao-seedance-2.0 / baidu-* / 快快AI seed-2 系列)
|
|
|
+ * 供单条与批量生成入口统一判断,避免各入口各自维护模型白名单
|
|
|
+ *
|
|
|
+ * @param string $model
|
|
|
+ * @return bool
|
|
|
+ */
|
|
|
+ public function isSeedance20SeriesModel(string $model): bool
|
|
|
+ {
|
|
|
+ return strpos($model, 'doubao-seedance-2.0') !== false
|
|
|
+ || $this->isKuaikuaiSeedanceModel($model)
|
|
|
+ || $this->isBaiduSeedanceModel($model);
|
|
|
+ }
|
|
|
+
|
|
|
public function createActVideoTask($data) {
|
|
|
$act_id = getProp($data, 'act_id');
|
|
|
$first_frame_url = getProp($data, 'first_frame_url');
|
|
|
@@ -5038,7 +5067,7 @@ class AnimeService
|
|
|
|
|
|
// 如果有首帧图片,添加到content中
|
|
|
if ($hasImage) {
|
|
|
- if (in_array($model, ['doubao-seedance-2-0-260128', 'doubao-seedance-2-0-fast-260128', 'doubao-seedance-2.0'])) {
|
|
|
+ if (in_array($model, ['doubao-seedance-2-0-260128', 'doubao-seedance-2-0-fast-260128', 'doubao-seedance-2.0', 'baidu-doubao-seedance-2-0-260128', 'baidu-doubao-seedance-2-0-fast-260128', 'baidu-doubao-seedance-2-0-mini-260615'])) {
|
|
|
$videoParams['content'][] = [
|
|
|
'type' => 'image_url',
|
|
|
'image_url' => [
|
|
|
@@ -5143,7 +5172,7 @@ class AnimeService
|
|
|
|
|
|
// 调用统一API创建任务
|
|
|
$task = $this->aiVideoGenerationService->createUnifiedApiTask($unifiedParams);
|
|
|
- } elseif (strpos($model, 'doubao-seedance-2.0') !== false || $this->isKuaikuaiSeedanceModel($model)) {
|
|
|
+ } elseif ($this->isSeedance20SeriesModel($model)) {
|
|
|
// 豆包Seedance 2.0(百度AI网关)/ 快快AI Seedance 2.0/2.5:图片需要先上传为素材
|
|
|
$isKuaikuai = $this->isKuaikuaiSeedanceModel($model);
|
|
|
// 保存原始参考图用于任务记录
|
|
|
@@ -5358,7 +5387,7 @@ class AnimeService
|
|
|
|
|
|
// 调用统一API创建任务
|
|
|
$task = $this->aiVideoGenerationService->createUnifiedApiTask($unifiedParams);
|
|
|
- } elseif (strpos($model, 'doubao-seedance-2.0') !== false || $this->isKuaikuaiSeedanceModel($model)) {
|
|
|
+ } elseif ($this->isSeedance20SeriesModel($model)) {
|
|
|
// 豆包Seedance 2.0(百度AI网关)/ 快快AI Seedance 2.0/2.5:图片/视频/音频需要先上传为素材
|
|
|
$isKuaikuai = $this->isKuaikuaiSeedanceModel($model);
|
|
|
$videoParams['reference_images'] = $reference_images;
|