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 (28464ab)
Browse files- image/universal/Dockerfile +15 -12
image/universal/Dockerfile
CHANGED
|
@@ -1,20 +1,23 @@
|
|
| 1 |
-
FROM
|
|
|
|
|
|
|
|
|
|
| 2 |
|
| 3 |
WORKDIR /app
|
| 4 |
|
| 5 |
-
|
| 6 |
-
|
| 7 |
-
|
| 8 |
-
apt-get clean && \
|
| 9 |
-
rm -rf /var/lib/apt/lists/*
|
| 10 |
|
| 11 |
-
|
| 12 |
-
COPY requirements.txt .
|
| 13 |
|
| 14 |
-
# Install
|
| 15 |
-
|
| 16 |
-
|
| 17 |
-
|
|
|
|
|
|
|
|
|
|
| 18 |
|
| 19 |
# Copy application code
|
| 20 |
COPY app.py .
|
|
|
|
| 1 |
+
FROM nvidia/cuda:12.1.1-cudnn8-runtime-ubuntu22.04
|
| 2 |
+
|
| 3 |
+
ENV DEBIAN_FRONTEND=noninteractive
|
| 4 |
+
ENV PYTHONUNBUFFERED=1
|
| 5 |
|
| 6 |
WORKDIR /app
|
| 7 |
|
| 8 |
+
RUN apt-get update && apt-get install -y --no-install-recommends \
|
| 9 |
+
python3 python3-pip git wget \
|
| 10 |
+
&& rm -rf /var/lib/apt/lists/*
|
|
|
|
|
|
|
| 11 |
|
| 12 |
+
RUN ln -sf /usr/bin/python3 /usr/bin/python
|
|
|
|
| 13 |
|
| 14 |
+
# Install PyTorch with CUDA 12.1 (upgraded from 1.11/CUDA 11.3 for Blackwell support)
|
| 15 |
+
RUN pip install --no-cache-dir \
|
| 16 |
+
torch==2.5.1 torchvision==0.20.1 \
|
| 17 |
+
--index-url https://download.pytorch.org/whl/cu121
|
| 18 |
+
|
| 19 |
+
COPY requirements.txt .
|
| 20 |
+
RUN pip install --no-cache-dir -r requirements.txt
|
| 21 |
|
| 22 |
# Copy application code
|
| 23 |
COPY app.py .
|