Spaces:
Running
Running
Commit ·
2639b50
1
Parent(s): 40a2712
fixed building errors.
Browse files- .gitignore +1 -0
- app.py +6 -6
- requirements.txt +1 -1
.gitignore
CHANGED
|
@@ -1,5 +1,6 @@
|
|
| 1 |
|
| 2 |
*.pyc
|
| 3 |
*.local
|
|
|
|
| 4 |
|
| 5 |
gradio_cached_examples/
|
|
|
|
| 1 |
|
| 2 |
*.pyc
|
| 3 |
*.local
|
| 4 |
+
*.local.*
|
| 5 |
|
| 6 |
gradio_cached_examples/
|
app.py
CHANGED
|
@@ -358,7 +358,7 @@ def generate_image (
|
|
| 358 |
#print('novita_key:', novita_key1)
|
| 359 |
#print('face_image_path:', face_image_path)
|
| 360 |
if not novita_key1:
|
| 361 |
-
raise gr.Error(f'Please input your
|
| 362 |
try:
|
| 363 |
client = get_novita_client(novita_key1)
|
| 364 |
prompt, negative_prompt = apply_style(style_name, prompt, negative_prompt)
|
|
@@ -497,14 +497,14 @@ def get_payload (
|
|
| 497 |
|
| 498 |
# Description
|
| 499 |
title = r'''
|
| 500 |
-
<h1 align="center">InstantID: Zero-shot Identity-Preserving Generation in Seconds (via
|
| 501 |
'''
|
| 502 |
|
| 503 |
description = r'''
|
| 504 |
-
<a href='https://github.com/InstantID/InstantID' target="_blank"><b>InstantID</b></a> demo via <a href="https://novita.ai/" target="_blank"><b>
|
| 505 |
|
| 506 |
How to use:<br>
|
| 507 |
-
0. Input your <a href="https://novita.ai/dashboard/key" target="_blank"><b>
|
| 508 |
1. Upload an image with a face. For images with multiple faces, we will only detect the largest face. Ensure the face is not too small and is clearly visible without significant obstructions or blurring.
|
| 509 |
2. (Optional) You can upload another image as a reference for the face pose. If you don't, we will use the first detected face image to extract facial landmarks. If you use a cropped face at step 1, it is recommended to upload it to define a new face pose.
|
| 510 |
3. (Optional) You can select multiple ControlNet models to control the generation process. The default is to use the IdentityNet only. The ControlNet models include pose skeleton, canny, and depth. You can adjust the strength of each ControlNet model to control the generation process.
|
|
@@ -534,7 +534,7 @@ with gr.Blocks(css=css) as demo:
|
|
| 534 |
|
| 535 |
with gr.Row():
|
| 536 |
with gr.Column(scale=1):
|
| 537 |
-
novita_key = gr.Textbox(value='', label='Novita.AI API KEY', placeholder='
|
| 538 |
with gr.Column(scale=1):
|
| 539 |
user_balance = gr.Textbox(label='User Balance', value='0.0')
|
| 540 |
|
|
@@ -683,7 +683,7 @@ with gr.Blocks(css=css) as demo:
|
|
| 683 |
label='InstantID Usage Tips', value=tips, visible=False
|
| 684 |
)
|
| 685 |
|
| 686 |
-
api_payload = gr.JSON(label="
|
| 687 |
|
| 688 |
submit.click(
|
| 689 |
fn=remove_tips,
|
|
|
|
| 358 |
#print('novita_key:', novita_key1)
|
| 359 |
#print('face_image_path:', face_image_path)
|
| 360 |
if not novita_key1:
|
| 361 |
+
raise gr.Error(f'Please input your API Key!')
|
| 362 |
try:
|
| 363 |
client = get_novita_client(novita_key1)
|
| 364 |
prompt, negative_prompt = apply_style(style_name, prompt, negative_prompt)
|
|
|
|
| 497 |
|
| 498 |
# Description
|
| 499 |
title = r'''
|
| 500 |
+
<h1 align="center">InstantID: Zero-shot Identity-Preserving Generation in Seconds (via a model API)</h1>
|
| 501 |
'''
|
| 502 |
|
| 503 |
description = r'''
|
| 504 |
+
<a href='https://github.com/InstantID/InstantID' target="_blank"><b>InstantID</b></a> demo via <a href="https://novita.ai/" target="_blank"><b>API</b></a>.<br>
|
| 505 |
|
| 506 |
How to use:<br>
|
| 507 |
+
0. Input your <a href="https://novita.ai/dashboard/key" target="_blank"><b>API Key</b></a>.
|
| 508 |
1. Upload an image with a face. For images with multiple faces, we will only detect the largest face. Ensure the face is not too small and is clearly visible without significant obstructions or blurring.
|
| 509 |
2. (Optional) You can upload another image as a reference for the face pose. If you don't, we will use the first detected face image to extract facial landmarks. If you use a cropped face at step 1, it is recommended to upload it to define a new face pose.
|
| 510 |
3. (Optional) You can select multiple ControlNet models to control the generation process. The default is to use the IdentityNet only. The ControlNet models include pose skeleton, canny, and depth. You can adjust the strength of each ControlNet model to control the generation process.
|
|
|
|
| 534 |
|
| 535 |
with gr.Row():
|
| 536 |
with gr.Column(scale=1):
|
| 537 |
+
novita_key = gr.Textbox(value='', label='Novita.AI API KEY', placeholder='api key', type='password')
|
| 538 |
with gr.Column(scale=1):
|
| 539 |
user_balance = gr.Textbox(label='User Balance', value='0.0')
|
| 540 |
|
|
|
|
| 683 |
label='InstantID Usage Tips', value=tips, visible=False
|
| 684 |
)
|
| 685 |
|
| 686 |
+
api_payload = gr.JSON(label="API Payload, POST /v3/async/instant-id")
|
| 687 |
|
| 688 |
submit.click(
|
| 689 |
fn=remove_tips,
|
requirements.txt
CHANGED
|
@@ -1,2 +1,2 @@
|
|
| 1 |
novita_client==0.5.3
|
| 2 |
-
gradio==4.
|
|
|
|
| 1 |
novita_client==0.5.3
|
| 2 |
+
gradio==4.19.2
|