Spaces:
Running
Running
Update app.py
Browse files
app.py
CHANGED
@@ -4,12 +4,12 @@ import os
|
|
4 |
|
5 |
hf_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
|
12 |
-
|
13 |
prompt, # str in 'Prompt' Textbox component
|
14 |
negative_prompt, # str in 'Negative Prompt' Textbox component
|
15 |
"(No style)", # Literal['(No style)', 'Watercolor', 'Film Noir', 'Neon', 'Jungle', 'Mars', 'Vibrant Color', 'Snow', 'Line art'] in 'Style template' Dropdown component
|
@@ -44,7 +44,8 @@ def infer(image_in, prompt):
|
|
44 |
gr.Interface(
|
45 |
fn = infer,
|
46 |
inputs = [
|
47 |
-
gr.Image(type="filepath"),
|
|
|
48 |
gr.Textbox()
|
49 |
],
|
50 |
outputs = [
|
|
|
4 |
|
5 |
hf_token = os.environ.get("HF_TKN")
|
6 |
|
7 |
+
def get_instantID(portrait_in, condition_pose, 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
|
12 |
+
condition_pose, # filepath in 'Upload a reference pose image (optional)' Image component
|
13 |
prompt, # str in 'Prompt' Textbox component
|
14 |
negative_prompt, # str in 'Negative Prompt' Textbox component
|
15 |
"(No style)", # Literal['(No style)', 'Watercolor', 'Film Noir', 'Neon', 'Jungle', 'Mars', 'Vibrant Color', 'Snow', 'Line art'] in 'Style template' Dropdown component
|
|
|
44 |
gr.Interface(
|
45 |
fn = infer,
|
46 |
inputs = [
|
47 |
+
gr.Image(type="filepath", label="Face to copy"),
|
48 |
+
gr.Image(type="filepath", label="Conditional pose (Optional) ")
|
49 |
gr.Textbox()
|
50 |
],
|
51 |
outputs = [
|