Instructions to use InstantX/InstantID with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Diffusers
How to use InstantX/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("InstantX/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
- Local Apps
- Draw Things
- DiffusionBee
Update README.md
Browse files
README.md
CHANGED
|
@@ -79,7 +79,8 @@ Then, you can customized your own face images
|
|
| 79 |
image = load_image("your-example.jpg")
|
| 80 |
|
| 81 |
# prepare face emb
|
| 82 |
-
face_info = app.get(cv2.cvtColor(np.array(face_image), cv2.COLOR_RGB2BGR))
|
|
|
|
| 83 |
face_emb = face_info['embedding']
|
| 84 |
face_kps = draw_kps(face_image, face_info['kps'])
|
| 85 |
|
|
|
|
| 79 |
image = load_image("your-example.jpg")
|
| 80 |
|
| 81 |
# prepare face emb
|
| 82 |
+
face_info = app.get(cv2.cvtColor(np.array(face_image), cv2.COLOR_RGB2BGR))
|
| 83 |
+
face_info = sorted(face_info, key=lambda x:(x['bbox'][2]-x['bbox'][0])*x['bbox'][3]-x['bbox'][1])[-1] # only use the maximum face
|
| 84 |
face_emb = face_info['embedding']
|
| 85 |
face_kps = draw_kps(face_image, face_info['kps'])
|
| 86 |
|