Instructions to use Charles-Elena/InstantID with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Diffusers
How to use Charles-Elena/InstantID with Diffusers:
pip install -U diffusers transformers accelerate
import torch from diffusers import DiffusionPipeline # switch to "mps" for apple devices pipe = DiffusionPipeline.from_pretrained("Charles-Elena/InstantID", dtype=torch.bfloat16, device_map="cuda") prompt = "Astronaut in a jungle, cold color palette, muted colors, detailed, 8k" image = pipe(prompt).images[0] - Notebooks
- Google Colab
- Kaggle
Commit ·
1f3c1e1
1
Parent(s): 4f37825
maybe
Browse files- handler.py +1 -2
handler.py
CHANGED
|
@@ -30,10 +30,9 @@ class EndpointHandler():
|
|
| 30 |
def __init__(self, model_dir):
|
| 31 |
|
| 32 |
print("Loading FaceAnalysis", model_dir)
|
| 33 |
-
self.app = FaceAnalysis(name="antelopev2", root="/repository/
|
| 34 |
self.app.prepare(ctx_id=0, det_size=(640, 640))
|
| 35 |
|
| 36 |
-
|
| 37 |
openpose = OpenposeDetector.from_pretrained("lllyasviel/ControlNet")
|
| 38 |
# depth_anything = DepthAnything.from_pretrained('LiheYoung/depth_anything_vitl14').to(device).eval()
|
| 39 |
|
|
|
|
| 30 |
def __init__(self, model_dir):
|
| 31 |
|
| 32 |
print("Loading FaceAnalysis", model_dir)
|
| 33 |
+
self.app = FaceAnalysis(name="antelopev2", root="/repository/antelopev2", providers=["CPUExecutionProvider"])
|
| 34 |
self.app.prepare(ctx_id=0, det_size=(640, 640))
|
| 35 |
|
|
|
|
| 36 |
openpose = OpenposeDetector.from_pretrained("lllyasviel/ControlNet")
|
| 37 |
# depth_anything = DepthAnything.from_pretrained('LiheYoung/depth_anything_vitl14').to(device).eval()
|
| 38 |
|