fffiloni commited on
Commit
f56ed08
1 Parent(s): f56fa59

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +5 -1
app.py CHANGED
@@ -1,8 +1,11 @@
1
  import gradio as gr
2
  from gradio_client import Client
 
 
 
3
 
4
  def get_instantID(portrait_in, prompt):
5
- client = Client("https://instantx-instantid.hf.space/")
6
  negative_prompt = "(lowres, low quality, worst quality:1.2), (text:1.2), watermark, (frame:1.2), deformed, ugly, deformed eyes, blur, out of focus, blurry, deformed cat, deformed, photo, anthropomorphic cat, monochrome, photo, pet collar, gun, weapon, blue, 3d, drones, drone, buildings in background, green"
7
  result = client.predict(
8
  portrait_in, # filepath in 'Upload a photo of your face' Image component
@@ -16,6 +19,7 @@ def get_instantID(portrait_in, prompt):
16
  0.8, # float (numeric value between 0 and 1.5) in 'Image adapter strength (for detail)' Slider component
17
  5, # float (numeric value between 0.1 and 10.0) in 'Guidance scale' Slider component
18
  0, # float (numeric value between 0 and 2147483647) in 'Seed' Slider component
 
19
  api_name="/generate_image"
20
  )
21
  print(result)
 
1
  import gradio as gr
2
  from gradio_client import Client
3
+ import os
4
+
5
+ ht_token = os.environ.get("HF_TKN")
6
 
7
  def get_instantID(portrait_in, prompt):
8
+ client = Client("https://fffiloni-instantid.hf.space/", hf_token=hf_token)
9
  negative_prompt = "(lowres, low quality, worst quality:1.2), (text:1.2), watermark, (frame:1.2), deformed, ugly, deformed eyes, blur, out of focus, blurry, deformed cat, deformed, photo, anthropomorphic cat, monochrome, photo, pet collar, gun, weapon, blue, 3d, drones, drone, buildings in background, green"
10
  result = client.predict(
11
  portrait_in, # filepath in 'Upload a photo of your face' Image component
 
19
  0.8, # float (numeric value between 0 and 1.5) in 'Image adapter strength (for detail)' Slider component
20
  5, # float (numeric value between 0.1 and 10.0) in 'Guidance scale' Slider component
21
  0, # float (numeric value between 0 and 2147483647) in 'Seed' Slider component
22
+ True, # bool in 'Randomize seed' Checkbox component
23
  api_name="/generate_image"
24
  )
25
  print(result)