Spaces:
Running
Running
Update app.py
Browse files
app.py
CHANGED
|
@@ -4,6 +4,10 @@ import os
|
|
| 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"
|
|
@@ -99,11 +103,12 @@ with gr.Blocks(css=css) as demo:
|
|
| 99 |
Generate live camera shot from input face
|
| 100 |
</p>
|
| 101 |
""")
|
| 102 |
-
|
| 103 |
-
|
| 104 |
-
|
| 105 |
-
|
| 106 |
-
|
|
|
|
| 107 |
camera_shot = gr.Dropdown(
|
| 108 |
label = "Camera Shot",
|
| 109 |
info = "Use standard camera shots vocabulary, or drop your custom shot as conditional pose (1280*720 ratio is recommended)",
|
|
@@ -112,10 +117,12 @@ with gr.Blocks(css=css) as demo:
|
|
| 112 |
],
|
| 113 |
value = "custom"
|
| 114 |
)
|
| 115 |
-
|
| 116 |
-
|
| 117 |
-
|
| 118 |
-
|
|
|
|
|
|
|
| 119 |
with gr.Column():
|
| 120 |
submit_btn = gr.Button("Submit")
|
| 121 |
video_out = gr.Video()
|
|
|
|
| 4 |
|
| 5 |
hf_token = os.environ.get("HF_TKN")
|
| 6 |
|
| 7 |
+
from style_template import styles
|
| 8 |
+
STYLE_NAMES = list(styles.keys())
|
| 9 |
+
DEFAULT_STYLE_NAME = "Watercolor"
|
| 10 |
+
|
| 11 |
def get_instantID(portrait_in, condition_pose, prompt):
|
| 12 |
client = Client("https://fffiloni-instantid.hf.space/", hf_token=hf_token)
|
| 13 |
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"
|
|
|
|
| 103 |
Generate live camera shot from input face
|
| 104 |
</p>
|
| 105 |
""")
|
| 106 |
+
|
| 107 |
+
with gr.Row():
|
| 108 |
+
with gr.Column():
|
| 109 |
+
face_in = gr.Image(type="filepath", label="Face to copy")
|
| 110 |
+
with gr.Column():
|
| 111 |
+
with gr.Row():
|
| 112 |
camera_shot = gr.Dropdown(
|
| 113 |
label = "Camera Shot",
|
| 114 |
info = "Use standard camera shots vocabulary, or drop your custom shot as conditional pose (1280*720 ratio is recommended)",
|
|
|
|
| 117 |
],
|
| 118 |
value = "custom"
|
| 119 |
)
|
| 120 |
+
style = gr.Dropdown(label="Style template", choices=STYLE_NAMES, value=DEFAULT_STYLE_NAME)
|
| 121 |
+
|
| 122 |
+
condition_shot = gr.Image(type="filepath", label="Custom conditional shot (Optional)")
|
| 123 |
+
prompt = gr.Textbox(label="Prompt")
|
| 124 |
+
chosen_model = gr.Radio(label="Choose a model", choices=["i2vgen-xl", "stable-video"], value="i2vgen-xl", interactive=False, visible=False)
|
| 125 |
+
|
| 126 |
with gr.Column():
|
| 127 |
submit_btn = gr.Button("Submit")
|
| 128 |
video_out = gr.Video()
|