@@ -15,8 +15,7 @@ ARG TARGETARCH
15
15
ARG TARGETVARIANT
16
16
17
17
ENV DEBIAN_FRONTEND=noninteractive
18
- ENV EXTERNAL_GRPC_BACKENDS="coqui:/build/backend/python/coqui/run.sh,transformers:/build/backend/python/transformers/run.sh,rerankers:/build/backend/python/rerankers/run.sh,autogptq:/build/backend/python/autogptq/run.sh,bark:/build/backend/python/bark/run.sh,diffusers:/build/backend/python/diffusers/run.sh,openvoice:/build/backend/python/openvoice/run.sh,kokoro:/build/backend/python/kokoro/run.sh,vllm:/build/backend/python/vllm/run.sh,mamba:/build/backend/python/mamba/run.sh,exllama2:/build/backend/python/exllama2/run.sh,parler-tts:/build/backend/python/parler-tts/run.sh"
19
-
18
+ ENV EXTERNAL_GRPC_BACKENDS="coqui:/build/backend/python/coqui/run.sh,transformers:/build/backend/python/transformers/run.sh,rerankers:/build/backend/python/rerankers/run.sh,autogptq:/build/backend/python/autogptq/run.sh,bark:/build/backend/python/bark/run.sh,diffusers:/build/backend/python/diffusers/run.sh,faster-whisper:/build/backend/python/faster-whisper/run.sh,kokoro:/build/backend/python/kokoro/run.sh,vllm:/build/backend/python/vllm/run.sh,exllama2:/build/backend/python/exllama2/run.sh"
20
19
21
20
RUN apt-get update && \
22
21
apt-get install -y --no-install-recommends \
@@ -69,14 +68,10 @@ ENV PATH=/opt/rocm/bin:${PATH}
69
68
# OpenBLAS requirements and stable diffusion
70
69
RUN apt-get update && \
71
70
apt-get install -y --no-install-recommends \
72
- libopenblas-dev \
73
- libopencv-dev && \
71
+ libopenblas-dev && \
74
72
apt-get clean && \
75
73
rm -rf /var/lib/apt/lists/*
76
74
77
- # Set up OpenCV
78
- RUN ln -s /usr/include/opencv4/opencv2 /usr/include/opencv2
79
-
80
75
WORKDIR /build
81
76
82
77
# ##################################
@@ -251,7 +246,7 @@ RUN git clone --recurse-submodules --jobs 4 -b ${GRPC_VERSION} --depth 1 --shall
251
246
252
247
FROM requirements-drivers AS builder-base
253
248
254
- ARG GO_TAGS="stablediffusion tts p2p"
249
+ ARG GO_TAGS="tts p2p"
255
250
ARG GRPC_BACKENDS
256
251
ARG MAKEFLAGS
257
252
ARG LD_FLAGS="-s -w"
@@ -285,35 +280,12 @@ RUN <<EOT bash
285
280
fi
286
281
EOT
287
282
288
-
289
- # ##################################
290
- # ##################################
291
-
292
- # This first portion of builder holds the layers specifically used to build backend-assets/grpc/stablediffusion
293
- # In most cases, builder is the image you should be using - however, this can save build time if one just needs to copy backend-assets/grpc/stablediffusion and nothing else.
294
- FROM builder-base AS builder-sd
295
-
296
- # stablediffusion does not tolerate a newer version of abseil, copy only over enough elements to build it
297
- COPY Makefile .
298
- COPY go.mod .
299
- COPY go.sum .
300
- COPY backend/backend.proto ./backend/backend.proto
301
- COPY backend/go/image/stablediffusion ./backend/go/image/stablediffusion
302
- COPY pkg/grpc ./pkg/grpc
303
- COPY pkg/stablediffusion ./pkg/stablediffusion
304
- RUN git init
305
- RUN make sources/go-stable-diffusion
306
- RUN touch prepare-sources
307
-
308
- # Actually build the backend
309
- RUN GRPC_BACKENDS=backend-assets/grpc/stablediffusion make backend-assets/grpc/stablediffusion
310
-
311
283
# ##################################
312
284
# ##################################
313
285
314
286
# The builder target compiles LocalAI. This target is not the target that will be uploaded to the registry.
315
287
# Adjustments to the build process should likely be made here.
316
- FROM builder-sd AS builder
288
+ FROM builder-base AS builder
317
289
318
290
# Install the pre-built GRPC
319
291
COPY --from=grpc /opt/grpc /usr/local
@@ -353,8 +325,6 @@ ARG FFMPEG
353
325
354
326
COPY --from=grpc /opt/grpc /usr/local
355
327
356
- COPY --from=builder-sd /build/backend-assets/grpc/stablediffusion /build/backend-assets/grpc/stablediffusion
357
-
358
328
COPY .devcontainer-scripts /.devcontainer-scripts
359
329
360
330
# Add FFmpeg
@@ -427,9 +397,6 @@ COPY --from=builder /build/local-ai ./
427
397
# Copy shared libraries for piper
428
398
COPY --from=builder /build/sources/go-piper/piper-phonemize/pi/lib/* /usr/lib/
429
399
430
- # do not let stablediffusion rebuild (requires an older version of absl)
431
- COPY --from=builder-sd /build/backend-assets/grpc/stablediffusion ./backend-assets/grpc/stablediffusion
432
-
433
400
# Change the shell to bash so we can use [[ tests below
434
401
SHELL ["/bin/bash" , "-c" ]
435
402
# We try to strike a balance between individual layer size (as that affects total push time) and total image size
@@ -443,8 +410,8 @@ RUN if [[ ( "${IMAGE_TYPE}" == "extras ")]]; then \
443
410
RUN if [[ ( "${EXTRA_BACKENDS}" =~ "coqui" || -z "${EXTRA_BACKENDS}" ) && "$IMAGE_TYPE" == "extras" ]]; then \
444
411
make -C backend/python/coqui \
445
412
; fi && \
446
- if [[ ( "${EXTRA_BACKENDS}" =~ "parler-tts " || -z "${EXTRA_BACKENDS}" ) && "$IMAGE_TYPE" == "extras" ]]; then \
447
- make -C backend/python/parler-tts \
413
+ if [[ ( "${EXTRA_BACKENDS}" =~ "faster-whisper " || -z "${EXTRA_BACKENDS}" ) && "$IMAGE_TYPE" == "extras" ]]; then \
414
+ make -C backend/python/faster-whisper \
448
415
; fi && \
449
416
if [[ ( "${EXTRA_BACKENDS}" =~ "diffusers" || -z "${EXTRA_BACKENDS}" ) && "$IMAGE_TYPE" == "extras" ]]; then \
450
417
make -C backend/python/diffusers \
@@ -453,9 +420,6 @@ RUN if [[ ( "${EXTRA_BACKENDS}" =~ "coqui" || -z "${EXTRA_BACKENDS}" ) && "$IMAG
453
420
RUN if [[ ( "${EXTRA_BACKENDS}" =~ "kokoro" || -z "${EXTRA_BACKENDS}" ) && "$IMAGE_TYPE" == "extras" ]]; then \
454
421
make -C backend/python/kokoro \
455
422
; fi && \
456
- if [[ ( "${EXTRA_BACKENDS}" =~ "openvoice" || -z "${EXTRA_BACKENDS}" ) && "$IMAGE_TYPE" == "extras" ]]; then \
457
- make -C backend/python/openvoice \
458
- ; fi && \
459
423
if [[ ( "${EXTRA_BACKENDS}" =~ "exllama2" || -z "${EXTRA_BACKENDS}" ) && "$IMAGE_TYPE" == "extras" ]]; then \
460
424
make -C backend/python/exllama2 \
461
425
; fi && \
@@ -474,9 +438,6 @@ RUN if [[ ( "${EXTRA_BACKENDS}" =~ "vllm" || -z "${EXTRA_BACKENDS}" ) && "$IMAGE
474
438
; fi && \
475
439
if [[ ( "${EXTRA_BACKENDS}" =~ "rerankers" || -z "${EXTRA_BACKENDS}" ) && "$IMAGE_TYPE" == "extras" ]]; then \
476
440
make -C backend/python/rerankers \
477
- ; fi && \
478
- if [[ ( "${EXTRA_BACKENDS}" =~ "mamba" || -z "${EXTRA_BACKENDS}" ) && "$IMAGE_TYPE" == "extras" ]]; then \
479
- make -C backend/python/mamba \
480
441
; fi
481
442
482
443
# Make sure the models directory exists
0 commit comments