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 ·
255eb78
1
Parent(s): c3fb099
wokring with buffalo_l
Browse files- handler.py +6 -8
handler.py
CHANGED
|
@@ -141,15 +141,13 @@ class EndpointHandler():
|
|
| 141 |
# "depth": get_depth_map,
|
| 142 |
}
|
| 143 |
|
| 144 |
-
model_pack_name = 'antelopev2'
|
| 145 |
-
self.app = FaceAnalysis(allowed_modules=['detection', 'recognition'],name=model_pack_name)
|
| 146 |
-
self.app.prepare(ctx_id=0, det_size=(640, 640))
|
| 147 |
-
|
| 148 |
-
|
| 149 |
-
# self.app = FaceAnalysis(name="buffalo_l", root="./", providers=["CPUExecutionProvider"])
|
| 150 |
# con 512 funciona bien
|
| 151 |
-
|
| 152 |
-
|
| 153 |
self.generator = torch.Generator(device=device).manual_seed(42)
|
| 154 |
|
| 155 |
|
|
|
|
| 141 |
# "depth": get_depth_map,
|
| 142 |
}
|
| 143 |
|
| 144 |
+
# model_pack_name = 'antelopev2'
|
| 145 |
+
# self.app = FaceAnalysis(allowed_modules=['detection', 'recognition'],name=model_pack_name)
|
| 146 |
+
# self.app.prepare(ctx_id=0, det_size=(640, 640))
|
| 147 |
+
|
| 148 |
+
self.app = FaceAnalysis(name="buffalo_l", root="./", providers=["CPUExecutionProvider"])
|
|
|
|
| 149 |
# con 512 funciona bien
|
| 150 |
+
self.app.prepare(ctx_id=0, det_size=(640, 640))
|
|
|
|
| 151 |
self.generator = torch.Generator(device=device).manual_seed(42)
|
| 152 |
|
| 153 |
|