File size: 991 Bytes
f62b8d3
 
1185ec1
f62b8d3
 
 
 
 
 
 
 
 
4c34e70
 
 
 
 
f62b8d3
0f35d4c
 
f62b8d3
 
 
 
 
 
4c34e70
 
 
 
 
f62b8d3
0f35d4c
 
f62b8d3
 
 
 
 
 
 
 
 
 
 
4c34e70
 
 
 
 
0f35d4c
 
 
f62b8d3
 
f27679f
 
f62b8d3
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
"use server"

import { ChannelInfo, VideoGenerationModel, VideoInfo, VideoOrientation } from "@/types/general"

import { uploadVideoRequestToDataset } from "./ai-tube-hf/uploadVideoRequestToDataset"

export async function submitVideoRequest({
  channel,
  apiKey,
  title,
  description,
  prompt,
  model,
  lora,
  style,
  voice,
  music,
  tags,
  duration,
  orientation,
}: {
  channel: ChannelInfo
  apiKey: string
  title: string
  description: string
  prompt: string
  model: VideoGenerationModel
  lora: string
  style: string
  voice: string
  music: string
  tags: string[]
  duration: number
  orientation: VideoOrientation
}): Promise<VideoInfo> {
  if (!apiKey) {
    throw new Error(`the apiKey is required`)
  }

  const { videoRequest, videoInfo } = await uploadVideoRequestToDataset({
    channel,
    apiKey,
    title,
    description,
    prompt,
    model,
    lora,
    style,
    voice,
    music,
    tags,
    duration,
    orientation
  })


  return videoInfo
}