jbilcke-hf HF staff commited on
Commit
8f35fb6
1 Parent(s): 9a42933

try to manage the overlap between the various APIs

Browse files
Files changed (2) hide show
  1. .env +18 -1
  2. src/app/server/actions/animation.ts +8 -2
.env CHANGED
@@ -1 +1,18 @@
1
- HF_HOTSHOT_XL_API_URL="https://jbilcke-hf-hotshot-xl-api.hf.space/"
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+
2
+ # TODO: those could be
3
+ # VIDEO_HOTSHOT_XL_API_OFFICIAL
4
+ # VIDEO_HOTSHOT_XL_API_JBILCKE
5
+ # VIDEO_HOTSHOT_XL_API_FFFILONI
6
+ VIDEO_ENGINE="VIDEO_HOTSHOT_XL_API_JBILCKE"
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
+ VIDEO_HOTSHOT_XL_API_JBILCKE="https://jbilcke-hf-hotshot-xl-api.hf.space/"
15
+
16
+ # the Gradio Space (with the auto API) developed by @fffiloni
17
+ # note: just released
18
+ VIDEO_HOTSHOT_XL_API_FFFILONI="https://fffiloni-text-to-gif.hf.space/"
src/app/server/actions/animation.ts CHANGED
@@ -2,7 +2,11 @@
2
 
3
  import { ImageInferenceSize } from "@/types"
4
 
5
- const hotshotApiUrl = `${process.env.HF_HOTSHOT_XL_API_URL || ""}`
 
 
 
 
6
 
7
  export async function generateAnimation({
8
  prompt,
@@ -18,7 +22,9 @@ export async function generateAnimation({
18
  }
19
 
20
  try {
21
- const res = await fetch(hotshotApiUrl, {
 
 
22
  method: "POST",
23
  headers: {
24
  "Content-Type": "application/json",
 
2
 
3
  import { ImageInferenceSize } from "@/types"
4
 
5
+ const videoEngine = `${process.env.VIDEO_ENGINE || ""}`
6
+
7
+ const officialApi = `${process.env.VIDEO_HOTSHOT_XL_API_OFFICIAL || ""}`
8
+ const jbilckeApi = `${process.env.VIDEO_HOTSHOT_XL_API_JBILCKE || ""}`
9
+ const fffiloniApi = `${process.env.VIDEO_HOTSHOT_XL_API_FFFILONI || ""}`
10
 
11
  export async function generateAnimation({
12
  prompt,
 
22
  }
23
 
24
  try {
25
+ // TODO: support other API to avoid duplicate work?
26
+ // (are the other API supporting custom LoRAs?)
27
+ const res = await fetch(jbilckeApi, {
28
  method: "POST",
29
  headers: {
30
  "Content-Type": "application/json",