Z-Anime-CPU / Dockerfile
Nekochu's picture
Z-Anime 6B CPU: distill 8-step Q5_0, Qwen3-4B Q8_0, euler_a, beta schedule
736cf48
raw
history blame
2.01 kB
FROM ubuntu:22.04 AS builder
ENV DEBIAN_FRONTEND=noninteractive
RUN apt-get update && apt-get install -y --no-install-recommends \
build-essential cmake git ca-certificates libopenblas-dev pkg-config \
&& rm -rf /var/lib/apt/lists/*
WORKDIR /build
RUN git clone --depth 1 https://github.com/leejet/stable-diffusion.cpp.git . \
&& git submodule update --init --depth 1
RUN mkdir build && cd build \
&& cmake .. -DGGML_BLAS=ON -DSD_BUILD_SHARED_LIBS=OFF \
&& cmake --build . --config Release -j1
RUN mkdir -p /artifacts \
&& cp /build/build/bin/sd-cli /artifacts/ \
&& (cp -a /build/build/bin/lib*.so* /artifacts/ 2>/dev/null || true)
# ---------------------------------------------------------------------------
# Runtime image
# ---------------------------------------------------------------------------
FROM ubuntu:22.04
ENV DEBIAN_FRONTEND=noninteractive
RUN apt-get update && apt-get install -y --no-install-recommends \
libopenblas0 libgomp1 ca-certificates curl \
python3 python3-pip \
&& rm -rf /var/lib/apt/lists/*
WORKDIR /app
COPY --from=builder /artifacts/ /app/
ENV LD_LIBRARY_PATH=/app:${LD_LIBRARY_PATH}
RUN chmod +x /app/sd-cli
RUN mkdir -p /app/models
# Download Z-Anime distill 8-step Q5_0 GGUF (~4.51GB)
RUN curl -fL --retry 3 --retry-delay 5 -o /app/models/z-anime-8steps-q5_0.gguf \
"https://huggingface.co/DaNS2025/Z-Anime_8-steps.GGUF/resolve/main/Z-Anime-8steps.q5_0.gguf"
# Download Qwen3-4B text encoder Q8_0 GGUF (~4.28GB)
RUN curl -fL --retry 3 --retry-delay 5 -o /app/models/qwen3_4b_q8_0.gguf \
"https://huggingface.co/worstplayer/Z-Image_Qwen_3_4b_text_encoder_GGUF/resolve/main/Qwen_3_4b-Q8_0.gguf"
# Download VAE (~168MB)
RUN curl -fL --retry 3 --retry-delay 5 -o /app/models/ae.safetensors \
"https://huggingface.co/SeeSee21/Z-Anime/resolve/main/vae/ae.safetensors"
# Install Python deps
RUN pip3 install --no-cache-dir gradio Pillow
COPY app.py /app/app.py
EXPOSE 7860
CMD ["python3", "/app/app.py"]