Welcome to the Lazy Image to Video template! This template allows you to create a web application that uses Stability AI to generate video clips from images. It's a perfect solution for builders looking to integrate advanced AI-powered video generation into their projects without worrying about the complexities of deployment and environment setup.
To begin using this template, simply click on "Start with this Template" on the Lazy platform. This will pre-populate the code in the Lazy Builder interface, so you won't need to copy or paste any code manually.
Before testing the application, you'll need to set up an environment secret for the Stability API key. Here's how to do it:
STABILITY_API_KEY
and paste the API key you copied as the value.With the environment secret set, you're ready to deploy the app. Press the "Test" button in the Lazy Builder interface. This will start the deployment process and launch the Lazy CLI. You will not be prompted for any user input at this stage, as the template does not require CLI input.
Once the app is deployed, Lazy will provide you with a dedicated server link. Use this link to access the web interface of your Image to Video application. Here's how to use the interface:
If you wish to integrate this video generation feature into another service or frontend, you can use the server link provided by Lazy to make API calls to the /generate
and /poll/{id}
endpoints. Here's a sample request to start video generation:
POST /generate
Content-Type: multipart/form-data
Authorization: Bearer YOUR_STABILITY_API_KEY
{
"image": "data:image/jpeg;base64,...", // Base64 encoded image
"seed": "0",
"cfg_scale": "1.8",
"motion_bucket_id": "127"
}
And here's a sample request to poll the status of the video generation:
GET /poll/{video_id}
Accept: video/*
Authorization: Bearer YOUR_STABILITY_API_KEY
Replace YOUR_STABILITY_API_KEY
with the actual API key and {video_id}
with the ID you received after generating the video.
For further details on the Stability AI API, refer to the official documentation provided by Stability AI.
By following these steps, you can easily set up and integrate the Lazy Image to Video template into your project, leveraging the power of AI to enhance your application's capabilities.