Skip to content

Commit

Permalink
keyframe fix
Browse files Browse the repository at this point in the history
  • Loading branch information
aboutphilippe committed Oct 1, 2024
1 parent 2b916b2 commit a091856
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 21 deletions.
38 changes: 18 additions & 20 deletions lumaai/functions/generate.ts
Original file line number Diff line number Diff line change
Expand Up @@ -22,31 +22,29 @@ export async function lumaaiGenerate({
apiKey,
});

let keyframes;
if (extendGenerationId) {
keyframes = {
frame0: {
type: "generation",
id: extendGenerationId,
},
};
} else if (fromImageUrl) {
keyframes = {
frame0: {
type: "image",
url: fromImageUrl,
},
};
}

const generation = await client.generations
.create({
aspect_ratio: aspectRatio,
prompt: prompt,
...(extendGenerationId
? {
keyframes: {
frame0: {
type: "generation",
id: extendGenerationId,
},
},
}
: {}),
...(fromImageUrl
? {
keyframes: {
frame0: {
type: "image",
url: fromImageUrl,
},
},
}
: {}),
loop,
...(keyframes && { keyframes }),
})
.catch(async (err) => {
if (err instanceof LumaAI.APIError) {
Expand Down
2 changes: 1 addition & 1 deletion lumaai/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@restackio/integrations-lumaai",
"version": "0.0.8",
"version": "0.0.9",
"main": "dist/service.js",
"types": "dist/service.d.ts",
"scripts": {
Expand Down

0 comments on commit a091856

Please sign in to comment.