File size: 3,219 Bytes
8fbdd85
06e9d12
0fdeb58
8dc54dd
 
 
 
 
 
8fbdd85
8dc54dd
06e9d12
0fdeb58
8fbdd85
 
 
 
0fdeb58
8fbdd85
7c2f064
0fdeb58
 
8dc54dd
667eb29
0fdeb58
8fbdd85
 
 
 
 
 
0fdeb58
8fbdd85
 
8dc54dd
0fdeb58
8fbdd85
8dc54dd
17e5bab
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
8dc54dd
6ec0d8b
 
 
 
 
 
 
 
17e5bab
 
 
 
 
 
6ec0d8b
17e5bab
 
 
 
8dc54dd
0fdeb58
8fbdd85
 
8dc54dd
0fdeb58
 
8dc54dd
17e5bab
 
0fdeb58
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
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
FROM continuumio/miniconda3:latest

# Install system dependencies
RUN apt-get update && apt-get install -y \
    wget \
    git \
    ffmpeg \
    libsm6 \
    libxext6 \
    ninja-build \
    && rm -rf /var/lib/apt/lists/*

# Create non-root user
RUN useradd -m -u 1000 user
RUN mkdir -p /home/user/app/scripts/gradio && \
    chown -R user:user /home/user/app

# Set working directory
WORKDIR /home/user/app

# Configure git
RUN git config --global user.email "[email protected]" && \
    git config --global user.name "jmanhype"

# Clone repository
RUN rm -rf * .* || true && \
    git clone https://github.com/TMElyralab/MuseV.git . && \
    ls -la scripts/gradio/app_gradio_space.py && \
    echo "=== Repository contents ===" && \
    ls -la scripts/gradio/

# Create conda environment
RUN conda create -n musev python=3.10 -y && \
    echo "conda activate musev" >> ~/.bashrc

# Install setuptools first
RUN conda run -n musev pip install --no-cache-dir setuptools==65.5.1

# Install core dependencies first
RUN conda run -n musev pip install --no-cache-dir \
    torch \
    torchvision \
    torchaudio \
    transformers==4.33.1 \
    accelerate==0.22.0 \
    gradio>=4.0.0 \
    spaces \
    ninja==1.11.1 \
    bitsandbytes==0.41.1 \
    xformers==0.0.21 \
    omegaconf \
    einops \
    imageio==2.31.1 \
    pandas \
    matplotlib \
    pynvml==11.5.0 \
    moviepy==1.0.3 \
    scikit-learn \
    librosa==0.10.1 \
    ffmpeg-python \
    easydict \
    mediapipe==0.10.3 \
    insightface==0.7.3 \
    opencv-python \
    Pillow \
    protobuf==3.20.3 \
    PyYAML \
    scipy \
    tqdm \
    albumentations==1.3.1 \
    opencv-contrib-python==4.8.0.76 \
    imageio-ffmpeg==0.4.8 \
    pytorch-lightning==2.0.8 \
    timm==0.9.12 \
    safetensors==0.3.3 \
    pycocotools \
    kornia==0.7.0 \
    open_clip_torch==2.20.0 \
    torchmetrics==1.1.1 \
    invisible-watermark==0.1.5 \
    ftfy==6.1.1 \
    loguru==0.6.0 \
    markupsafe==2.0.1 \
    cuid

# Install MMCM dependencies first
RUN conda run -n musev pip install --no-cache-dir basicsr && \
    conda run -n musev pip install --no-cache-dir -U openmim && \
    conda run -n musev mim install mmengine && \
    conda run -n musev mim install "mmcv>=2.0.1" && \
    conda run -n musev mim install "mmdet>=3.1.0" && \
    conda run -n musev mim install "mmpose>=1.1.0"

# Install git dependencies incrementally
RUN conda run -n musev pip install --no-cache-dir git+https://github.com/TMElyralab/diffusers.git@tme
RUN conda run -n musev pip install --no-cache-dir git+https://github.com/tencent-ailab/IP-Adapter.git@main
RUN conda run -n musev pip install --no-cache-dir git+https://github.com/openai/CLIP.git@main
RUN conda run -n musev pip install --no-cache-dir git+https://github.com/TMElyralab/controlnet_aux.git@tme

# Now install MMCM after its dependencies are installed
RUN git clone https://github.com/TMElyralab/MMCM.git /tmp/mmcm && \
    cd /tmp/mmcm && \
    git checkout setup && \
    conda run -n musev pip install -e .

# Copy and set up entrypoint
COPY scripts/gradio/entrypoint.sh /entrypoint.sh
RUN chmod +x /entrypoint.sh

# Switch to non-root user
USER user

EXPOSE 7860

ENTRYPOINT ["/entrypoint.sh"]