//native
type Lumaai = {
apiKey: string;
};
/**
* Upscale a generation
* Upscale a generation by its ID
*/
export async function main(
auth: Lumaai,
id: string,
body: {
generation_type?: "upscale_video";
resolution?: string;
callback_url?: string;
},
) {
const url = new URL(
`https://api.lumalabs.ai/dream-machine/v1/generations/${id}/upscale`,
);
const response = await fetch(url, {
method: "POST",
headers: {
"Content-Type": "application/json",
Authorization: "Bearer " + auth.apiKey,
},
body: JSON.stringify(body),
});
if (!response.ok) {
const text = await response.text();
throw new Error(`${response.status} ${text}`);
}
return await response.json();
}
Submitted by hugo697 235 days ago