forked from anveshane/Runpod_Qwen_Image_Edit-2511
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDockerfile
More file actions
46 lines (34 loc) · 1.45 KB
/
Dockerfile
File metadata and controls
46 lines (34 loc) · 1.45 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
# Use NVIDIA CUDA base image with Python
FROM nvidia/cuda:12.1.0-cudnn8-runtime-ubuntu22.04
# Set working directory
WORKDIR /app
# Prevent interactive prompts during package installation
ENV DEBIAN_FRONTEND=noninteractive
# Install Python and essential build tools
RUN apt-get update && apt-get install -y \
python3.10 \
python3-pip \
git \
wget \
curl \
&& rm -rf /var/lib/apt/lists/*
# Install uv - the fast Python package installer
RUN curl -LsSf https://astral.sh/uv/install.sh | sh
ENV PATH="/root/.cargo/bin:$PATH"
# Copy requirements for dependency installation
COPY requirements.txt .
# Install PyTorch with CUDA support using uv (much faster!)
RUN uv pip install --system torch torchvision torchaudio --index-url https://download.pytorch.org/whl/cu121
# Install Diffusers from GitHub (latest version with Qwen support)
RUN uv pip install --system git+https://github.com/huggingface/diffusers
# Install other dependencies using uv
RUN uv pip install --system transformers accelerate safetensors pillow runpod
# Copy handler script
COPY handler.py .
# Optional: Pre-download the model (uncomment if you want to bake it into the image)
# This increases build time and image size but reduces cold start time
# RUN python3 -c "from diffusers import QwenImageEditPlusPipeline; QwenImageEditPlusPipeline.from_pretrained('Qwen/Qwen-Image-Edit-2511')"
# Set environment variables
ENV PYTHONUNBUFFERED=1
# Start the handler
CMD ["python3", "handler.py"]