Instructions to use deepsafe/deepsafe-services with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Diffusers
How to use deepsafe/deepsafe-services with Diffusers:
pip install -U diffusers transformers accelerate
import torch from diffusers import DiffusionPipeline # switch to "mps" for apple devices pipe = DiffusionPipeline.from_pretrained("deepsafe/deepsafe-services", 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
sync from GitHub (5cbbb56)
Browse files
image/universal/requirements.txt
CHANGED
|
@@ -4,7 +4,8 @@ pillow
|
|
| 4 |
pydantic
|
| 5 |
numpy
|
| 6 |
# torch and torchvision installed separately in Dockerfile with CUDA support
|
| 7 |
-
# torch
|
| 8 |
-
#
|
|
|
|
| 9 |
ftfy
|
| 10 |
regex
|
|
|
|
| 4 |
pydantic
|
| 5 |
numpy
|
| 6 |
# torch and torchvision installed separately in Dockerfile with CUDA support
|
| 7 |
+
# DO NOT add torch or torchvision pins here -- they are installed with CUDA
|
| 8 |
+
# support in the Dockerfile. Adding torch==X here would downgrade the install.
|
| 9 |
+
torch>=2.5.1
|
| 10 |
ftfy
|
| 11 |
regex
|
video/dfd-fcg/app.py
CHANGED
|
@@ -156,7 +156,7 @@ def _load_models() -> None:
|
|
| 156 |
logger.info(
|
| 157 |
"Device: cuda (%s, %.1f GB VRAM)",
|
| 158 |
torch.cuda.get_device_name(0),
|
| 159 |
-
torch.cuda.get_device_properties(0).
|
| 160 |
/ 1024**3,
|
| 161 |
)
|
| 162 |
else:
|
|
@@ -288,7 +288,7 @@ def _gpu_health_info() -> dict:
|
|
| 288 |
torch.cuda.memory_allocated(0) / 1024**2
|
| 289 |
),
|
| 290 |
"vram_total_mb": round(
|
| 291 |
-
torch.cuda.get_device_properties(0).
|
| 292 |
/ 1024**2
|
| 293 |
),
|
| 294 |
}
|
|
|
|
| 156 |
logger.info(
|
| 157 |
"Device: cuda (%s, %.1f GB VRAM)",
|
| 158 |
torch.cuda.get_device_name(0),
|
| 159 |
+
torch.cuda.get_device_properties(0).total_memory
|
| 160 |
/ 1024**3,
|
| 161 |
)
|
| 162 |
else:
|
|
|
|
| 288 |
torch.cuda.memory_allocated(0) / 1024**2
|
| 289 |
),
|
| 290 |
"vram_total_mb": round(
|
| 291 |
+
torch.cuda.get_device_properties(0).total_memory
|
| 292 |
/ 1024**2
|
| 293 |
),
|
| 294 |
}
|
video/fake-stormer/Dockerfile
CHANGED
|
@@ -1,9 +1,10 @@
|
|
| 1 |
-
FROM pytorch/pytorch:1.
|
| 2 |
|
| 3 |
WORKDIR /app
|
| 4 |
|
| 5 |
-
#
|
| 6 |
-
RUN apt-
|
|
|
|
| 7 |
libgl1 \
|
| 8 |
libglib2.0-0 \
|
| 9 |
libsm6 \
|
|
|
|
| 1 |
+
FROM pytorch/pytorch:1.13.1-cuda11.6-cudnn8-devel
|
| 2 |
|
| 3 |
WORKDIR /app
|
| 4 |
|
| 5 |
+
# Fix potential GPG key issues on older CUDA base images
|
| 6 |
+
RUN (apt-key adv --fetch-keys https://developer.download.nvidia.com/compute/cuda/repos/ubuntu2004/x86_64/3bf863cc.pub 2>/dev/null || true) && \
|
| 7 |
+
apt-get update && apt-get install -y \
|
| 8 |
libgl1 \
|
| 9 |
libglib2.0-0 \
|
| 10 |
libsm6 \
|