|
|
@@ -197,6 +197,35 @@ class AnimeController extends BaseController
|
|
|
'ratios' => $commonRatios,
|
|
|
'resolutions' => $resolutions(['480p', 'sr_720p', '720p', '1080p']),
|
|
|
],
|
|
|
+ // // 海外百度Seedance(dreamina真人素材空间,模型名带baidu-前缀,请求时去掉前缀)
|
|
|
+ // [
|
|
|
+ // 'model' => 'baidu-dreamina-seedance-2-0-260128',
|
|
|
+ // 'name' => 'Seedance 2.0(海外)',
|
|
|
+ // 'duration' => $duration(4, 15),
|
|
|
+ // 'ratios' => $commonRatios,
|
|
|
+ // 'resolutions' => $resolutions(['480p', 'sr_720p', '720p', '1080p', '4k']),
|
|
|
+ // ],
|
|
|
+ // [
|
|
|
+ // 'model' => 'baidu-dreamina-seedance-2-0-fast-260128',
|
|
|
+ // 'name' => 'Seedance 2.0 Fast(海外)',
|
|
|
+ // 'duration' => $duration(4, 15),
|
|
|
+ // 'ratios' => $commonRatios,
|
|
|
+ // 'resolutions' => $resolutions(['480p', 'sr_720p', '720p']),
|
|
|
+ // ],
|
|
|
+ // [
|
|
|
+ // 'model' => 'baidu-dreamina-seedance-2-0-mini-260615',
|
|
|
+ // 'name' => 'Seedance 2.0 Mini(海外)',
|
|
|
+ // 'duration' => $duration(4, 15),
|
|
|
+ // 'ratios' => $commonRatios,
|
|
|
+ // 'resolutions' => $resolutions(['480p', 'sr_720p', '720p']),
|
|
|
+ // ],
|
|
|
+ // [
|
|
|
+ // 'model' => 'baidu-dreamina-seedance-2-5-260628',
|
|
|
+ // 'name' => 'Seedance 2.5(海外)',
|
|
|
+ // 'duration' => $duration(4, 30, -1),
|
|
|
+ // 'ratios' => $commonRatios,
|
|
|
+ // 'resolutions' => $resolutions(['480p', 'sr_720p', '720p', '1080p']),
|
|
|
+ // ],
|
|
|
]);
|
|
|
|
|
|
// 快快版
|
|
|
@@ -894,7 +923,7 @@ class AnimeController extends BaseController
|
|
|
|
|
|
// 如果有首帧图片,添加到content中
|
|
|
if ($hasImage) {
|
|
|
- if (in_array($model, ['doubao-seedance-2-0-260128', 'doubao-seedance-2-0-fast-260128', 'baidu-doubao-seedance-2-5-260628', 'baidu-doubao-seedance-2-0-260128', 'baidu-doubao-seedance-2-0-fast-260128', 'baidu-doubao-seedance-2-0-mini-260615'])) {
|
|
|
+ if (in_array($model, ['doubao-seedance-2-0-260128', 'doubao-seedance-2-0-fast-260128', 'baidu-doubao-seedance-2-5-260628', 'baidu-doubao-seedance-2-0-260128', 'baidu-doubao-seedance-2-0-fast-260128', 'baidu-doubao-seedance-2-0-mini-260615', 'baidu-dreamina-seedance-2-0-260128', 'baidu-dreamina-seedance-2-0-fast-260128', 'baidu-dreamina-seedance-2-0-mini-260615', 'baidu-dreamina-seedance-2-5-260628'])) {
|
|
|
$videoParams['content'][] = [
|
|
|
'type' => 'image_url',
|
|
|
'image_url' => [
|
|
|
@@ -985,6 +1014,7 @@ class AnimeController extends BaseController
|
|
|
} elseif ($this->AnimeService->isSeedance20SeriesModel($model)) {
|
|
|
// 豆包Seedance 2.0(百度AI网关)/ 快快AI Seedance 2.0/2.5:图片需要先上传为素材
|
|
|
$isKuaikuai = $this->AnimeService->isKuaikuaiSeedanceModel($model);
|
|
|
+ $isDreamina = $this->AnimeService->isOverseasBaiduSeedanceModel($model);
|
|
|
// 保存原始参考图用于任务记录
|
|
|
$videoParams['reference_images'] = $reference_images;
|
|
|
|
|
|
@@ -995,10 +1025,12 @@ class AnimeController extends BaseController
|
|
|
// 维护ref_image_url字段(参考图URL,JSON数组,与智帧分支保持一致)
|
|
|
$videoParams['ref_image_url'] = json_encode($reference_images, 256);
|
|
|
|
|
|
- // 参考图上传为素材(百度网关/快快AI),上传失败时同步清理提示词中的<图片N>标记
|
|
|
+ // 参考图上传为素材(国内百度/海外百度dreamina/快快AI),上传失败时同步清理提示词中的<图片N>标记
|
|
|
$reference_image_assets = $isKuaikuai
|
|
|
? $this->AIVideoGenerationService->processReferenceImagesToKuaikuaiAssets($reference_images, $videoParams['prompt'])
|
|
|
- : $this->AIVideoGenerationService->processReferenceImagesToSeedance20Assets($reference_images, $videoParams['prompt']);
|
|
|
+ : ($isDreamina
|
|
|
+ ? $this->AIVideoGenerationService->processReferenceImagesToBaiduDreaminaAssets($reference_images, $videoParams['prompt'])
|
|
|
+ : $this->AIVideoGenerationService->processReferenceImagesToSeedance20Assets($reference_images, $videoParams['prompt']));
|
|
|
|
|
|
// 素材上传失败后提示词可能被清理,同步更新视频参数中的提示词
|
|
|
$videoParams['prompt'] = trim($videoParams['prompt']);
|
|
|
@@ -1016,7 +1048,7 @@ class AnimeController extends BaseController
|
|
|
} else {
|
|
|
// Seedance模型(默认)
|
|
|
// 检查是否为 Seedance 2.0 模型,如果是则需要处理配音音频
|
|
|
- if ($canUseAudio && in_array($model, ['doubao-seedance-2-0-260128', 'doubao-seedance-2-0-fast-260128', 'baidu-doubao-seedance-2-5-260628', 'baidu-doubao-seedance-2-0-260128', 'baidu-doubao-seedance-2-0-fast-260128', 'baidu-doubao-seedance-2-0-mini-260615'])) {
|
|
|
+ if ($canUseAudio && in_array($model, ['doubao-seedance-2-0-260128', 'doubao-seedance-2-0-fast-260128', 'baidu-doubao-seedance-2-5-260628', 'baidu-doubao-seedance-2-0-260128', 'baidu-doubao-seedance-2-0-fast-260128', 'baidu-doubao-seedance-2-0-mini-260615', 'baidu-dreamina-seedance-2-0-260128', 'baidu-dreamina-seedance-2-0-fast-260128', 'baidu-dreamina-seedance-2-0-mini-260615', 'baidu-dreamina-seedance-2-5-260628'])) {
|
|
|
// 添加配音音频到content中
|
|
|
$videoParams['content'][] = [
|
|
|
'type' => 'audio_url',
|
|
|
@@ -3133,7 +3165,7 @@ class AnimeController extends BaseController
|
|
|
|
|
|
// 如果有首帧图片,添加到content中
|
|
|
if ($hasImage) {
|
|
|
- if (in_array($model, ['doubao-seedance-2-0-260128', 'doubao-seedance-2-0-fast-260128', 'baidu-doubao-seedance-2-5-260628', 'baidu-doubao-seedance-2-0-260128', 'baidu-doubao-seedance-2-0-fast-260128', 'baidu-doubao-seedance-2-0-mini-260615'])) {
|
|
|
+ if (in_array($model, ['doubao-seedance-2-0-260128', 'doubao-seedance-2-0-fast-260128', 'baidu-doubao-seedance-2-5-260628', 'baidu-doubao-seedance-2-0-260128', 'baidu-doubao-seedance-2-0-fast-260128', 'baidu-doubao-seedance-2-0-mini-260615', 'baidu-dreamina-seedance-2-0-260128', 'baidu-dreamina-seedance-2-0-fast-260128', 'baidu-dreamina-seedance-2-0-mini-260615', 'baidu-dreamina-seedance-2-5-260628'])) {
|
|
|
$videoParams['content'][] = [
|
|
|
'type' => 'image_url',
|
|
|
'image_url' => [
|
|
|
@@ -3220,6 +3252,7 @@ class AnimeController extends BaseController
|
|
|
} elseif ($this->AnimeService->isSeedance20SeriesModel($model)) {
|
|
|
// 豆包Seedance 2.0(百度AI网关)/ 快快AI Seedance 2.0/2.5:参考图/配音音频需要先上传为素材
|
|
|
$isKuaikuai = $this->AnimeService->isKuaikuaiSeedanceModel($model);
|
|
|
+ $isDreamina = $this->AnimeService->isOverseasBaiduSeedanceModel($model);
|
|
|
// 保存原始参考图用于任务记录
|
|
|
$videoParams['reference_images'] = $reference_images;
|
|
|
|
|
|
@@ -3230,10 +3263,12 @@ class AnimeController extends BaseController
|
|
|
// 维护ref_image_url字段(参考图URL,JSON数组,与智帧分支保持一致)
|
|
|
$videoParams['ref_image_url'] = json_encode($reference_images, 256);
|
|
|
|
|
|
- // 参考图上传为素材(百度网关/快快AI),上传失败时同步清理提示词中的<图片N>标记
|
|
|
+ // 参考图上传为素材(国内百度/海外百度dreamina/快快AI),上传失败时同步清理提示词中的<图片N>标记
|
|
|
$reference_image_assets = $isKuaikuai
|
|
|
? $this->AIVideoGenerationService->processReferenceImagesToKuaikuaiAssets($reference_images, $videoParams['prompt'])
|
|
|
- : $this->AIVideoGenerationService->processReferenceImagesToSeedance20Assets($reference_images, $videoParams['prompt']);
|
|
|
+ : ($isDreamina
|
|
|
+ ? $this->AIVideoGenerationService->processReferenceImagesToBaiduDreaminaAssets($reference_images, $videoParams['prompt'])
|
|
|
+ : $this->AIVideoGenerationService->processReferenceImagesToSeedance20Assets($reference_images, $videoParams['prompt']));
|
|
|
|
|
|
// 素材上传失败后提示词可能被清理,同步更新视频参数中的提示词
|
|
|
$videoParams['prompt'] = trim($videoParams['prompt']);
|
|
|
@@ -3241,7 +3276,7 @@ class AnimeController extends BaseController
|
|
|
$videoParams['reference_image_assets'] = $reference_image_assets;
|
|
|
}
|
|
|
|
|
|
- // 配音音频:快快AI上传为素材;百度/doubao走content audio_url
|
|
|
+ // 配音音频:快快AI上传为素材;国内百度/海外百度/doubao走content audio_url
|
|
|
if ($canUseAudio && $audioUrl) {
|
|
|
if ($isKuaikuai) {
|
|
|
$reference_audio_assets = $this->AIVideoGenerationService->processReferenceAudiosToKuaikuaiAssets([$audioUrl], $videoParams['prompt']);
|
|
|
@@ -3275,7 +3310,7 @@ class AnimeController extends BaseController
|
|
|
} else {
|
|
|
// Seedance模型(默认)
|
|
|
// 检查是否为 Seedance 2.0 模型,如果是则需要处理配音音频
|
|
|
- if ($canUseAudio && in_array($model, ['doubao-seedance-2-0-260128', 'doubao-seedance-2-0-fast-260128', 'baidu-doubao-seedance-2-5-260628', 'baidu-doubao-seedance-2-0-260128', 'baidu-doubao-seedance-2-0-fast-260128', 'baidu-doubao-seedance-2-0-mini-260615'])) {
|
|
|
+ if ($canUseAudio && in_array($model, ['doubao-seedance-2-0-260128', 'doubao-seedance-2-0-fast-260128', 'baidu-doubao-seedance-2-5-260628', 'baidu-doubao-seedance-2-0-260128', 'baidu-doubao-seedance-2-0-fast-260128', 'baidu-doubao-seedance-2-0-mini-260615', 'baidu-dreamina-seedance-2-0-260128', 'baidu-dreamina-seedance-2-0-fast-260128', 'baidu-dreamina-seedance-2-0-mini-260615', 'baidu-dreamina-seedance-2-5-260628'])) {
|
|
|
// 添加配音音频到content中
|
|
|
$videoParams['content'][] = [
|
|
|
'type' => 'audio_url',
|