jbilcke-hf HF staff commited on
Commit
ceb44b0
·
1 Parent(s): 2fadd62

unfortunately replicas are not gradio-friendly

Browse files
src/production/generateVideo.mts CHANGED
@@ -1,12 +1,12 @@
1
  import { client } from "@gradio/client"
2
 
3
  import { generateSeed } from "../utils/generateSeed.mts"
4
- import { raw } from "express";
5
 
 
6
  const instances: string[] = [
7
  `${process.env.VC_ZEROSCOPE_SPACE_API_URL_1 || ""}`,
8
- // `${process.env.VC_ZEROSCOPE_SPACE_API_URL_2 || ""}`,
9
- // `${process.env.VC_ZEROSCOPE_SPACE_API_URL_3 || ""}`,
10
  ].filter(instance => instance?.length > 0)
11
 
12
  export const generateVideo = async (prompt: string, options?: {
@@ -32,8 +32,8 @@ export const generateVideo = async (prompt: string, options?: {
32
  nbSteps, // 10, (numeric value between 10 and 50) in 'Number of inference steps' Slider component
33
  ]) as any
34
 
35
- console.log("rawResponse:", rawResponse)
36
-
37
  const { name } = rawResponse?.data?.[0]?.[0] as { name: string, orig_name: string }
38
 
39
  return `${instance}/file=${name}`
 
1
  import { client } from "@gradio/client"
2
 
3
  import { generateSeed } from "../utils/generateSeed.mts"
 
4
 
5
+ // we don't use replicas yet, because it ain't easy to get their hostname
6
  const instances: string[] = [
7
  `${process.env.VC_ZEROSCOPE_SPACE_API_URL_1 || ""}`,
8
+ `${process.env.VC_ZEROSCOPE_SPACE_API_URL_2 || ""}`,
9
+ `${process.env.VC_ZEROSCOPE_SPACE_API_URL_3 || ""}`,
10
  ].filter(instance => instance?.length > 0)
11
 
12
  export const generateVideo = async (prompt: string, options?: {
 
32
  nbSteps, // 10, (numeric value between 10 and 50) in 'Number of inference steps' Slider component
33
  ]) as any
34
 
35
+ // console.log("rawResponse:", rawResponse)
36
+
37
  const { name } = rawResponse?.data?.[0]?.[0] as { name: string, orig_name: string }
38
 
39
  return `${instance}/file=${name}`
src/utils/segmentImage.mts CHANGED
@@ -4,6 +4,7 @@ import { sleep } from "./sleep.mts"
4
  import { ImageSegment } from "../types.mts"
5
  import { downloadImageAsBase64 } from "./downloadFileAsBase64.mts"
6
 
 
7
  const instances: string[] = [
8
  `${process.env.VC_SEGMENTATION_MODULE_SPACE_API_URL_1 || ""}`,
9
  `${process.env.VC_SEGMENTATION_MODULE_SPACE_API_URL_2 || ""}`,
 
4
  import { ImageSegment } from "../types.mts"
5
  import { downloadImageAsBase64 } from "./downloadFileAsBase64.mts"
6
 
7
+ // we don't use replicas yet, because it ain't easy to get their hostname
8
  const instances: string[] = [
9
  `${process.env.VC_SEGMENTATION_MODULE_SPACE_API_URL_1 || ""}`,
10
  `${process.env.VC_SEGMENTATION_MODULE_SPACE_API_URL_2 || ""}`,