Spaces:
Running
Running
Commit
·
9514b9f
1
Parent(s):
e429049
up
Browse files- .env +2 -1
- src/app/engine/render.ts +6 -3
.env
CHANGED
@@ -9,4 +9,5 @@ VIDEOCHAIN_API_TOKEN=
|
|
9 |
|
10 |
# Not supported yet
|
11 |
REPLICATE_API_TOKEN=
|
12 |
-
REPLICATE_API_MODEL="lucataco/sdxl-panoramic
|
|
|
|
9 |
|
10 |
# Not supported yet
|
11 |
REPLICATE_API_TOKEN=
|
12 |
+
REPLICATE_API_MODEL="lucataco/sdxl-panoramic"
|
13 |
+
REPLICATE_API_MODEL_VERSION="76acc4075d0633dcb3823c1fed0419de21d42001b65c816c7b5b9beff30ec8cd"
|
src/app/engine/render.ts
CHANGED
@@ -10,6 +10,7 @@ const renderingEngine = `${process.env.RENDERING_ENGINE || ""}` as RenderingEngi
|
|
10 |
|
11 |
const replicateToken = `${process.env.REPLICATE_API_TOKEN || ""}`
|
12 |
const replicateModel = `${process.env.REPLICATE_API_MODEL || ""}`
|
|
|
13 |
|
14 |
// note: there is no / at the end in the variable
|
15 |
// so we have to add it ourselves if needed
|
@@ -76,13 +77,15 @@ export async function newRender({
|
|
76 |
if (!replicateModel) {
|
77 |
throw new Error(`you need to configure your REPLICATE_API_MODEL in order to use the REPLICATE rendering engine`)
|
78 |
}
|
79 |
-
|
|
|
|
|
80 |
const replicate = new Replicate({ auth: replicateToken })
|
81 |
|
82 |
// console.log("Calling replicate..")
|
83 |
const seed = generateSeed()
|
84 |
const prediction = await replicate.predictions.create({
|
85 |
-
version:
|
86 |
input: { prompt, seed }
|
87 |
})
|
88 |
|
@@ -99,7 +102,7 @@ export async function newRender({
|
|
99 |
alt: prompt,
|
100 |
error: prediction.error,
|
101 |
maskUrl: "",
|
102 |
-
segments:[]
|
103 |
} as RenderedScene
|
104 |
} else {
|
105 |
|
|
|
10 |
|
11 |
const replicateToken = `${process.env.REPLICATE_API_TOKEN || ""}`
|
12 |
const replicateModel = `${process.env.REPLICATE_API_MODEL || ""}`
|
13 |
+
const replicateModelVersion = `${process.env.REPLICATE_API_MODEL_VERSION || ""}`
|
14 |
|
15 |
// note: there is no / at the end in the variable
|
16 |
// so we have to add it ourselves if needed
|
|
|
77 |
if (!replicateModel) {
|
78 |
throw new Error(`you need to configure your REPLICATE_API_MODEL in order to use the REPLICATE rendering engine`)
|
79 |
}
|
80 |
+
if (!replicateModelVersion) {
|
81 |
+
throw new Error(`you need to configure your REPLICATE_API_MODEL_VERSION in order to use the REPLICATE rendering engine`)
|
82 |
+
}
|
83 |
const replicate = new Replicate({ auth: replicateToken })
|
84 |
|
85 |
// console.log("Calling replicate..")
|
86 |
const seed = generateSeed()
|
87 |
const prediction = await replicate.predictions.create({
|
88 |
+
version: replicateModelVersion,
|
89 |
input: { prompt, seed }
|
90 |
})
|
91 |
|
|
|
102 |
alt: prompt,
|
103 |
error: prediction.error,
|
104 |
maskUrl: "",
|
105 |
+
segments: []
|
106 |
} as RenderedScene
|
107 |
} else {
|
108 |
|