Live demo on Hugging Face #135
Replies: 3 comments 17 replies
-
That's great, this is very helpful for me. My laptop can't run this program. |
Beta Was this translation helpful? Give feedback.
-
I'm not sure if this works as intended. In basic mode as well as advanced mode, the results don't mirror the prompt in any way. No matter how detailed the prompt is. |
Beta Was this translation helpful? Give feedback.
-
Hey @radames . I've tried to clone your space and update the Dockerfile to the latest commit at the time of writing: However, after building the project and running it. The space gets stuck at the building step. Are there any other steps required to run it properly? P.S. I've tried with Below you can see the updated Dockerfile: FROM nvidia/cuda:11.8.0-cudnn8-runtime-ubuntu22.04
ENV DEBIAN_FRONTEND=noninteractive \
TZ=America/Los_Angeles
ARG USE_PERSISTENT_DATA
RUN apt-get update && apt-get install -y \
git \
make build-essential libssl-dev zlib1g-dev \
libbz2-dev libreadline-dev libsqlite3-dev wget curl llvm \
libncursesw5-dev xz-utils tk-dev libxml2-dev libxmlsec1-dev libffi-dev liblzma-dev git-lfs \
ffmpeg libsm6 libxext6 cmake libgl1-mesa-glx \
&& rm -rf /var/lib/apt/lists/* \
&& git lfs install
WORKDIR /code
COPY ./requirements.txt /code/requirements.txt
# User
RUN useradd -m -u 1000 user
USER user
ENV HOME=/home/user \
PATH=/home/user/.local/bin:$PATH
# Pyenv
RUN curl https://pyenv.run | bash
ENV PATH=$HOME/.pyenv/shims:$HOME/.pyenv/bin:$PATH
ARG PYTHON_VERSION=3.10.12
# Python
RUN pyenv install $PYTHON_VERSION && \
pyenv global $PYTHON_VERSION && \
pyenv rehash && \
pip install --no-cache-dir --upgrade pip setuptools wheel && \
pip install --no-cache-dir \
datasets \
huggingface-hub "protobuf<4" "click<8.1"
RUN pip install --no-cache-dir --upgrade -r /code/requirements.txt
# Set the working directory to /data if USE_PERSISTENT_DATA is set, otherwise set to $HOME/app
WORKDIR $HOME/app
# Copy the current directory contents into the container at $HOME/app setting the owner to the user
RUN git clone https://github.com/lllyasviel/Fooocus . && \
# pin to a specific commit
git checkout cca0ca704a713ab153938e78de6787609c723cad && \
pip install --no-cache-dir xformers==0.0.20 triton==2.0.0 torch==2.0.1 torchvision==0.15.2 --extra-index-url https://download.pytorch.org/whl/cu118 && \
pip install --no-cache-dir -r requirements_versions.txt
# remove the next line if you're running on your own GPU, it set max images to 3 and disables the API
RUN sed -i "s|image_number = gr.Slider(label='Image Number', minimum=1, maximum=32|image_number = gr.Slider(label='Image Number', minimum=1, maximum=3|" webui.py && \
sed -i "s|shared.gradio_root = gr.Blocks(title='Fooocus ' + fooocus_version.version, css=modules.html.css).queue()|shared.gradio_root = gr.Blocks(title='Fooocus ' + fooocus_version.version, css=modules.html.css).queue(concurrency_count=1,api_open=False)|" webui.py && \
sed -i "s|shared.gradio_root.launch(inbrowser=True, server_name=args.listen, server_port=args.port, share=args.share)|shared.gradio_root.launch(inbrowser=True, server_name=args.listen, server_port=args.port, share=args.share, show_api=False)|" webui.py
ENV HOME=/home/user \
PATH=/home/user/.local/bin:$PATH \
PYTHONPATH=$HOME/app \
PYTHONUNBUFFERED=1 \
GRADIO_ALLOW_FLAGGING=never \
GRADIO_NUM_PORTS=1 \
GRADIO_SERVER_NAME=0.0.0.0 \
GRADIO_THEME=huggingface \
SYSTEM=spaces
CMD ["python", "entry_with_update.py", "--preset", "realistic"] |
Beta Was this translation helpful? Give feedback.
-
I made a live demo on Hugging Face using a Docker SDK
https://huggingface.co/spaces/SpacesExamples/Fooocus
Dockerfile if you want to run it locally
https://huggingface.co/spaces/SpacesExamples/Fooocus/blob/main/Dockerfile
Beta Was this translation helpful? Give feedback.
All reactions