Upload examples/veo31_example.js with huggingface_hub
Browse files- examples/veo31_example.js +31 -0
examples/veo31_example.js
ADDED
|
@@ -0,0 +1,31 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
// Veo 3.1 Cinematic Video Generation API Example via NexaAPI
|
| 2 |
+
// Get your free API key at: https://nexa-api.com
|
| 3 |
+
// Install: npm install nexaapi
|
| 4 |
+
|
| 5 |
+
import NexaAPI from 'nexaapi';
|
| 6 |
+
|
| 7 |
+
const client = new NexaAPI({ apiKey: 'YOUR_API_KEY' });
|
| 8 |
+
|
| 9 |
+
async function main() {
|
| 10 |
+
// Generate a cinematic video
|
| 11 |
+
const video = await client.videos.generate({
|
| 12 |
+
model: 'veo-3.1',
|
| 13 |
+
prompt: 'Aerial drone shot of a mountain range at golden hour, cinematic 4K quality',
|
| 14 |
+
duration: 8,
|
| 15 |
+
resolution: '1080p'
|
| 16 |
+
});
|
| 17 |
+
console.log('Veo 3.1 - Generated Cinematic Video URL:');
|
| 18 |
+
console.log(video.data[0].url);
|
| 19 |
+
|
| 20 |
+
// Brand film
|
| 21 |
+
const brandVideo = await client.videos.generate({
|
| 22 |
+
model: 'veo-3.1',
|
| 23 |
+
prompt: 'Ocean waves crashing on a rocky coastline, cinematic slow motion, golden hour',
|
| 24 |
+
duration: 10,
|
| 25 |
+
resolution: '1080p'
|
| 26 |
+
});
|
| 27 |
+
console.log('\nBrand Film URL:');
|
| 28 |
+
console.log(brandVideo.data[0].url);
|
| 29 |
+
}
|
| 30 |
+
|
| 31 |
+
main();
|