Light Mode
Create Task
POST
/api/v1/taskThis endpoint from PiAPI's Dream Machine API utilizes Dream Machine model by Luma Labs to produce text/image-to-video generation.
Request
Body Params application/json
model
enum<string>
required
the model name
Allowed value:
luma
task_type
enum<string>
required
type of the task
Allowed values:
video_generationextend_video
input
object
required
the input param of the luma task
prompt
string
required
The prompt is a description that enables the Dream Machine API to produce a video.
expand_prompt
boolean
optional
The recommended value at this time is false. We have tested that the value false
results in better quality.
Default:
false
loop
boolean
optional
Default:
false
key_frames
object
optional
if left null then the task would be a text-to-video task; if filled out, then the task would be an image-to-video or video extend task.
In image-to-video task, the type of the frame can only be set to image
. It can be left null, or you can choose to set only frame0 or frame1.
Example
{
"model": "luma",
"task_type": "video_generation",
"input": {
"prompt": "Fly fishing",
"expand_prompt": true,
"loop": true
},
"config": {
"service_mode": "private",
"webhook_config": {
"endpoint": "",
"secret": ""
}
}
}
Request samples
Responses
Success(200)
HTTP Code: 200
Content Type : JSONapplication/json
Data Schema
object {0}
Example
{
"code": 200,
"data": {
"task_id": "f7a6d8e5-249f-4a9e-a8f4-1e8af806ea15",
"model": "luma",
"task_type": "video_generation",
"status": "pending",
"config": {
"service_mode": "public",
"webhook_config": {
"endpoint": "",
"secret": ""
}
},
"input": {},
"output": {
"prompt": "",
"internal_state": "",
"created_at": "",
"video": null,
"video_raw": null,
"thumbnail": null,
"last_frame": null
},
"meta": {},
"detail": null,
"logs": null,
"error": {
"code": 0,
"raw_message": "",
"message": "",
"detail": null
}
},
"message": "success"
}
Modified at 8 days ago