-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDockerfile_Base
More file actions
99 lines (75 loc) · 5.38 KB
/
Copy pathDockerfile_Base
File metadata and controls
99 lines (75 loc) · 5.38 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
# Use an official CUDA base image with Ubuntu 20.04
FROM nvcr.io/nvidia/pytorch:25.06-py3
WORKDIR /app
# System libs needed by OpenCV (cv2)
RUN apt-get update && \
apt-get install -y --no-install-recommends \
libgl1 libglib2.0-0 && \
rm -rf /var/lib/apt/lists/*
RUN python3 -m pip install -U --no-cache-dir pip setuptools wheel
RUN mkdir -p /root/.insightface/models/
RUN pip install git+https://github.com/huggingface/transformers.git
RUN pip install git+https://github.com/huggingface/diffusers
RUN pip install -U optimum-quanto accelerate safetensors sentencepiece piexif onnxruntime-gpu bitsandbytes insightface
RUN accelerate config default
#RUN git clone https://github.com/Stability-AI/generative-models.git
#RUN pip install -r /app/generative-models/requirements/pt2.txt
#RUN pip install black==23.7.0 chardet==5.1.0 "clip @ git+https://github.com/openai/CLIP.git" einops>=0.6.1 fairscale>=0.4.13 fire>=0.5.0 fsspec>=2023.6.0 invisible-watermark>=0.2.0 kornia matplotlib>=3.7.2 natsort>=8.4.0 ninja>=1.11.1 numpy>=1.24.4 omegaconf>=2.3.0 open-clip-torch>=2.20.0 opencv-python==4.6.0.66 pandas>=2.0.3 pillow>=9.5.0 pudb>=2022.1.3 pytorch-lightning pyyaml>=6.0.1 rembg scipy>=1.10.1 streamlit>=0.73.1 tensorboardx==2.6 timm>=0.9.2 tokenizers==0.12.1 torch==2.5.1+cu118 torchaudio==2.5.1+cu118 torchdata torchmetrics>=1.0.1 torchvision==0.20.1+cu118 tqdm>=4.65.0 transformers==4.19.1 "urllib3<1.27,>=1.25.4" wandb>=0.15.6 webdataset>=0.2.33 wheel>=0.41.0 gradio streamlit-keyup==0.2.0
#RUN pip install -U xformers --index-url https://download.pytorch.org/whl/cu118
#RUN pip install git+https://github.com/huggingface/transformers.git
#RUN pip install invisible_watermark transformers accelerate safetensors bitsandbytes
#RUN git clone https://github.com/huggingface/diffusers
#RUN pip install git+https://github.com/huggingface/peft.git #DoRA fix
#RUN pip install peft
#RUN pip install --upgrade albumentations
#RUN cd diffusers && pip install ".[torch]"
#RUN cd diffusers/examples/dreambooth && pip install -r requirements_sdxl.txt
#RUN cd diffusers/examples/dreambooth && pip install -r requirements_sd3.txt
#RUN cd diffusers/examples/dreambooth && pip install -r requirements_flux.txt
#
#START GFPGAN
RUN python3 -m pip install --use-pep517 --no-cache-dir --no-build-isolation --no-deps \
"basicsr @ git+https://github.com/XPixelGroup/BasicSR@8d56e3a045f9fb3e1d8872f92ee4a4f07f886b0a"
RUN git clone https://github.com/postworthy/GFPGAN.git
RUN cd GFPGAN && pip install -r requirements.txt && python3 setup.py develop
RUN ln -s GFPGAN/gfpgan .
RUN git clone https://github.com/xinntao/Real-ESRGAN.git
RUN cd Real-ESRGAN && pip install -r requirements.txt && python3 setup.py develop
RUN ln -s Real-ESRGAN/realesrgan .
RUN mkdir -p /app/gfpgan/weights/
RUN ln -s /root/.superres/realesr-general-x4v3.pth /app/realesr-general-x4v3.pth
RUN ln -s /root/.superres/RealESRGAN_x4plus.pth /app/RealESRGAN_x4plus.pth
RUN ln -s /root/.superres/GFPGANv1.4.pth /app/GFPGANv1.4.pth
RUN ln -s /root/.superres/detection_Resnet50_Final.pth /app/gfpgan/weights/detection_Resnet50_Final.pth
RUN ln -s /root/.superres/parsing_parsenet.pth /app/gfpgan/weights/parsing_parsenet.pth
RUN cd GFPGAN && git pull
#END GFPGAN
# Avoid NumPy 2.x ABI breakage
RUN python3 -m pip install --no-cache-dir "numpy<2"
#cinemagoer
#RUN pip install --upgrade git+https://github.com/cinemagoer/cinemagoer
#END cinemagoer
#PATCH https://github.com/XPixelGroup/BasicSR/pull/624/files
#RUN sed -i 's/from torchvision.transforms.functional_tensor import rgb_to_grayscale/from torchvision.transforms.functional import rgb_to_grayscale/' /usr/local/lib/python3.12/dist-packages/basicsr/data/degradations.py
#END PATCH
#Should be at the top but I dont want to wait for the full rebuild
#RUN apt-get update && apt-get install -y libgl1-mesa-glx libgtk-3-0 && rm -rf /var/lib/apt/lists/*
ENV PYTORCH_CUDA_ALLOC_CONF=expandable_segments:True,max_split_size_mb:64
ENV LD_LIBRARY_PATH=/usr/local/cuda/lib64:/usr/local/cuda/targets/x86_64-linux/lib:$LD_LIBRARY_PATH
RUN printf "/usr/local/cuda/lib64\n/usr/local/cuda/targets/x86_64-linux/lib\n" \
> /etc/ld.so.conf.d/cuda-ngc.conf && ldconfig
#SadTalker
#RUN git clone https://github.com/OpenTalker/SadTalker.git
#RUN apt install -y ffmpeg libsndfile1-dev
#RUN cd ./SadTalker && pip install -r requirements.txt
#RUN cd ./SadTalker && mkdir -p ./gfpgan/weights
#RUN mkdir -p /app/SadTalker/gfpgan/weights/
#RUN ln -s /root/.superres/GFPGANv1.4.pth /app/SadTalker/gfpgan/weights/GFPGANv1.4.pth
#RUN ln -s /root/.superres/detection_Resnet50_Final.pth /app/SadTalker/gfpgan/weights/detection_Resnet50_Final.pth
#RUN ln -s /root/.superres/parsing_parsenet.pth /app/SadTalker/gfpgan/weights/parsing_parsenet.pth
#RUN ln -s /root/.superres/alignment_WFLW_4HG.pth /app/SadTalker/gfpgan/weights/alignment_WFLW_4HG.pth
#RUN cd ./SadTalker && mkdir checkpoints
#RUN ln -s /root/sadtalker/checkpoints/mapping_00109-model.pth.tar /app/SadTalker/checkpoints/mapping_00109-model.pth.tar
#RUN ln -s /root/sadtalker/checkpoints/mapping_00229-model.pth.tar /app/SadTalker/checkpoints/mapping_00229-model.pth.tar
#RUN ln -s /root/sadtalker/checkpoints/SadTalker_V0.0.2_256.safetensors /app/SadTalker/checkpoints/SadTalker_V0.0.2_256.safetensors
#RUN ln -s /root/sadtalker/checkpoints/SadTalker_V0.0.2_512.safetensors /app/SadTalker/checkpoints/SadTalker_V0.0.2_512.safetensors