-
Notifications
You must be signed in to change notification settings - Fork 6k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Run in docker #98
Comments
i will just leave this here
|
Thank you @dstrop , I was unable to get fooocus work via the Linux python directions, but this is working perfect. |
@gusmolinabr Docker is by far the easiest way to get anything python or java to work. |
I've found this |
I ran into some issues using the config posted by @dstrop - thank you for sharing! Here is my adjusted Dockerfile. FROM nvidia/cuda:12.3.0-runtime-ubuntu22.04
RUN apt-get update && \
apt-get install --no-install-recommends -y python3 python3-pip libgl1-mesa-glx libglib2.0-0 libsm6 libxrender1 libxext6 && \
rm -rf /var/lib/apt/lists/*
RUN --mount=type=cache,target=/root/.cache/pip pip3 install virtualenv
RUN mkdir /app
WORKDIR /app
RUN virtualenv /venv
RUN . /venv/bin/activate && \
pip3 install --upgrade pip
COPY requirements_versions.txt /app/requirements_versions.txt
RUN . /venv/bin/activate && \
pip3 install -r requirements_versions.txt
COPY . /app/
# may need to adjust the arch
RUN ln -s /usr/lib/x86_64-linux-gnu/mesa/libGL.so.1 /usr/lib/libGL.so.1
RUN ln -s /usr/lib/x86_64-linux-gnu/libgthread-2.0.so.0 /usr/lib/libgthread-2.0.so.0
ENTRYPOINT [ "bash", "-c", ". /venv/bin/activate && exec \"$@\"", "--" ]
CMD [ "python3", "launch.py", "--listen" ] The project runs on port |
Stripping away the venv, adding the installation of torch and torchvision that is otherwise done when running launch.py for the first time, making the CUDA version configurable, and flagging the models directory as volume, I arrived at this: ARG CUDA_VERSION=12.3.0
FROM docker.io/nvidia/cuda:${CUDA_VERSION}-runtime-ubuntu22.04
RUN apt-get update && \
apt-get install --no-install-recommends -y \
libgl1-mesa-glx libglib2.0-0 libsm6 libxrender1 libxext6 \
git python3 python3-pip && \
rm -rf /var/lib/apt/lists/*
RUN git clone https://github.com/lllyasviel/Fooocus /app
WORKDIR /app
RUN pip install --no-cache -r requirements_versions.txt
RUN pip install --no-cache torch==2.1.0 torchvision==0.16.0 \
--extra-index-url "https://download.pytorch.org/whl/cu121"
VOLUME /app/models
ENTRYPOINT [ "python3", "launch.py", "--listen" ] On debian stable the latest CUDA image doesn't seem to work, so I use |
I tried with portainer on my windows. (base) root@85a74394deb6:/Fooocus# conda activate fooocus To create a public link, set |
For AMD GPUs I've had success with the following Docker/Podman file:
Build it with |
Feel free to also contribute your suggestions to the PR #1418. |
I can relate... This is a feature in Phase 2 - Features now, starting to work on merging PRs tomorrow for Phase 1 - Bugfixes (now finally permitted to do so!) |
No description provided.
The text was updated successfully, but these errors were encountered: