jbilcke-hf HF staff commited on
Commit
bd74bd1
1 Parent(s): 80175c8

update keys

Browse files
Files changed (2) hide show
  1. .env +14 -0
  2. src/app/interface/generate/index.tsx +21 -4
.env CHANGED
@@ -24,3 +24,17 @@ VIDEO_HOTSHOT_XL_API_GRADIO="https://jbilcke-hf-hotshot-xl-server-1.hf.space"
24
  # If you decided to use Replicate for the RENDERING engine
25
  VIDEO_HOTSHOT_XL_API_REPLICATE_MODEL="cloneofsimo/hotshot-xl-lora-controlnet"
26
  VIDEO_HOTSHOT_XL_API_REPLICATE_MODEL_VERSION="75e26ffd033a59a78954a3d675632f47f7f8470402aec51c255b9f9b7b62568b"
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
24
  # If you decided to use Replicate for the RENDERING engine
25
  VIDEO_HOTSHOT_XL_API_REPLICATE_MODEL="cloneofsimo/hotshot-xl-lora-controlnet"
26
  VIDEO_HOTSHOT_XL_API_REPLICATE_MODEL_VERSION="75e26ffd033a59a78954a3d675632f47f7f8470402aec51c255b9f9b7b62568b"
27
+
28
+ # ----------- CENSORSHIP -------
29
+ ENABLE_CENSORSHIP=""
30
+ FINGERPRINT_KEY=""
31
+ MODERATION_KEY=""
32
+
33
+ # ----------- COMMUNITY (OPTIONAL, YOU DON'T NEED THIS IN LOCAL) -----------
34
+ NEXT_PUBLIC_ENABLE_COMMUNITY_SHARING="false"
35
+
36
+ COMMUNITY_API_URL="https://jbilcke-hf-community.hf.space"
37
+ COMMUNITY_API_TOKEN=""
38
+
39
+ # must be unique per app
40
+ COMMUNITY_APP_ID=""
src/app/interface/generate/index.tsx CHANGED
@@ -2,6 +2,7 @@
2
 
3
  import { useState, useTransition } from "react"
4
  import { useSpring, animated } from "@react-spring/web"
 
5
 
6
  import { cn } from "@/lib/utils"
7
  import { headingFont } from "@/app/interface/fonts"
@@ -12,6 +13,9 @@ import { useCountdown } from "@/lib/useCountdown"
12
  import { Countdown } from "../countdown"
13
 
14
  export function Generate() {
 
 
 
15
  const [_isPending, startTransition] = useTransition()
16
 
17
  const [isLocked, setLocked] = useState(false)
@@ -92,11 +96,20 @@ export function Generate() {
92
  setAssetUrl(newAssetUrl)
93
 
94
  try {
95
- await postToCommunity({
96
  prompt: promptDraft,
97
  model: huggingFaceLora,
98
  assetUrl: newAssetUrl,
99
  })
 
 
 
 
 
 
 
 
 
100
  } catch (err) {
101
  console.error(`not a blocked, but we failed to post to the community (reason: ${err})`)
102
  }
@@ -241,17 +254,21 @@ export function Generate() {
241
  {isLocked ? "Generating.." : "Generate"}
242
  </animated.button>
243
  </div>
 
 
 
244
  </div>
245
- {/*
246
- Put community creations here, this may get wild though.
247
  <div>
 
 
248
  <div>A</div>
249
  <div>B</div>
250
  <div>C</div>
251
  <div>D</div>
252
  <div>E</div>
253
  </div>
254
- */}
255
  </div>
256
  </div>
257
  </div>
 
2
 
3
  import { useState, useTransition } from "react"
4
  import { useSpring, animated } from "@react-spring/web"
5
+ import { usePathname, useRouter, useSearchParams } from "next/navigation"
6
 
7
  import { cn } from "@/lib/utils"
8
  import { headingFont } from "@/app/interface/fonts"
 
13
  import { Countdown } from "../countdown"
14
 
15
  export function Generate() {
16
+ const router = useRouter()
17
+ const pathname = usePathname()
18
+ const searchParams = useSearchParams()
19
  const [_isPending, startTransition] = useTransition()
20
 
21
  const [isLocked, setLocked] = useState(false)
 
96
  setAssetUrl(newAssetUrl)
97
 
98
  try {
99
+ const post = await postToCommunity({
100
  prompt: promptDraft,
101
  model: huggingFaceLora,
102
  assetUrl: newAssetUrl,
103
  })
104
+ console.log("successfully submitted to the community!", post)
105
+
106
+ // now you got a read/write object
107
+ const current = new URLSearchParams(Array.from(searchParams.entries()))
108
+ current.set("postId", post.postId)
109
+ current.set("prompt", post.prompt)
110
+ current.set("model", post.model)
111
+ const search = current.toString()
112
+ router.push(`${pathname}${search ? `?${search}` : ""}`)
113
  } catch (err) {
114
  console.error(`not a blocked, but we failed to post to the community (reason: ${err})`)
115
  }
 
254
  {isLocked ? "Generating.." : "Generate"}
255
  </animated.button>
256
  </div>
257
+ <div>
258
+ Pick a model..
259
+ </div>
260
  </div>
261
+
 
262
  <div>
263
+ <p>Community creations</p>
264
+ <div>
265
  <div>A</div>
266
  <div>B</div>
267
  <div>C</div>
268
  <div>D</div>
269
  <div>E</div>
270
  </div>
271
+ </div>
272
  </div>
273
  </div>
274
  </div>