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 (81cf3c3)
Browse files- image/fsd/Dockerfile +11 -12
- video/fake-stormer/Dockerfile +2 -0
image/fsd/Dockerfile
CHANGED
|
@@ -5,20 +5,15 @@ ENV PYTHONUNBUFFERED=1
|
|
| 5 |
|
| 6 |
WORKDIR /app
|
| 7 |
|
| 8 |
-
#
|
| 9 |
RUN apt-get update && apt-get install -y --no-install-recommends \
|
| 10 |
-
|
| 11 |
-
&& add-apt-repository -y ppa:deadsnakes/ppa \
|
| 12 |
-
&& apt-get update \
|
| 13 |
-
&& apt-get install -y --no-install-recommends \
|
| 14 |
-
python3.12 python3.12-dev python3.12-venv python3.12-distutils \
|
| 15 |
git wget \
|
| 16 |
&& rm -rf /var/lib/apt/lists/*
|
| 17 |
|
| 18 |
-
RUN ln -sf /usr/bin/python3
|
| 19 |
-
|
| 20 |
-
|
| 21 |
-
python3 -m pip install --upgrade pip
|
| 22 |
|
| 23 |
# Clone the FSD repo
|
| 24 |
RUN git clone https://github.com/ductai199x/Forensic-Self-Descriptions-CVPR25.git model_code
|
|
@@ -37,8 +32,12 @@ RUN pip install --no-cache-dir \
|
|
| 37 |
tqdm \
|
| 38 |
"scikit-learn>=1.6.0"
|
| 39 |
|
| 40 |
-
# Install FSD package
|
| 41 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
| 42 |
|
| 43 |
# Install service-layer deps
|
| 44 |
COPY requirements.txt .
|
|
|
|
| 5 |
|
| 6 |
WORKDIR /app
|
| 7 |
|
| 8 |
+
# System deps (using Python 3.10 from Ubuntu -- bypassing model_code's >=3.12 constraint)
|
| 9 |
RUN apt-get update && apt-get install -y --no-install-recommends \
|
| 10 |
+
python3 python3-pip python3-dev \
|
|
|
|
|
|
|
|
|
|
|
|
|
| 11 |
git wget \
|
| 12 |
&& rm -rf /var/lib/apt/lists/*
|
| 13 |
|
| 14 |
+
RUN ln -sf /usr/bin/python3 /usr/bin/python
|
| 15 |
+
|
| 16 |
+
RUN pip install --no-cache-dir --upgrade pip setuptools wheel
|
|
|
|
| 17 |
|
| 18 |
# Clone the FSD repo
|
| 19 |
RUN git clone https://github.com/ductai199x/Forensic-Self-Descriptions-CVPR25.git model_code
|
|
|
|
| 32 |
tqdm \
|
| 33 |
"scikit-learn>=1.6.0"
|
| 34 |
|
| 35 |
+
# Install FSD package: bypass both deps AND python-requires check
|
| 36 |
+
# The model_code requires Python >=3.12 but works fine on 3.10
|
| 37 |
+
RUN pip install --no-deps --no-build-isolation -e ./model_code 2>/dev/null || \
|
| 38 |
+
(cd model_code && pip install --no-deps -e . --config-settings="--build-option=--skip-requires-python") 2>/dev/null || \
|
| 39 |
+
(cd model_code && python3 setup.py develop --no-deps 2>/dev/null) || \
|
| 40 |
+
echo "FSD model_code install skipped -- will use direct imports"
|
| 41 |
|
| 42 |
# Install service-layer deps
|
| 43 |
COPY requirements.txt .
|
video/fake-stormer/Dockerfile
CHANGED
|
@@ -1,5 +1,7 @@
|
|
| 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
|
|
|
|
| 1 |
FROM pytorch/pytorch:1.13.1-cuda11.6-cudnn8-devel
|
| 2 |
|
| 3 |
+
ENV DEBIAN_FRONTEND=noninteractive
|
| 4 |
+
|
| 5 |
WORKDIR /app
|
| 6 |
|
| 7 |
# Fix potential GPG key issues on older CUDA base images
|