jbilcke-hf HF staff commited on
Commit
223236c
β€’
1 Parent(s): 5c5e659

before the lora, let's make the base system work properly

Browse files
.env CHANGED
@@ -3,7 +3,7 @@
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
 
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_FFFILONI"
7
 
8
  # the official API developed by the Hotshot-XL team
9
  # note: it isn't released yet
src/app/layout.tsx CHANGED
@@ -10,9 +10,10 @@ export const metadata: Metadata = {
10
  // giffer
11
  // gipher
12
  // GIF Factory
13
- // GIF Migic
14
- title: 'AI GIF Genie 🧞',
15
- description: 'AI GIF Genie 🧞',
 
16
  }
17
 
18
  export default function RootLayout({
 
10
  // giffer
11
  // gipher
12
  // GIF Factory
13
+ // GIF Magic
14
+ // AI GIF Genie
15
+ title: 'Hotshot-XL Text-to-GIF 🧞',
16
+ description: 'Hotshot-XL Text-to-GIF 🧞',
17
  }
18
 
19
  export default function RootLayout({
src/app/page.tsx CHANGED
@@ -20,6 +20,7 @@ export default function Page() {
20
  </Head>
21
  <main className={cn(
22
  `light text-cyan-900`,
 
23
  `bg-gradient-to-r from-cyan-500 to-blue-400`,
24
  )}>
25
  {isLoaded && <Main />}
 
20
  </Head>
21
  <main className={cn(
22
  `light text-cyan-900`,
23
+ // `bg-gradient-to-r from-green-500 to-yellow-400`,
24
  `bg-gradient-to-r from-cyan-500 to-blue-400`,
25
  )}>
26
  {isLoaded && <Main />}
src/app/server/actions/animation.ts CHANGED
@@ -54,35 +54,36 @@ export async function generateAnimation({
54
 
55
  return content
56
  } else if (videoEngine === "VIDEO_HOTSHOT_XL_API_FFFILONI") {
57
- const res = await fetch(jbilckeApi, {
58
  method: "POST",
59
  headers: {
60
  "Content-Type": "application/json",
61
  // access isn't secured for now, the free lunch is open
62
  // Authorization: `Bearer ${token}`,
63
  },
64
- body: JSON.stringify([
65
- 0,
66
- prompt,
67
- // lora, // not supported
68
- // size,
69
- ]),
 
 
70
  cache: "no-store",
71
  // we can also use this (see https://vercel.com/blog/vercel-cache-api-nextjs-cache)
72
  // next: { revalidate: 1 }
73
  })
74
- console.log("res:", res)
75
 
76
- const content = await res.text()
77
- console.log("content:", content)
78
 
79
  // Recommendation: handle errors
80
  if (res.status !== 200) {
81
- console.error(content)
82
  // This will activate the closest `error.js` Error Boundary
83
  throw new Error('Failed to fetch data')
84
  }
 
85
 
 
86
  } else {
87
  throw new Error(`not implemented yet!`)
88
  }
 
54
 
55
  return content
56
  } else if (videoEngine === "VIDEO_HOTSHOT_XL_API_FFFILONI") {
57
+ const res = await fetch(fffiloniApi + "api/predict", {
58
  method: "POST",
59
  headers: {
60
  "Content-Type": "application/json",
61
  // access isn't secured for now, the free lunch is open
62
  // Authorization: `Bearer ${token}`,
63
  },
64
+ body: JSON.stringify({
65
+ fn_index: 0,
66
+ data: [
67
+ prompt,
68
+ // lora, // not supported
69
+ // size, // not supported
70
+ ],
71
+ }),
72
  cache: "no-store",
73
  // we can also use this (see https://vercel.com/blog/vercel-cache-api-nextjs-cache)
74
  // next: { revalidate: 1 }
75
  })
 
76
 
77
+ const { data } = await res.json()
 
78
 
79
  // Recommendation: handle errors
80
  if (res.status !== 200) {
 
81
  // This will activate the closest `error.js` Error Boundary
82
  throw new Error('Failed to fetch data')
83
  }
84
+ // console.log("data:", data.slice(0, 50))
85
 
86
+ return data
87
  } else {
88
  throw new Error(`not implemented yet!`)
89
  }