Commit
•
a9e45ba
1
Parent(s):
223236c
update text to gif
Browse files- .env +7 -6
- src/app/server/actions/animation.ts +8 -8
.env
CHANGED
@@ -2,17 +2,18 @@
|
|
2 |
# TODO: those could be
|
3 |
# VIDEO_HOTSHOT_XL_API_OFFICIAL
|
4 |
# VIDEO_HOTSHOT_XL_API_JBILCKE
|
5 |
-
#
|
6 |
-
VIDEO_ENGINE="
|
7 |
|
8 |
# the official API developed by the Hotshot-XL team
|
9 |
# note: it isn't released yet
|
10 |
VIDEO_HOTSHOT_XL_API_OFFICIAL=""
|
11 |
|
12 |
-
# the API developed by @jbilcke-hf (me) to allow using any LoRA
|
13 |
# note: doesn't work yet
|
14 |
-
|
15 |
|
16 |
# the Gradio Space (with the auto API) developed by @fffiloni
|
17 |
-
#
|
18 |
-
|
|
|
|
2 |
# TODO: those could be
|
3 |
# VIDEO_HOTSHOT_XL_API_OFFICIAL
|
4 |
# VIDEO_HOTSHOT_XL_API_JBILCKE
|
5 |
+
# VIDEO_HOTSHOT_XL_API_GRADIO
|
6 |
+
VIDEO_ENGINE="VIDEO_HOTSHOT_XL_API_GRADIO"
|
7 |
|
8 |
# the official API developed by the Hotshot-XL team
|
9 |
# note: it isn't released yet
|
10 |
VIDEO_HOTSHOT_XL_API_OFFICIAL=""
|
11 |
|
12 |
+
# the Node API developed by @jbilcke-hf (me) to allow using any LoRA
|
13 |
# note: doesn't work yet
|
14 |
+
VIDEO_HOTSHOT_XL_API_NODE="https://jbilcke-hf-hotshot-xl-api.hf.space/"
|
15 |
|
16 |
# the Gradio Space (with the auto API) developed by @fffiloni
|
17 |
+
# forked to support multiple LoRAs too
|
18 |
+
# note: work in progress
|
19 |
+
VIDEO_HOTSHOT_XL_API_GRADIO="VIDEO_HOTSHOT_XL_API_GRADIO/"
|
src/app/server/actions/animation.ts
CHANGED
@@ -5,8 +5,8 @@ import { ImageInferenceSize } from "@/types"
|
|
5 |
const videoEngine = `${process.env.VIDEO_ENGINE || ""}`
|
6 |
|
7 |
const officialApi = `${process.env.VIDEO_HOTSHOT_XL_API_OFFICIAL || ""}`
|
8 |
-
const
|
9 |
-
const
|
10 |
|
11 |
export async function generateAnimation({
|
12 |
prompt,
|
@@ -23,10 +23,10 @@ export async function generateAnimation({
|
|
23 |
|
24 |
try {
|
25 |
|
26 |
-
if (videoEngine === "
|
27 |
// TODO: support other API to avoid duplicate work?
|
28 |
// (are the other API supporting custom LoRAs?)
|
29 |
-
const res = await fetch(
|
30 |
method: "POST",
|
31 |
headers: {
|
32 |
"Content-Type": "application/json",
|
@@ -53,8 +53,8 @@ export async function generateAnimation({
|
|
53 |
}
|
54 |
|
55 |
return content
|
56 |
-
} else if (videoEngine === "
|
57 |
-
const res = await fetch(
|
58 |
method: "POST",
|
59 |
headers: {
|
60 |
"Content-Type": "application/json",
|
@@ -65,8 +65,8 @@ export async function generateAnimation({
|
|
65 |
fn_index: 0,
|
66 |
data: [
|
67 |
prompt,
|
68 |
-
|
69 |
-
|
70 |
],
|
71 |
}),
|
72 |
cache: "no-store",
|
|
|
5 |
const videoEngine = `${process.env.VIDEO_ENGINE || ""}`
|
6 |
|
7 |
const officialApi = `${process.env.VIDEO_HOTSHOT_XL_API_OFFICIAL || ""}`
|
8 |
+
const nodeApi = `${process.env.VIDEO_HOTSHOT_XL_API_NODE || ""}`
|
9 |
+
const gradioApi = `${process.env.VIDEO_HOTSHOT_XL_API_GRADIO || ""}`
|
10 |
|
11 |
export async function generateAnimation({
|
12 |
prompt,
|
|
|
23 |
|
24 |
try {
|
25 |
|
26 |
+
if (videoEngine === "VIDEO_HOTSHOT_XL_API_NODE") {
|
27 |
// TODO: support other API to avoid duplicate work?
|
28 |
// (are the other API supporting custom LoRAs?)
|
29 |
+
const res = await fetch(nodeApi, {
|
30 |
method: "POST",
|
31 |
headers: {
|
32 |
"Content-Type": "application/json",
|
|
|
53 |
}
|
54 |
|
55 |
return content
|
56 |
+
} else if (videoEngine === "VIDEO_HOTSHOT_XL_API_GRADIO") {
|
57 |
+
const res = await fetch(gradioApi + "api/predict", {
|
58 |
method: "POST",
|
59 |
headers: {
|
60 |
"Content-Type": "application/json",
|
|
|
65 |
fn_index: 0,
|
66 |
data: [
|
67 |
prompt,
|
68 |
+
lora,
|
69 |
+
size,
|
70 |
],
|
71 |
}),
|
72 |
cache: "no-store",
|