Sign inSign up

lliwi/stable-difusion-webui-forge

By lliwi

•Updated about 1 year ago

stable-difusion-webui-forge dockerized

Image
0

1.0K

lliwi/stable-difusion-webui-forge repository overview

This image provides a easily run the Stable Diffusion WebUI Forge.

services:  
  stable-diffusion-forge:  
    image: lliwi/stable-difusion-webui-forge

    ports:  
      - "7860:7860"  
    volumes:  
      - ./models:/app/models  
      - ./outputs:/app/outputs  
      - ./extensions:/app/extensions  
    environment:  
      - NVIDIA_VISIBLE_DEVICES=all
      - CMDARGS=--listen --port 7860 
    deploy:  
      resources:  
        reservations:  
          devices:  
            - driver: nvidia  
              count: 1  
              capabilities: [gpu]

The Docker image might run as a non-root user (often UID/GID 1000). To ensure the container can write to your local models and outputs directories, you might need to adjust their permissions.

sudo chown -R 1000:1000 ./models ./outputs

You can add the Stable Diffusion WebUI Forge standard optional paremeters in the CMDARGS

  • --medvram
  • --lowvram
  • --no-half
  • --skip-install
  • --skip-version-check
  • --skip-prepare-environment
  • --listen

You can also build your own image with the next Dockerfile

# Usar imagen base de Python con CUDA  
FROM nvidia/cuda:12.1.1-base-ubuntu22.04

ENV DEBIAN_FRONTEND=noninteractive
ENV CMDARGS --listen

ARG UID=1000
ARG GID=1000
  
# Instalar dependencias del sistema  
RUN apt-get update && apt-get install -y \  
    python3.10 \  
    python3.10-venv \  
    python3-pip \  
    git \  
    wget \  
    curl \  
    libgl1-mesa-glx \  
    libglib2.0-0 \  
    libsm6 \  
    libxext6 \  
    libxrender-dev \  
    libgomp1 \  
    && rm -rf /var/lib/apt/lists/*  
  
# Crear directorio de trabajo  
WORKDIR /app  
  
# Clonar el repositorio  
RUN git clone https://github.com/lllyasviel/stable-diffusion-webui-forge.git .  
  
# Configurar variables de entorno para la instalación  
ENV PYTHON_CMD=python3.10  
ENV VENV_DIR=venv   

RUN groupadd -g "${GID}" user && \
    useradd -m -u "${UID}" -g "${GID}" user
RUN chown -R user:user /app
USER user

# Crear y activar entorno virtual  
RUN python3.10 -m venv venv  
  
# Instalar dependencias de Python  
RUN . venv/bin/activate && \  
    pip install --upgrade pip && \  
    pip install -r /app/requirements_versions.txt

# Hacer ejecutable el script  
RUN chmod +x /app/webui-user.sh  
  
# Exponer el puerto por defecto  
EXPOSE 7860  

  
# Comando de inicio  
CMD bash webui.sh  ${CMDARGS}

Tag summary

Content type

Image

Digest

sha256:01d992dfb…

Size

6.6 GB

Last updated

about 1 year ago

docker pull lliwi/stable-difusion-webui-forge