Skip to content

AceDataCloud/LumaAPI

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 

Repository files navigation

Luma Video Generation API

Luma AI video generation service creates beautiful videos through prompts and starting images.

API home page: Ace Data Cloud - Luma Video Generation

Get Started

With the widespread application of AI, various AI programs have gradually become popular. AI has gradually penetrated all aspects of people's work and life. The industries involved in AI are also increasing, from the initial writing, to medical education, and now to video.

Luma is a professional high-quality video generation platform where users only need to upload materials to automatically generate high-quality videos based on different styles and effects. This AI video generator is developed by team members from well-known technology companies, aiming to allow everyone to easily create outstanding videos without complex editing tools.

However, Luma does not officially provide an API. AceDataCloud offers a set of Luma APIs that simulate the integration with Suno's official API, making it convenient and quick to generate the desired videos.

Application and Usage

To use the Luma Videos API, you can first visit the Luma Videos Generation API page and click the "Acquire" button to obtain the credentials needed for the request:

If you are not logged in or registered, you will be automatically redirected to the login page inviting you to register and log in. After logging in or registering, you will be automatically returned to the current page.

Upon the first application, there will be a free quota provided, allowing you to use the API for free.

Basic Usage

To generate a video, you can input any text. For example, if I want to generate a video about astronauts shuttling between space and volcanoes, I can input Astronauts shuttle from space to volcano, as shown in the image:

The generated code is as follows:

You can click the "Try" button to directly test the API. After waiting for 1-2 minutes, the result is as follows:

{
  "success": true,
  "task_id": "e4018a99-1522-4f24-9330-62c2a9b50b59",
  "video_id": "155838f8-7f1e-44d8-b387-192f3b4b509d",
  "prompt": "Astronauts shuttle from space to volcano",
  "video_url": "https://storage.cdn-luma.com/dream_machine/af94e7ca-da35-4b5f-a636-2d7254184d0d/watermarked_video0585de3737db946e5a0ac895384ecd180.mp4",
  "video_height": 752,
  "video_width": 1360,
  "state": "completed",
  "thumbnail_url": "https://platform.cdn.acedata.cloud/luma/e4018a99-1522-4f24-9330-62c2a9b50b59.jpg",
  "thumbnail_width": 1360,
  "thumbnail_height": 752
}

We can see that we have obtained the relevant information of the video, including video ID, video link, video thumbnail, and other content.

The field descriptions are as follows:

  • success: Indicates whether the generation was successful; if successful, it is true, otherwise it is false.
  • task_id: The unique ID of this video generation task.
  • video_id: The unique ID of the video generated by this task.
  • prompt: The keywords for this video generation task.
  • video_url: The link to the resulting video of this generation task.
  • video_height: The height of the generated video thumbnail image.
  • video_width: The width of the generated video thumbnail image.
  • state: The status of this video generation task; if the task is completed, it is completed.
  • thumbnail_url: The link to the generated video thumbnail image.
  • thumbnail_width: The width of the generated video thumbnail image.
  • thumbnail_height: The height of the generated video thumbnail image.

Custom Start and End Frame Generation

If you want to generate a video by customizing the start and end frames, you can input the image links for the start and end frames:

At this time, the start_image_url field can accept the following image as the start frame of the video:

Start Frame

Next, we need to customize the video generation based on the start and end frames and keywords, specifying the following content:

  • action: The action of the video generation task, usually either normal generation generate or extended generation extend, with the default being generate.
  • start_image_url: Specify the start frame of the generated video.
  • end_image_url: Specify the end frame of the generated video.
  • prompt: The keyword content for the generated video.

An example of the input is as follows:

After filling it out, the generated code is as follows:

The corresponding code is:

import requests

url = "https://api.acedata.cloud/luma/videos"

headers = {
    "accept": "application/json",
    "authorization": "Bearer {token}",
    "content-type": "application/json"
}

payload = {
    "start_image_url": "https://cdn.acedata.cloud/r9vsv9.png",
    "action": "generate",
    "prompt": "Astronauts shuttle from space to volcano"
}

response = requests.post(url, json=payload, headers=headers)
print(response.text)

The result obtained is as follows:

{
  "success": true,
  "task_id": "12a18694-fd4b-47e7-9c50-34f30862cff6",
  "video_id": "0105c090-03a5-425a-8026-523341cd575b",
  "prompt": "Astronauts shuttle from space to volcano",
  "video_url": "https://platform.cdn.acedata.cloud/luma/12a18694-fd4b-47e7-9c50-34f30862cff6.mp4",
  "video_height": 656,
  "video_width": 1552,
  "state": "completed",
  "thumbnail_url": "https://platform.cdn.acedata.cloud/luma/12a18694-fd4b-47e7-9c50-34f30862cff6.jpg",
  "thumbnail_width": 1552,
  "thumbnail_height": 656
}

The final result is similar to the previous one, with the generated video start frame containing the image we provided. Of course, you can also provide both start and end frame image links to generate the video; you just need to add an end frame image based on the above. The information for the end frame image is as follows:

End Frame

An example of the input is as follows:

Finally, the following result is obtained:

{
  "success": true,
  "task_id": "d1cb723a-e554-4775-94a4-bb6ae8c7ea67",
  "video_id": "6bebd0d2-f793-472e-9326-38528a9273bb",
  "prompt": "Astronauts shuttle from space to volcano",
  "video_url": "https://platform.cdn.acedata.cloud/luma/d1cb723a-e554-4775-94a4-bb6ae8c7ea67.mp4",
  "video_height": 656,
  "video_width": 1552,
  "state": "completed",
  "thumbnail_url": "https://platform.cdn.acedata.cloud/luma/d1cb723a-e554-4775-94a4-bb6ae8c7ea67.jpg",
  "thumbnail_width": 1552,
  "thumbnail_height": 656
}

The result is similar to the above, and the generated video contains images of both the first and last frames, thus completing the custom first and last frame generation for the video.

More

For more info, please check below APIs and integration documents.

API Path Integration Guidance
Luma Videos Generation API /luma/videos Luma Videos Generation API Integration Guide
Luma Tasks API /luma/tasks Luma Tasks API Integration Guide

Base URL: https://api.acedata.cloud

Support

If you meet any issue, check our from support info.

About

Luma AI video generation service creates beautiful videos through prompts and starting images.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published