diff --git a/docker/Dockerfile b/docker/Dockerfile new file mode 100644 index 0000000..c9e2623 --- /dev/null +++ b/docker/Dockerfile @@ -0,0 +1,16 @@ +FROM nvidia/cuda:12.6.2-cudnn-runtime-ubuntu24.04 + +RUN apt-get update \ + && apt-get -y upgrade \ + && apt-get install -y git curl pip \ + && git clone https://github.com/VectorSpaceLab/OmniGen.git \ + && cd OmniGen \ + && pip install --break-system-packages -e . \ + && pip install --break-system-packages gradio spaces \ + && pip cache purge \ + && apt-get clean \ + && rm -rf /var/lib/apt/lists/* \ + && sed -i 's/demo\.launch(.*)/demo.launch(server_name="0.0.0.0")/' app.py + +WORKDIR /OmniGen/ +ENTRYPOINT ["python3", "app.py"] diff --git a/docker/README.md b/docker/README.md new file mode 100644 index 0000000..cd50d6a --- /dev/null +++ b/docker/README.md @@ -0,0 +1,25 @@ +# Build the Docker Image +Run the following commands to build the image: + +```bash +cd docker/ +sudo docker build -t omni1 . +``` + +**Build Notes**: +- On a machine with a Xeon Silver CPU and an SSD, the build process takes approximately 10 minutes. +- The resulting Docker image is approximately 11GB in size. + +# Run the Docker Container +Use this command to run the container: + +```bash +mkdir -p ~/Omni/.cache +sudo docker run -p 7860:7860 --name omni --rm --gpus all -it -v ~/Omni/.cache:/root/.cache omni1 +``` + +**Model Storage**: The directory `/root/.cache` inside the container is used to store the model. Make sure your system has at least 18GB of free space in the `~/Omni/.cache` directory. + +**First Run**: The first time you run the container, it may take several minutes to download the model. + +**Subsequent Runs**: Starting the container will take about 15–40 seconds.