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 ·
ba2fff5
1
Parent(s): b55d430
fix path tourch
Browse files- depth_anything/dpt.py +2 -2
depth_anything/dpt.py
CHANGED
|
@@ -144,9 +144,9 @@ class DPT_DINOv2(nn.Module):
|
|
| 144 |
|
| 145 |
# in case the Internet connection is not stable, please load the DINOv2 locally
|
| 146 |
if localhub:
|
| 147 |
-
self.pretrained = torch.hub.load('torchhub/facebookresearch_dinov2_main', 'dinov2_{:}14'.format(encoder), source='local', pretrained=False)
|
| 148 |
else:
|
| 149 |
-
self.pretrained = torch.hub.load('facebookresearch/dinov2', 'dinov2_{:}14'.format(encoder))
|
| 150 |
|
| 151 |
dim = self.pretrained.blocks[0].attn.qkv.in_features
|
| 152 |
|
|
|
|
| 144 |
|
| 145 |
# in case the Internet connection is not stable, please load the DINOv2 locally
|
| 146 |
if localhub:
|
| 147 |
+
self.pretrained = torch.hub.load('../torchhub/facebookresearch_dinov2_main', 'dinov2_{:}14'.format(encoder), source='local', pretrained=False)
|
| 148 |
else:
|
| 149 |
+
self.pretrained = torch.hub.load('../facebookresearch/dinov2', 'dinov2_{:}14'.format(encoder))
|
| 150 |
|
| 151 |
dim = self.pretrained.blocks[0].attn.qkv.in_features
|
| 152 |
|