# Use an official Python runtime as a parent image FROM python:3.8 # Set the working directory to /content WORKDIR /content # Clone the repository RUN git clone -b dev https://github.com/camenduru/DiffBIR # Change the working directory to /content/DiffBIR WORKDIR /content/DiffBIR # Install Python dependencies RUN pip install -q einops pytorch_lightning gradio omegaconf xformers==0.0.20 transformers lpips # Install open_clip from GitHub RUN pip install -q git+https://github.com/mlfoundations/open_clip@v2.20.0 # Install aria2 RUN apt-get update && apt-get install -y aria2 # Download checkpoint files using aria2 RUN aria2c --console-log-level=error -c -x 16 -s 16 -k 1M https://huggingface.co/lxq007/DiffBIR/resolve/main/general_full_v1.ckpt -d /content/models -o general_full_v1.ckpt RUN aria2c --console-log-level=error -c -x 16 -s 16 -k 1M https://huggingface.co/lxq007/DiffBIR/resolve/main/general_swinir_v1.ckpt -d /content/models -o general_swinir_v1.ckpt # Run the Python script inside the Docker container CMD ["python", "gradio_diffbir.py", "--ckpt", "/content/models/general_full_v1.ckpt", "--config", "/content/DiffBIR/configs/model/cldm.yaml", "--reload_swinir", "--swinir_ckpt", "/content/models/general_swinir_v1.ckpt"]