lh 4 месяцев назад
Родитель
Сommit
eb6ca981d3

+ 193 - 1
app/Http/Controllers/AIGeneration/VideoGenerationController.php

@@ -469,7 +469,16 @@ class VideoGenerationController extends BaseController
     public function getSeedanceTaskStatus(string $taskId): JsonResponse
     {
         try {
-            $result = $this->aiVideoGenerationService->querySeedanceTaskStatus($taskId);
+            $task = \App\Models\MpGenerateVideoTask::where('task_id', $taskId)->first();
+
+            if (!$task) {
+                return response()->json([
+                    'success' => false,
+                    'message' => '任务不存在'
+                ], 404);
+            }
+
+            $result = $this->aiVideoGenerationService->querySeedanceTaskStatus($task);
             return $this->success($result);
         } catch (\Exception $e) {
             Utils::throwError('1001:'.$e->getMessage());
@@ -551,6 +560,189 @@ class VideoGenerationController extends BaseController
     }
 
     /**
+     * 创建可灵AI Omni视频生成任务
+     *
+     * @param Request $request
+     * @return JsonResponse
+     */
+    public function createKelingTask(Request $request): JsonResponse
+    {
+        $data = $request->all();
+        
+        // 验证基本参数
+        $baseRules = [
+            'model' => 'required|string|in:kling-video-o1,kling-v3-omni',
+            'prompt' => 'required|max:2500',
+            'mode' => 'nullable|in:pro,std',
+            'aspect_ratio' => 'nullable|in:16:9,4:3,1:1,3:4,9:16,21:9',
+            'video_duration' => 'required|integer|min:3|max:15',
+        ];
+        
+        $baseMessages = [
+            'model.required' => '模型参数不能为空',
+            'model.in' => '模型只支持 kling-video-o1、kling-v3-omni',
+            'prompt.required' => '提示词不能为空',
+            'prompt.max' => '提示词不能超过2500个字符',
+            'mode.in' => '模式只能是 pro 或 std',
+            'aspect_ratio.in' => '宽高比只能是 16:9、4:3、1:1、3:4、9:16、21:9',
+            'video_duration.required' => '请填写视频时长',
+            'video_duration.integer' => '视频时长必须是整数',
+            'video_duration.min' => '视频时长不能少于3秒',
+            'video_duration.max' => '视频时长不能超过15秒',
+        ];
+        
+        // 可选参数验证
+        $optionalRules = [
+            'multi_prompt' => 'nullable|array',
+            'multi_prompt.*' => 'string|max:2500',
+            'shot_type' => 'nullable|in:customize,single_shot,multi_shot',
+            'generate_audio' => 'nullable|boolean',
+            'webhook_url' => 'nullable|url',
+            'seed' => 'nullable|integer|min:-1|max:4294967295',
+            'video_resolution' => 'nullable|in:480P,720P,1080P',
+        ];
+        
+        $optionalMessages = [
+            'multi_prompt.array' => '多段提示词必须是数组',
+            'multi_prompt.*.string' => '每段提示词必须是字符串',
+            'multi_prompt.*.max' => '每段提示词不能超过2500个字符',
+            'shot_type.in' => '镜头类型只能是 customize、single_shot、multi_shot',
+            'webhook_url.url' => '回调地址格式不正确',
+            'seed.integer' => '随机种子必须是整数',
+            'seed.min' => '随机种子不能小于-1',
+            'seed.max' => '随机种子不能超过4294967295',
+            'video_resolution.in' => '分辨率只能是 480P、720P 或 1080P',
+        ];
+
+        // 检查是否有首帧URL
+        if (isset($data['first_frame_url'])) {
+            $optionalRules['first_frame_url'] = 'url';
+            $optionalMessages['first_frame_url.url'] = '首帧图片URL格式不正确';
+        }
+        
+        // 检查是否有尾帧URL
+        if (isset($data['tail_frame_url'])) {
+            $optionalRules['tail_frame_url'] = 'url';
+            $optionalMessages['tail_frame_url.url'] = '尾帧图片URL格式不正确';
+        }
+        
+        // 检查是否有首帧文件
+        if ($request->hasFile('first_frame_file')) {
+            $optionalRules['first_frame_file'] = 'image|mimes:jpeg,png|max:4800';
+            $optionalMessages = array_merge($optionalMessages, [
+                'first_frame_file.image' => '首帧必须是图片文件',
+                'first_frame_file.mimes' => '首帧图片必须是jpeg,png格式',
+                'first_frame_file.max' => '首帧图片大小不能超过4.7MB',
+            ]);
+        }
+        
+        // 检查是否有尾帧文件
+        if ($request->hasFile('tail_frame_file')) {
+            $optionalRules['tail_frame_file'] = 'image|mimes:jpeg,png|max:4800';
+            $optionalMessages = array_merge($optionalMessages, [
+                'tail_frame_file.image' => '尾帧必须是图片文件',
+                'tail_frame_file.mimes' => '尾帧图片必须是jpeg,png格式',
+                'tail_frame_file.max' => '尾帧图片大小不能超过4.7MB',
+            ]);
+        }
+
+        if (isset($data['tail_frame_url']) && !isset($data['first_frame_url'])) {
+            Utils::throwError('1002:提供尾帧URL时必须提供首帧URL');
+        }
+
+        if ($request->hasFile('tail_frame_file') && !$request->has('first_frame_file')) {
+            Utils::throwError('1002:提供尾帧文件时必须提供首帧文件');
+        }
+
+        $validationRules = array_merge($baseRules, $optionalRules);
+        $validationMessages = array_merge($baseMessages, $optionalMessages);
+
+        // 处理图片相关参数
+        
+        $validator = Validator::make($data, $validationRules, $validationMessages);
+        
+        if ($validator->fails()) {
+            Utils::throwError('1002:'.$validator->errors()->first());
+        }
+
+        $firstFrame = null;
+        $tailFrame = null;
+
+        $data['image_list'] = [];
+        // 处理首帧图片(文件上传方式)
+        if ($request->hasFile('first_frame_file')) {
+            $firstFrameFile = $request->file('first_frame_file');
+            $firstFrame = $this->processFrameFile($firstFrameFile, 'first');
+            $data['first_frame_url'] = $firstFrame['url'];
+            $data['image_list'][] = [
+                'image_url' => $data['first_frame_url'],
+                'type' => 'first_frame',
+            ];
+        }
+        // 处理首帧图片(URL方式)
+        elseif (isset($data['first_frame_url']) && !empty($data['first_frame_url'])) {
+            $firstFrame = Utils::getRemoteImageInfo($data['first_frame_url'], true);
+            if (!$firstFrame) {
+                Utils::throwError('1003:首帧图片获取失败');
+            }
+            $data['image_list'][] = [
+                'image_url' => $data['first_frame_url'],
+                'type' => 'first_frame',
+            ];
+        }
+
+        // 处理尾帧图片(文件上传方式)
+        if ($request->hasFile('tail_frame_file')) {
+            $tailFrameFile = $request->file('tail_frame_file');
+            $tailFrame = $this->processFrameFile($tailFrameFile, 'tail');
+            $data['tail_frame_url'] = $tailFrame['url'];
+            $data['image_list'][] = [
+                'image_url' => $data['tail_frame_url'],
+                'type' => 'end_frame',
+            ];
+        }
+        // 处理尾帧图片(URL方式)
+        elseif (isset($data['tail_frame_url']) && !empty($data['tail_frame_url'])) {
+            $tailFrame = Utils::getRemoteImageInfo($data['tail_frame_url'], true);
+            if (!$tailFrame) {
+                Utils::throwError('1003:尾帧图片获取失败');
+            }
+            $data['image_list'][] = [
+                'image_url' => $data['tail_frame_url'],
+                'type' => 'end_frame',
+            ];
+        }
+
+        $task = $this->aiVideoGenerationService->createKelingOmniTask($data);
+        return $this->success(['task_id' => $task->task_id, 'status' => $task->status]);
+    }
+
+    /**
+     * 查询可灵AI Omni任务状态
+     *
+     * @param string $taskId
+     * @return JsonResponse
+     */
+    public function getKelingTaskStatus(string $taskId): JsonResponse
+    {
+        try {
+            $task = \App\Models\MpGenerateVideoTask::where('task_id', $taskId)->first();
+
+            if (!$task) {
+                return response()->json([
+                    'success' => false,
+                    'message' => '任务不存在'
+                ], 404);
+            }
+
+            $result = $this->aiVideoGenerationService->queryKelingOmniTaskStatus($task);
+            return $this->success($result);
+        } catch (\Exception $e) {
+            Utils::throwError('1001:'.$e->getMessage());
+        }
+    }
+
+    /**
      * 获取视频任务列表
      *
      * @param Request $request

+ 343 - 4
app/Services/AIGeneration/AIVideoGenerationService.php

@@ -37,6 +37,7 @@ class AIVideoGenerationService
             'frames' => $params['video_duration'] ? ($params['video_duration'] * 24 + 1) : 121,
             'video_resolution' => $params['video_resolution'] ?? '720P',
             'status' => MpGenerateVideoTask::STATUS_PENDING,
+            'api_type' => 'jimeng',
         ]);
 
         // 发送异步请求到即梦AI API创建任务
@@ -261,12 +262,15 @@ class AIVideoGenerationService
         foreach ($tasks as $task) {
             $api_type = getProp($task, 'api_type');
             switch($api_type) {
-                case 'seedance_1_5_pro':
+                case 'seedance':
                     $this->updateSeedanceTask($task);
                     break;
-                case 'jimeng_ai':
+                case 'jimeng':
                     $this->updateJimengTask($task);
                     break;
+                case 'keling':
+                    $this->updateKelingOmniTask($task);
+                    break;
                 default:
                     break;
             }
@@ -331,9 +335,8 @@ class AIVideoGenerationService
             'frames' => $params['video_duration'] ? ($params['video_duration'] * 24 + 1) : null,
             'video_resolution' => $params['video_resolution'] ?? '720P',
             'status' => MpGenerateVideoTask::STATUS_PENDING,
-            'api_type' => 'seedance_1_5_pro', // 标识为 Seedance 1.5 Pro API
+            'api_type' => 'seedance', // 标识为 Seedance 1.5 Pro API
             'extra_params' => [
-                'api_type' => 'seedance_1_5_pro',
                 'model' => $params['model'] ?? 'doubao-seedance-1-5-pro-251215',
                 'content' => $params['content'],
                 'callback_url' => $params['callback_url'] ?? '',
@@ -641,6 +644,342 @@ class AIVideoGenerationService
     }
 
     /**
+     * 生成可灵AI的JWT Token
+     *
+     * @return string
+     */
+    private function generateKelingJwtToken(): string
+    {
+        $ak = env('KELING_AK');
+        $sk = env('KELING_SK');
+        
+        if (empty($ak) || empty($sk)) {
+            throw new \Exception('可灵AI访问密钥未配置,请检查环境变量KELING_AK和KELING_SK');
+        }
+
+        // JWT头部
+        $header = [
+            'alg' => 'HS256',
+            'typ' => 'JWT'
+        ];
+
+        // JWT载荷
+        $payload = [
+            'iss' => $ak,  // 签发者,使用Access Key
+            'exp' => time() + 1800,  // 过期时间,30分钟后过期
+            'nbf' => time() - 5  // 生效时间,5秒前开始生效
+        ];
+
+        // Base64URL编码
+        $headerEncoded = $this->base64UrlEncode(json_encode($header));
+        $payloadEncoded = $this->base64UrlEncode(json_encode($payload));
+
+        // 创建签名
+        $signature = hash_hmac('sha256', $headerEncoded . '.' . $payloadEncoded, $sk, true);
+        $signatureEncoded = $this->base64UrlEncode($signature);
+
+        // 返回完整的JWT token
+        return $headerEncoded . '.' . $payloadEncoded . '.' . $signatureEncoded;
+    }
+
+    /**
+     * Base64URL编码(JWT标准编码)
+     *
+     * @param string $data
+     * @return string
+     */
+    private function base64UrlEncode(string $data): string
+    {
+        return rtrim(strtr(base64_encode($data), '+/', '-_'), '=');
+    }
+
+    /**
+     * 创建可灵AI Omni视频生成任务
+     *
+     * @param array $params
+     * @return MpGenerateVideoTask
+     */
+    public function createKelingOmniTask(array $params): MpGenerateVideoTask
+    {
+        // 生成唯一的任务ID
+        $taskId = 'keling_omni_' . time() . '_' . uniqid();
+
+        // 创建任务记录,复用现有表结构
+        $task = MpGenerateVideoTask::create([
+            'task_id' => $taskId,
+            'prompt' => $params['prompt'] ?? '',
+            'first_frame_url' => $params['first_frame_url'] ?? '',
+            'tail_frame_url' => $params['tail_frame_url'] ?? '',
+            'seed' => $params['seed'] ?? -1,
+            'frames' => $params['video_duration'] ? ($params['video_duration'] * 24 + 1) : null,
+            'video_resolution' => $params['video_resolution'] ?? '720P',
+            'status' => MpGenerateVideoTask::STATUS_PENDING,
+            'api_type' => 'keling', // 标识为可灵AI Omni API
+            'extra_params' => [
+                'api_type' => 'keling',
+                'model' => $params['model'] ?? 'kling-video-o1',
+                'prompt' => $params['prompt'] ?? '',
+                'multi_prompt' => $params['multi_prompt'] ?? [],
+                'shot_type' => $params['shot_type'] ?? 'customize',
+                'image_list' => $params['image_list'] ?? [],
+                'element_list' => $params['element_list'] ?? [],
+                'sound' => $params['sound'] ?? 'off',
+                // 'aspect_ratio' => $params['aspect_ratio'] ?? '16:9',
+                'duration' => $params['video_duration'] ?? 5,
+                'mode' => $params['mode'] ?? 'std',
+                'callback_url' => $params['callback_url'] ?? '',
+            ]
+        ]);
+
+        // 提交任务到可灵AI Omni API
+        $this->submitKelingOmniTaskToApi($task);
+
+        return $task;
+    }
+
+    /**
+     * 提交可灵AI Omni任务到API
+     *
+     * @param MpGenerateVideoTask $task
+     * @return void
+     */
+    private function submitKelingOmniTaskToApi(MpGenerateVideoTask $task): void
+    {
+        $client = new Client(['verify'=>false,'timeout'=>120]);
+        
+        try {
+            // 生成JWT token
+            $jwtToken = $this->generateKelingJwtToken();
+            
+            $extraParams = $task->extra_params;
+            
+            // 构建可灵AI Omni API请求参数
+            $apiParams = [
+                'model_name' => $extraParams['model'],
+                'prompt' => $extraParams['prompt'],
+                'mode' => $extraParams['mode'],
+                // 'aspect_ratio' => $extraParams['aspect_ratio'],
+                'duration' => (int)$extraParams['duration'],
+            ];
+
+            // 添加可选参数
+            if (!empty($extraParams['multi_prompt'])) {
+                $apiParams['multi_prompt'] = $extraParams['multi_prompt'];
+            }
+            if (!empty($extraParams['shot_type'])) {
+                $apiParams['shot_type'] = $extraParams['shot_type'];
+            }
+            if (!empty($extraParams['image_list'])) {
+                $apiParams['image_list'] = $extraParams['image_list'];
+            }
+            if (!empty($extraParams['element_list'])) {
+                $apiParams['element_list'] = $extraParams['element_list'];
+            }
+            if (isset($extraParams['sound'])) {
+                $apiParams['sound'] = $extraParams['sound'];
+            }
+            // if (!empty($extraParams['callback_url'])) {
+            //     $apiParams['callback_url'] = $extraParams['callback_url'];
+            // }
+            
+            dLog('generate')->info('可灵AI Omni视频生成参数: ', $apiParams);
+            
+            // 调用可灵AI Omni API
+            $response = $client->post('https://api-beijing.klingai.com/v1/videos/omni-video', [
+                'headers' => [
+                    'Authorization' => 'Bearer ' . $jwtToken,
+                    'Content-Type' => 'application/json',
+                ],
+                'json' => $apiParams
+            ]);
+
+            $responseData = json_decode($response->getBody(), true);
+            dLog('generate')->info('可灵AI Omni API响应: ', $responseData);
+                
+            if (isset($responseData['error']) || (isset($responseData['code']) && $responseData['code'] !== 0)) {
+                // API返回错误
+                $errorMessage = $responseData['error']['message'] ?? $responseData['message'] ?? 'API Error';
+                $task->updateStatus(MpGenerateVideoTask::STATUS_FAILED, [
+                    'error_message' => $errorMessage,
+                    'extra_params' => array_merge($task->extra_params, ['api_response' => $responseData])
+                ]);
+            } elseif (isset($responseData['data']['task_id'])) {
+                // 任务提交成功,更新状态为处理中
+                $updateData = [
+                    'task_id' => $responseData['data']['task_id'], // 使用API返回的任务ID
+                    'extra_params' => array_merge($task->extra_params, ['api_response' => $responseData])
+                ];
+                $task->updateStatus(MpGenerateVideoTask::STATUS_PROCESSING, $updateData);
+            } else {
+                $task->updateStatus(MpGenerateVideoTask::STATUS_FAILED, [
+                    'error_message' => '未知的API响应格式',
+                    'extra_params' => array_merge($task->extra_params, ['api_response' => $responseData])
+                ]);
+            }
+        } catch (\Exception $e) {
+            // 记录错误
+            $task->updateStatus(MpGenerateVideoTask::STATUS_FAILED, [
+                'error_message' => 'API请求失败: ' . $e->getMessage()
+            ]);
+            dLog('generate')->error('可灵AI Omni API请求异常: ' . $e->getMessage());
+        }
+    }
+
+    /**
+     * 查询可灵AI Omni任务状态
+     *
+     * @param MpGenerateVideoTask $task
+     * @return array
+     */
+    public function queryKelingOmniTaskStatus(MpGenerateVideoTask $task): array
+    {
+        $client = new Client(['verify'=>false,'timeout'=>120]);
+        
+        try {
+            // 如果任务已完成,直接返回结果
+            if (in_array($task->status, [MpGenerateVideoTask::STATUS_SUCCESS, MpGenerateVideoTask::STATUS_FAILED])) {
+                return [
+                    'success' => true,
+                    'data' => [
+                        'task_id' => $task->task_id,
+                        'task_status' => $this->mapTaskStatusToKelingStatus($task->status),
+                        'result_url' => $task->result_url,
+                        'error_message' => $task->error_message,
+                        'created_at' => $task->created_at,
+                        'updated_at' => $task->updated_at
+                    ]
+                ];
+            }
+
+            // 生成JWT token
+            $jwtToken = $this->generateKelingJwtToken();
+            
+            // 构建查询URL
+            $url = 'https://api-beijing.klingai.com/v1/videos/omni-video/' . $task->task_id;
+            
+            $response = $client->get($url, [
+                'headers' => [
+                    'Authorization' => 'Bearer ' . $jwtToken,
+                    'Content-Type' => 'application/json',
+                ]
+            ]);
+
+            $responseData = json_decode($response->getBody(), true);
+            dLog('generate')->info('可灵AI Omni任务状态查询响应: ', $responseData);
+
+            if (isset($responseData['error']) || (isset($responseData['code']) && $responseData['code'] !== 0)) {
+                return [
+                    'status' => 'failed',
+                    'error_message' => $responseData['error']['message'] ?? $responseData['message'] ?? 'API查询失败',
+                    'result_json' => $responseData
+                ];
+            }
+
+            // 解析任务状态
+            $taskData = $responseData['data'] ?? [];
+            $taskStatus = $taskData['task_status'] ?? 'unknown';
+            
+            $updateData = ['result_json' => $responseData];
+            
+            if ($taskStatus === 'succeed') {
+                $updateData['status'] = 'success';
+                // 任务成功,处理结果
+                if (isset($taskData['task_result']['videos']) && !empty($taskData['task_result']['videos'])) {
+                    $video = $taskData['task_result']['videos'][0];
+                    $video_url = $video['url'];
+                    
+                    // 下载并保存视频
+                    $video_name = 'ai_generation_' . time() . '_' . uniqid();
+                    $video_ext = getVideoExtFromUrl($video_url);
+                    $video_name = $video_name . $video_ext;
+                    $url = uploadStreamByTos('video', file_get_contents($video_url), $video_name);
+                    $updateData['result_url'] = $url;
+                }
+                return $updateData;
+            } elseif ($taskStatus === 'failed') {
+                $updateData = [
+                    'status' => 'failed',
+                    'error_message' => '任务执行失败',
+                    'result_json' => $responseData
+                ];
+                return $updateData;
+            }
+            // 其他状态(processing等)保持不变
+
+            return [
+                'success' => true,
+                'data' => [
+                    'task_id' => $task->task_id,
+                    'task_status' => $taskStatus,
+                    'result_url' => $task->result_url,
+                    'error_message' => $task->error_message,
+                    'created_at' => $task->created_at,
+                    'updated_at' => $task->updated_at,
+                    'api_response' => $responseData
+                ]
+            ];
+        } catch (\Exception $e) {
+            dLog('generate')->error('可灵AI Omni任务状态查询异常: ' . $e->getMessage());
+            return [
+                'success' => false,
+                'message' => '查询失败: ' . $e->getMessage()
+            ];
+        }
+    }
+
+    /**
+     * 映射任务状态到可灵AI状态格式
+     *
+     * @param string $taskStatus
+     * @return string
+     */
+    private function mapTaskStatusToKelingStatus(string $taskStatus): string
+    {
+        switch ($taskStatus) {
+            case MpGenerateVideoTask::STATUS_PENDING:
+                return 'submitted';
+            case MpGenerateVideoTask::STATUS_PROCESSING:
+                return 'processing';
+            case MpGenerateVideoTask::STATUS_SUCCESS:
+                return 'succeed';
+            case MpGenerateVideoTask::STATUS_FAILED:
+                return 'failed';
+            default:
+                return 'unknown';
+        }
+    }
+
+    /**
+     * 更新可灵AI Omni视频任务状态
+     *
+     * @param MpGenerateVideoTask $task
+     * @return void
+     */
+    private function updateKelingOmniTask($task): void
+    {
+        $statusInfo = $this->queryKelingOmniTaskStatus($task);
+        if (!isset($statusInfo['status'])) return;
+
+        if ($statusInfo['status'] === 'success') {
+            $task->updateStatus(MpGenerateVideoTask::STATUS_SUCCESS, $statusInfo);
+        } elseif ($statusInfo['status'] === 'failed') {
+            $task->updateStatus(MpGenerateVideoTask::STATUS_FAILED, [
+                'error_message' => $statusInfo['error_message'],
+                'result_json' => $statusInfo['result_json'] ?? []
+            ]);
+        }
+        // 如果仍然是处理中状态,不做任何操作
+        
+        // 处理:如果任务处理超过24小时,标记为失败
+        $processingTime = now()->diffInHours($task->created_at);
+        if ($processingTime > 24) {
+            $task->updateStatus(MpGenerateVideoTask::STATUS_FAILED, [
+                'error_message' => '任务处理超时(超过24小时)'
+            ]);
+        }
+    }
+
+    /**
      * 映射任务状态到前端显示状态
      *
      * @param string $taskStatus

+ 5 - 5
app/Transformer/AIGeneration/AIGenerationTransformer.php

@@ -33,12 +33,12 @@ class AIGenerationTransformer
             $result[] = [
                 'task_id'               => getProp($item, 'task_id'),
                 'prompt'                => getProp($item, 'prompt'),
-                'width'                 => getProp($item, 'width'),
-                'height'                => getProp($item, 'height'),
-                'image_num'             => getProp($item, 'image_num'),
-                'scale'                 => getProp($item, 'scale'),
-                'ref_img_url'           => getProp($item, 'ref_img_url'),
+                'seed'                  => getProp($item, 'seed'),
+                'video_resolution'      => getProp($item, 'video_resolution'),
+                'video_duration'        => getProp($item, 'frames') ? round((getProp($item, 'frames') - 1) / 24) : 0,
                 'result_url'            => getProp($item, 'result_url'),
+                'last_frame_url'        => getProp($item, 'last_frame_url'),
+                'api_type'              => getProp($item, 'api_type'),
                 'status'                => $status,
                 'status_info'           => isset($status_arr[$status]) ? $status_arr[$status] : '',
                 'created_at'            => transDate(getProp($item, 'created_at')),

+ 6 - 1
routes/api.php

@@ -104,12 +104,17 @@ Route::group(['middleware' => ['bindToken', 'bindExportToken', 'checkLogin']], f
         
         // 视频生成相关路由
         Route::get('video/taskList', [VideoGenerationController::class, 'taskList']);
+        // 即梦AI3.0视频生成路由
         Route::post('video/createJimengTask', [VideoGenerationController::class, 'createJimengTask']);
         Route::get('video/taskStatus', [VideoGenerationController::class, 'taskStatus']);
         
         // Seedance 1.5 Pro 视频生成路由
         Route::post('video/createSeedanceTask', [VideoGenerationController::class, 'createSeedanceTask']);
-        Route::get('video/seedance/taskStatus/{taskId}', [VideoGenerationController::class, 'getSeedanceTaskStatus']);
+        // Route::get('video/seedance/taskStatus/{taskId}', [VideoGenerationController::class, 'getSeedanceTaskStatus']);
+
+        // 可灵Omni视频生成路由
+        Route::post('video/createKelingTask', [VideoGenerationController::class, 'createKelingTask']);
+        Route::get('video/keling/taskStatus/{taskId}', [VideoGenerationController::class, 'getKelingTaskStatus']);
     });
     
 });