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 ·
2dfba3e
1
Parent(s): e181ddf
test
Browse files- .DS_Store +0 -0
- handler.py +2 -2
.DS_Store
CHANGED
|
Binary files a/.DS_Store and b/.DS_Store differ
|
|
|
handler.py
CHANGED
|
@@ -62,7 +62,7 @@ class EndpointHandler():
|
|
| 62 |
controlnet_path = f"./checkpoints/ControlNetModel"
|
| 63 |
|
| 64 |
# Load pipeline face ControlNetModel
|
| 65 |
-
controlnet_identitynet = ControlNetModel.from_pretrained(
|
| 66 |
controlnet_path, torch_dtype=dtype
|
| 67 |
)
|
| 68 |
|
|
@@ -96,7 +96,7 @@ class EndpointHandler():
|
|
| 96 |
|
| 97 |
self.pipe = StableDiffusionXLInstantIDPipeline.from_pretrained(
|
| 98 |
pretrained_model_name_or_path,
|
| 99 |
-
controlnet=[controlnet_identitynet],
|
| 100 |
torch_dtype=dtype,
|
| 101 |
safety_checker=None,
|
| 102 |
feature_extractor=None,
|
|
|
|
| 62 |
controlnet_path = f"./checkpoints/ControlNetModel"
|
| 63 |
|
| 64 |
# Load pipeline face ControlNetModel
|
| 65 |
+
self.controlnet_identitynet = ControlNetModel.from_pretrained(
|
| 66 |
controlnet_path, torch_dtype=dtype
|
| 67 |
)
|
| 68 |
|
|
|
|
| 96 |
|
| 97 |
self.pipe = StableDiffusionXLInstantIDPipeline.from_pretrained(
|
| 98 |
pretrained_model_name_or_path,
|
| 99 |
+
controlnet=[self.controlnet_identitynet],
|
| 100 |
torch_dtype=dtype,
|
| 101 |
safety_checker=None,
|
| 102 |
feature_extractor=None,
|