Skip to content

Commit

Permalink
Update video gen model version (#12)
Browse files Browse the repository at this point in the history
  • Loading branch information
sepal authored Oct 30, 2023
1 parent eab84a7 commit 4a876b9
Showing 1 changed file with 12 additions and 1 deletion.
13 changes: 12 additions & 1 deletion src/server/data/video.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,13 @@ import { getXataClient } from "@/lib/xata";
import { UserOutOfCreditsError, canGenerateVideo, deductCredits } from "./user";

export enum Scheduler {
DDIMScheduler = "DDIMScheduler",
DPMSolverMultistepScheduler = "DPMSolverMultistepScheduler",
HeunDiscreteScheduler = "HeunDiscreteScheduler",
KarrasDPM = "KarrasDPM",
EulerAncestralDiscreteScheduler = "EulerAncestralDiscreteScheduler",
EulerDiscreteScheduler = "EulerDiscreteScheduler",
PNDMScheduler = "PNDMScheduler",
}

export interface VideoGenerationOptions {
Expand All @@ -15,6 +20,8 @@ export interface VideoGenerationOptions {
steps?: number;
mp4?: boolean;
seed?: number;
width?: number;
height?: number;
}

const defaultOptions: VideoGenerationOptions = {
Expand All @@ -23,6 +30,8 @@ const defaultOptions: VideoGenerationOptions = {
steps: 30,
mp4: true,
seed: 0,
width: 672,
height: 384,
};

export async function requestVideoGeneration(
Expand All @@ -48,7 +57,7 @@ export async function requestVideoGeneration(
});

const prediction = await replicate.predictions.create({
version: "b57dddff6ae2029be57eab3d17e0de5f1c83b822f0defd8ce49bee44d7b52ee6",
version: "78b3a6257e16e4b241245d65c8b2b81ea2e1ff7ed4c55306b511509ddbfd327a",
input: {
prompt: prompt,
...generationSettings,
Expand All @@ -57,6 +66,8 @@ export async function requestVideoGeneration(
webhook_events_filter: ["completed"],
});

console.log("Requested generating video:", prediction);

return videoRecord;
}

Expand Down

0 comments on commit 4a876b9

Please sign in to comment.