From 632fabb4ea69369f3a8be4adc95449531e59c3db Mon Sep 17 00:00:00 2001 From: bigcletus Date: Sat, 18 Apr 2026 14:55:46 -0400 Subject: [PATCH 01/16] Update StandardDockerfile.docker for AMD --- launchtools/StandardDockerfile.docker | 24 +++++++++++++++++++++--- 1 file changed, 21 insertions(+), 3 deletions(-) diff --git a/launchtools/StandardDockerfile.docker b/launchtools/StandardDockerfile.docker index 0ec340f84..34a601154 100644 --- a/launchtools/StandardDockerfile.docker +++ b/launchtools/StandardDockerfile.docker @@ -1,14 +1,28 @@ -FROM mcr.microsoft.com/dotnet/sdk:8.0-bookworm-slim +FROM rocm/dev-ubuntu-24.04:7.2.2-complete ARG UID=1000 -# Install python +# Install python3.12 RUN apt update -RUN apt install -y git wget build-essential python3.11 python3.11-venv python3.11-dev python3-pip ffmpeg +RUN apt install -y git wget build-essential python3.12 python3.12-venv python3.12-dev python3-pip ffmpeg # Install dependencies for controlnet preprocessors RUN apt install -y libglib2.0-0 libgl1 +# Install ROCm +RUN apt install -y rocm amdgpu-dkms amdgpu-dkms-firmware +RUN apt install -y rocm-hip rocm-hip-sdk hipblas hipblas-dev +RUN apt install -y hipfft-dev hipfft +RUN apt install -y hipsolver hipsolver-dev +RUN apt install -y ocl-icd-libopencl1 ocl-icd-opencl-dev opencl-c-headers opencl-clhpp-headers rocm-opencl rocm-opencl-dev + +# Set ROCm access +RUN wget https://repo.radeon.com/amdgpu/30.30.1/ubuntu/pool/main/a/amdgpu-insecure-instinct-udev-rules/amdgpu-insecure-instinct-udev-rules_30.30.1.0-2303411.22.04_all.deb +RUN apt install -y ./amdgpu-insecure-instinct-udev-rules_30.30.1.0-2303411.22.04_all.deb + +# Install DotNET8 and SDK +RUN apt install -y dotnet8 dotnet-sdk-8.0 + # Copy swarm's files into the docker container COPY . ./SwarmUI @@ -18,8 +32,12 @@ RUN chown -R $UID:$UID ./SwarmUI RUN git config --global --add safe.directory '*' # Ensure a user exists within docker for the given uid +RUN deluser ubuntu RUN useradd -u $UID swarmui +# Add user to groups +RUN usermod -aG video,render,root swarmui + # If built binaries were copied in, discard them, they are likely bad. # Build inside the container later (so eg extensions are included properly). RUN rm -rf ./SwarmUI/src/bin ./SwarmUI/src/obj From c7a1feaa433a8b07cba68a6c3694fcb2dfcb8acb Mon Sep 17 00:00:00 2001 From: bigcletus Date: Sat, 18 Apr 2026 15:07:19 -0400 Subject: [PATCH 02/16] Update example-docker-compose.yml --- launchtools/example-docker-compose.yml | 81 +++++++++++++++++++------- 1 file changed, 59 insertions(+), 22 deletions(-) diff --git a/launchtools/example-docker-compose.yml b/launchtools/example-docker-compose.yml index 35ccd8adf..10b1f5e45 100644 --- a/launchtools/example-docker-compose.yml +++ b/launchtools/example-docker-compose.yml @@ -1,6 +1,9 @@ services: swarmui: - image: swarmui + image: swarmui:latest # You should build the image first. run "sudo docker build -f launchtools/StandardDockerfile.docker -t swarmui ." + # in the SwarmUI folder on the docker host. Optionally, push to your own registry so the Docker Swarm can deploy + # automatically from your registry. Otherwise, you must build this image on each worker/manager that will be running + # SwarmUI user: ${HOST_UID:-1000}:${HOST_GID:-1000} cap_drop: - ALL @@ -9,33 +12,67 @@ services: args: UID: ${HOST_UID:-1000} dockerfile: launchtools/StandardDockerfile.docker - container_name: swarmui # uncomment `network_mode: host` if you want to access other services on the host network (eg a separated comfy instance) # network_mode: host volumes: - - swarmdata:/SwarmUI/Data - - swarmbackend:/SwarmUI/dlbackend - - swarmdlnodes:/SwarmUI/src/BuiltinExtensions/ComfyUIBackend/DLNodes - - swarmextensions:/SwarmUI/src/Extensions - - ./Models:/SwarmUI/Models - - ./Output:/SwarmUI/Output - - ./src/BuiltinExtensions/ComfyUIBackend/CustomWorkflows:/SwarmUI/src/BuiltinExtensions/ComfyUIBackend/CustomWorkflows + - swarmui-data-sync:/SwarmUI/Data + - swarmui-dlbackend-sync:/SwarmUI/dlbackend + - swarmui-dlnodes-sync:/SwarmUI/src/BuiltinExtensions/ComfyUIBackend/DLNodes + - swarmui-extensions-sync:/SwarmUI/src/Extensions + - swarmui-models-sync:/SwarmUI/Models + - swarmui-output-sync:/SwarmUI/Output + - swarmui-comfyui-sync:/SwarmUI/src/BuiltinExtensions/ComfyUIBackend/CustomWorkflows ports: - "7801:7801" deploy: + replicas: 1 resources: reservations: - devices: - - driver: nvidia - # change the count to the number of GPUs you want to use. - count: 1 - capabilities: [gpu] + generic_resources: + - discrete_resource_spec: + kind: 'AMD_GPU' # Matches daemon.json key + value: 0 # See https://instinct.docs.amd.com/projects/container-toolkit/en/latest/container-runtime/docker-swarm.html for Docker AMD GPU setup + volumes: - swarmdata: - name: swarmdata - swarmbackend: - name: swarmbackend - swarmdlnodes: - name: swarmdlnodes - swarmextensions: - name: swarmextensions + swarmui-data-sync: + driver: local + driver_opts: + type: nfs + device: ":" + o: "addr=,nolock,soft,rw" + swarmui-dlbackend-sync: + driver: local + driver_opts: + type: nfs + device: ":" + o: "addr=,nolock,soft,rw" + swarmui-dlnodes-sync: + driver: local + driver_opts: + type: nfs + device: ":" + o: "addr=,nolock,soft,rw" + swarmui-extensions-sync: + driver: local + driver_opts: + type: nfs + device: ":" + o: "addr=,nolock,soft,rw" + swarmui-models-sync: + driver: local + driver_opts: + type: nfs + device: ":" + o: "addr=,nolock,soft,rw" + swarmui-comfyui-sync: + driver: local + driver_opts: + type: nfs + device: ":" + o: "addr=,nolock,soft,rw" + swarmui-output-sync: + driver: local + driver_opts: + type: nfs + device: ":" + o: "addr=,nolock,soft,rw" From 138cf459fc5d585f6ad176d7f0a3d5200c17db0d Mon Sep 17 00:00:00 2001 From: bigcletus Date: Sat, 18 Apr 2026 15:11:54 -0400 Subject: [PATCH 03/16] Create Docker Swarm README Instructions on deploying to a swarm --- launchtools/Docker Swarm README | 36 +++++++++++++++++++++++++++++++++ 1 file changed, 36 insertions(+) create mode 100644 launchtools/Docker Swarm README diff --git a/launchtools/Docker Swarm README b/launchtools/Docker Swarm README new file mode 100644 index 000000000..a86fe7887 --- /dev/null +++ b/launchtools/Docker Swarm README @@ -0,0 +1,36 @@ +Prerequisites: + +1. Install and configure an NFS Server on your LAN. +2. Install and configure AMD Container Toolkit for use with Docker. (https://instinct.docs.amd.com/projects/container-toolkit/en/latest/container-runtime/quick-start-guide.html, https://instinct.docs.amd.com/projects/container-toolkit/en/latest/container-runtime/docker-swarm.html) +3. Git clone SwarmUI from McMonkey + + +How to run as a docker swarm: + +1. git clone https://github.com/mcmonkeyprojects/SwarmUI + +2. Install the AMD Container Toolkit (Ubuntu 24.04 works on Debian 13) + +3. Configure AMD Container Toolkit according to AMD's instructions. + +4. Modify /etc/docker/daemon.json to include the following changes: +{ + "default-runtime": "amd", + "features": { + "cdi": true + }, + "node-generic-resources": [ + "AMD_GPU=" + ], + "runtimes": { + "amd": { + "args": [], + "path": "amd-container-runtime" + } + } +} +To get the GPU UUID, run "sudo rocm-smi --showuniqueid -d " + +5. Download the edited example-docker-compose.yml and either rename it to docker-compose.yml or edit the next command + +6. run 'sudo HOST_UID="$(id -u)" HOST_GID="$(id -g)" docker stack deploy --compose-file launchtools/docker-compose.yml --detach=true swarmui' from the SwarmUI folder. Note: If you're using Portainer, the volumes will possibly appear blank. This is normal, it doesn't effect functionality. You must run this command on a cluster manager node, not a worker. From 3f430a92b9df91e6415016a16167288c1f8cea57 Mon Sep 17 00:00:00 2001 From: bigcletus Date: Sat, 18 Apr 2026 15:12:51 -0400 Subject: [PATCH 04/16] Rename example-docker-compose.yml to swarm-docker-compose.yml --- .../{example-docker-compose.yml => swarm-docker-compose.yml} | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename launchtools/{example-docker-compose.yml => swarm-docker-compose.yml} (100%) diff --git a/launchtools/example-docker-compose.yml b/launchtools/swarm-docker-compose.yml similarity index 100% rename from launchtools/example-docker-compose.yml rename to launchtools/swarm-docker-compose.yml From f5676f5cbe3d946841550c7cae001c3372e699a8 Mon Sep 17 00:00:00 2001 From: bigcletus Date: Sat, 18 Apr 2026 15:13:13 -0400 Subject: [PATCH 05/16] Rename swarm-docker-compose.yml to swarm-AMDGPU-docker-compose.yml --- .../{swarm-docker-compose.yml => swarm-AMDGPU-docker-compose.yml} | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename launchtools/{swarm-docker-compose.yml => swarm-AMDGPU-docker-compose.yml} (100%) diff --git a/launchtools/swarm-docker-compose.yml b/launchtools/swarm-AMDGPU-docker-compose.yml similarity index 100% rename from launchtools/swarm-docker-compose.yml rename to launchtools/swarm-AMDGPU-docker-compose.yml From ddb3459f1ae7793c03d72198155e01ab2292f8a8 Mon Sep 17 00:00:00 2001 From: bigcletus Date: Sat, 18 Apr 2026 15:13:38 -0400 Subject: [PATCH 06/16] Rename StandardDockerfile.docker to AMDGPU-StandardDockerfile.docker --- ...StandardDockerfile.docker => AMDGPU-StandardDockerfile.docker} | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename launchtools/{StandardDockerfile.docker => AMDGPU-StandardDockerfile.docker} (100%) diff --git a/launchtools/StandardDockerfile.docker b/launchtools/AMDGPU-StandardDockerfile.docker similarity index 100% rename from launchtools/StandardDockerfile.docker rename to launchtools/AMDGPU-StandardDockerfile.docker From 7f370397f2cfb3203abba2242d44c8a430acf856 Mon Sep 17 00:00:00 2001 From: bigcletus Date: Sat, 18 Apr 2026 15:14:19 -0400 Subject: [PATCH 07/16] Update swarm-AMDGPU-docker-compose.yml --- launchtools/swarm-AMDGPU-docker-compose.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/launchtools/swarm-AMDGPU-docker-compose.yml b/launchtools/swarm-AMDGPU-docker-compose.yml index 10b1f5e45..8ce839313 100644 --- a/launchtools/swarm-AMDGPU-docker-compose.yml +++ b/launchtools/swarm-AMDGPU-docker-compose.yml @@ -11,7 +11,7 @@ services: context: . args: UID: ${HOST_UID:-1000} - dockerfile: launchtools/StandardDockerfile.docker + dockerfile: launchtools/AMDGPU-StandardDockerfile.docker # uncomment `network_mode: host` if you want to access other services on the host network (eg a separated comfy instance) # network_mode: host volumes: From 3ceda2212f24c3b08397ef8bfe3c039b1f62b193 Mon Sep 17 00:00:00 2001 From: bigcletus Date: Sat, 18 Apr 2026 15:20:14 -0400 Subject: [PATCH 08/16] Update Docker Swarm README Updated command for new swarm-AMDGPU-docker-compose.yml filename --- launchtools/Docker Swarm README | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/launchtools/Docker Swarm README b/launchtools/Docker Swarm README index a86fe7887..052c5e62f 100644 --- a/launchtools/Docker Swarm README +++ b/launchtools/Docker Swarm README @@ -33,4 +33,4 @@ To get the GPU UUID, run "sudo rocm-smi --showuniqueid -d Date: Sat, 18 Apr 2026 15:24:01 -0400 Subject: [PATCH 09/16] Update AMDGPU-StandardDockerfile.docker Removed group "root" from swarmui user, it was redundant and less secure than the fix I already implemented (see "Set ROCm access" comment) --- launchtools/AMDGPU-StandardDockerfile.docker | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/launchtools/AMDGPU-StandardDockerfile.docker b/launchtools/AMDGPU-StandardDockerfile.docker index 34a601154..fcc3589db 100644 --- a/launchtools/AMDGPU-StandardDockerfile.docker +++ b/launchtools/AMDGPU-StandardDockerfile.docker @@ -36,7 +36,7 @@ RUN deluser ubuntu RUN useradd -u $UID swarmui # Add user to groups -RUN usermod -aG video,render,root swarmui +RUN usermod -aG video,render swarmui # If built binaries were copied in, discard them, they are likely bad. # Build inside the container later (so eg extensions are included properly). From 2a7a04475fefdf135838df438c714785d7151be8 Mon Sep 17 00:00:00 2001 From: bigcletus Date: Sat, 18 Apr 2026 15:27:42 -0400 Subject: [PATCH 10/16] Update Docker Swarm README --- launchtools/Docker Swarm README | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/launchtools/Docker Swarm README b/launchtools/Docker Swarm README index 052c5e62f..f047b322b 100644 --- a/launchtools/Docker Swarm README +++ b/launchtools/Docker Swarm README @@ -31,6 +31,5 @@ How to run as a docker swarm: } To get the GPU UUID, run "sudo rocm-smi --showuniqueid -d " -5. Download the edited example-docker-compose.yml and either rename it to docker-compose.yml or edit the next command - -6. run 'sudo HOST_UID="$(id -u)" HOST_GID="$(id -g)" docker stack deploy --compose-file launchtools/swarm-AMDGPU-docker-compose.yml --detach=true swarmui' from the SwarmUI folder. Note: If you're using Portainer, the volumes will possibly appear blank. This is normal, it doesn't effect functionality. You must run this command on a cluster manager node, not a worker. +5. run 'sudo HOST_UID="$(id -u)" HOST_GID="$(id -g)" docker stack deploy --compose-file launchtools/swarm-AMDGPU-docker-compose.yml --detach=true swarmui' from the SwarmUI folder. Note: If you're using Portainer, the volumes will possibly appear blank. This is normal, it doesn't effect functionality. You must run this command on a cluster manager node, not a worker. +Note: It's encouraged that you run your own docker registry and push the built image to it. This will save time and help keep all the containers synchronized across hosts. From 77a72fa19759c561e4d9982c6749fb88c83d6cca Mon Sep 17 00:00:00 2001 From: bigcletus Date: Sat, 18 Apr 2026 15:30:12 -0400 Subject: [PATCH 11/16] Create StandardDockerfile.docker Removed it originally --- launchtools/StandardDockerfile.docker | 31 +++++++++++++++++++++++++++ 1 file changed, 31 insertions(+) create mode 100644 launchtools/StandardDockerfile.docker diff --git a/launchtools/StandardDockerfile.docker b/launchtools/StandardDockerfile.docker new file mode 100644 index 000000000..0ec340f84 --- /dev/null +++ b/launchtools/StandardDockerfile.docker @@ -0,0 +1,31 @@ +FROM mcr.microsoft.com/dotnet/sdk:8.0-bookworm-slim + +ARG UID=1000 + +# Install python +RUN apt update +RUN apt install -y git wget build-essential python3.11 python3.11-venv python3.11-dev python3-pip ffmpeg + +# Install dependencies for controlnet preprocessors +RUN apt install -y libglib2.0-0 libgl1 + +# Copy swarm's files into the docker container +COPY . ./SwarmUI + +RUN chown -R $UID:$UID ./SwarmUI + +# Stupidproofing on git calls from inside docker +RUN git config --global --add safe.directory '*' + +# Ensure a user exists within docker for the given uid +RUN useradd -u $UID swarmui + +# If built binaries were copied in, discard them, they are likely bad. +# Build inside the container later (so eg extensions are included properly). +RUN rm -rf ./SwarmUI/src/bin ./SwarmUI/src/obj + +# Expose the port for other containers (to use Swarm as an API if you want) +EXPOSE 7801 + +# Set the run file to the launch script +ENTRYPOINT ["bash", "/SwarmUI/launchtools/docker-standard-inner.sh"] From 2a5a121b612788af6698d8d4a3c2d36053da040d Mon Sep 17 00:00:00 2001 From: bigcletus Date: Sat, 18 Apr 2026 15:31:00 -0400 Subject: [PATCH 12/16] Create example-docker-compose.yml Removed originally. --- launchtools/example-docker-compose.yml | 41 ++++++++++++++++++++++++++ 1 file changed, 41 insertions(+) create mode 100644 launchtools/example-docker-compose.yml diff --git a/launchtools/example-docker-compose.yml b/launchtools/example-docker-compose.yml new file mode 100644 index 000000000..35ccd8adf --- /dev/null +++ b/launchtools/example-docker-compose.yml @@ -0,0 +1,41 @@ +services: + swarmui: + image: swarmui + user: ${HOST_UID:-1000}:${HOST_GID:-1000} + cap_drop: + - ALL + build: + context: . + args: + UID: ${HOST_UID:-1000} + dockerfile: launchtools/StandardDockerfile.docker + container_name: swarmui + # uncomment `network_mode: host` if you want to access other services on the host network (eg a separated comfy instance) + # network_mode: host + volumes: + - swarmdata:/SwarmUI/Data + - swarmbackend:/SwarmUI/dlbackend + - swarmdlnodes:/SwarmUI/src/BuiltinExtensions/ComfyUIBackend/DLNodes + - swarmextensions:/SwarmUI/src/Extensions + - ./Models:/SwarmUI/Models + - ./Output:/SwarmUI/Output + - ./src/BuiltinExtensions/ComfyUIBackend/CustomWorkflows:/SwarmUI/src/BuiltinExtensions/ComfyUIBackend/CustomWorkflows + ports: + - "7801:7801" + deploy: + resources: + reservations: + devices: + - driver: nvidia + # change the count to the number of GPUs you want to use. + count: 1 + capabilities: [gpu] +volumes: + swarmdata: + name: swarmdata + swarmbackend: + name: swarmbackend + swarmdlnodes: + name: swarmdlnodes + swarmextensions: + name: swarmextensions From b6cc78d3a6ccc0b9a04f8e1f5580864fc1fd3487 Mon Sep 17 00:00:00 2001 From: bigcletus Date: Sat, 18 Apr 2026 16:59:28 -0400 Subject: [PATCH 13/16] Delete launchtools/Docker Swarm README --- launchtools/Docker Swarm README | 35 --------------------------------- 1 file changed, 35 deletions(-) delete mode 100644 launchtools/Docker Swarm README diff --git a/launchtools/Docker Swarm README b/launchtools/Docker Swarm README deleted file mode 100644 index f047b322b..000000000 --- a/launchtools/Docker Swarm README +++ /dev/null @@ -1,35 +0,0 @@ -Prerequisites: - -1. Install and configure an NFS Server on your LAN. -2. Install and configure AMD Container Toolkit for use with Docker. (https://instinct.docs.amd.com/projects/container-toolkit/en/latest/container-runtime/quick-start-guide.html, https://instinct.docs.amd.com/projects/container-toolkit/en/latest/container-runtime/docker-swarm.html) -3. Git clone SwarmUI from McMonkey - - -How to run as a docker swarm: - -1. git clone https://github.com/mcmonkeyprojects/SwarmUI - -2. Install the AMD Container Toolkit (Ubuntu 24.04 works on Debian 13) - -3. Configure AMD Container Toolkit according to AMD's instructions. - -4. Modify /etc/docker/daemon.json to include the following changes: -{ - "default-runtime": "amd", - "features": { - "cdi": true - }, - "node-generic-resources": [ - "AMD_GPU=" - ], - "runtimes": { - "amd": { - "args": [], - "path": "amd-container-runtime" - } - } -} -To get the GPU UUID, run "sudo rocm-smi --showuniqueid -d " - -5. run 'sudo HOST_UID="$(id -u)" HOST_GID="$(id -g)" docker stack deploy --compose-file launchtools/swarm-AMDGPU-docker-compose.yml --detach=true swarmui' from the SwarmUI folder. Note: If you're using Portainer, the volumes will possibly appear blank. This is normal, it doesn't effect functionality. You must run this command on a cluster manager node, not a worker. -Note: It's encouraged that you run your own docker registry and push the built image to it. This will save time and help keep all the containers synchronized across hosts. From f255e2dfd458c9734e0544d578090e3bfdb27bb1 Mon Sep 17 00:00:00 2001 From: bigcletus Date: Sat, 18 Apr 2026 17:04:16 -0400 Subject: [PATCH 14/16] Delete launchtools/swarm-AMDGPU-docker-compose.yml --- launchtools/swarm-AMDGPU-docker-compose.yml | 78 --------------------- 1 file changed, 78 deletions(-) delete mode 100644 launchtools/swarm-AMDGPU-docker-compose.yml diff --git a/launchtools/swarm-AMDGPU-docker-compose.yml b/launchtools/swarm-AMDGPU-docker-compose.yml deleted file mode 100644 index 8ce839313..000000000 --- a/launchtools/swarm-AMDGPU-docker-compose.yml +++ /dev/null @@ -1,78 +0,0 @@ -services: - swarmui: - image: swarmui:latest # You should build the image first. run "sudo docker build -f launchtools/StandardDockerfile.docker -t swarmui ." - # in the SwarmUI folder on the docker host. Optionally, push to your own registry so the Docker Swarm can deploy - # automatically from your registry. Otherwise, you must build this image on each worker/manager that will be running - # SwarmUI - user: ${HOST_UID:-1000}:${HOST_GID:-1000} - cap_drop: - - ALL - build: - context: . - args: - UID: ${HOST_UID:-1000} - dockerfile: launchtools/AMDGPU-StandardDockerfile.docker - # uncomment `network_mode: host` if you want to access other services on the host network (eg a separated comfy instance) - # network_mode: host - volumes: - - swarmui-data-sync:/SwarmUI/Data - - swarmui-dlbackend-sync:/SwarmUI/dlbackend - - swarmui-dlnodes-sync:/SwarmUI/src/BuiltinExtensions/ComfyUIBackend/DLNodes - - swarmui-extensions-sync:/SwarmUI/src/Extensions - - swarmui-models-sync:/SwarmUI/Models - - swarmui-output-sync:/SwarmUI/Output - - swarmui-comfyui-sync:/SwarmUI/src/BuiltinExtensions/ComfyUIBackend/CustomWorkflows - ports: - - "7801:7801" - deploy: - replicas: 1 - resources: - reservations: - generic_resources: - - discrete_resource_spec: - kind: 'AMD_GPU' # Matches daemon.json key - value: 0 # See https://instinct.docs.amd.com/projects/container-toolkit/en/latest/container-runtime/docker-swarm.html for Docker AMD GPU setup - -volumes: - swarmui-data-sync: - driver: local - driver_opts: - type: nfs - device: ":" - o: "addr=,nolock,soft,rw" - swarmui-dlbackend-sync: - driver: local - driver_opts: - type: nfs - device: ":" - o: "addr=,nolock,soft,rw" - swarmui-dlnodes-sync: - driver: local - driver_opts: - type: nfs - device: ":" - o: "addr=,nolock,soft,rw" - swarmui-extensions-sync: - driver: local - driver_opts: - type: nfs - device: ":" - o: "addr=,nolock,soft,rw" - swarmui-models-sync: - driver: local - driver_opts: - type: nfs - device: ":" - o: "addr=,nolock,soft,rw" - swarmui-comfyui-sync: - driver: local - driver_opts: - type: nfs - device: ":" - o: "addr=,nolock,soft,rw" - swarmui-output-sync: - driver: local - driver_opts: - type: nfs - device: ":" - o: "addr=,nolock,soft,rw" From 28bc6628ce029c4fcc9a294520ce2327f9f344f5 Mon Sep 17 00:00:00 2001 From: bigcletus Date: Sat, 18 Apr 2026 17:16:57 -0400 Subject: [PATCH 15/16] Update launch-standard-docker.sh --- launchtools/launch-standard-docker.sh | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/launchtools/launch-standard-docker.sh b/launchtools/launch-standard-docker.sh index 5853ea47d..c164e8474 100755 --- a/launchtools/launch-standard-docker.sh +++ b/launchtools/launch-standard-docker.sh @@ -1,14 +1,21 @@ #!/usr/bin/env bash - +GPU=="nvidia" # Note: This is an example file, do not edit `launch-standard-docker.sh`. Instead, duplicate the file and edit your duplicate. # `custom-launch-docker.sh` is reserved in gitignore for if you want to use that. # Run script automatically in Swarm's dir regardless of how it was triggered SCRIPT_DIR=$( cd -- "$( dirname -- "${BASH_SOURCE[0]}" )" &> /dev/null && pwd ) cd "$SCRIPT_DIR/.." +if [[ "$1" == "amd" ]] +then + GPU=="amd" + docker build --build-arg UID=$UID -f launchtools/AMDGPU-StandardDockerfile.docker -t swarmui . +fi -docker build --build-arg UID=$UID -f launchtools/StandardDockerfile.docker -t swarmui . - +if [[ "$1" == "nvidia" ]] +then + docker build --build-arg UID=$UID -f launchtools/StandardDockerfile.docker -t swarmui . +fi # Run this script with 'fixch' to run as root in the container and chown to the correct user SETUSER="--user $UID:$(id -g) --cap-drop=ALL" # TODO: Validate arg spacing handling @@ -18,7 +25,6 @@ then SETUSER="" POSTARG="fixch $UID" fi - # add "--network=host" if you want to access other services on the host network (eg a separated comfy instance) docker run -it \ --rm \ From 479c75cff8b10c1f6183ad4057312c10408ef759 Mon Sep 17 00:00:00 2001 From: bigcletus Date: Sat, 18 Apr 2026 20:38:05 -0400 Subject: [PATCH 16/16] Update launch-standard-docker.sh Added options to change between AMD and NVidia. Defaults to NVidia --- launchtools/launch-standard-docker.sh | 25 +++++++++++++++---------- 1 file changed, 15 insertions(+), 10 deletions(-) diff --git a/launchtools/launch-standard-docker.sh b/launchtools/launch-standard-docker.sh index c164e8474..c95df3cc3 100755 --- a/launchtools/launch-standard-docker.sh +++ b/launchtools/launch-standard-docker.sh @@ -1,29 +1,34 @@ #!/usr/bin/env bash -GPU=="nvidia" + # Note: This is an example file, do not edit `launch-standard-docker.sh`. Instead, duplicate the file and edit your duplicate. # `custom-launch-docker.sh` is reserved in gitignore for if you want to use that. # Run script automatically in Swarm's dir regardless of how it was triggered SCRIPT_DIR=$( cd -- "$( dirname -- "${BASH_SOURCE[0]}" )" &> /dev/null && pwd ) cd "$SCRIPT_DIR/.." -if [[ "$1" == "amd" ]] + +# Set default GPU +GPU="nvidia" + +if [[ $1 == "amd" ]] then - GPU=="amd" - docker build --build-arg UID=$UID -f launchtools/AMDGPU-StandardDockerfile.docker -t swarmui . + GPU="rocm" + docker build --build-arg UID=$UID -f launchtools/AMDGPU-StandardDockerfile.docker -t swarmui-rocm . +else + docker build --build-arg UID=$UID -f launchtools/StandardDockerfile.docker -t swarmui-nvidia . fi -if [[ "$1" == "nvidia" ]] +if [[ $1 != "fixch" ]] then - docker build --build-arg UID=$UID -f launchtools/StandardDockerfile.docker -t swarmui . + shift # Remove the GPU ID arg to prevent bugs fi # Run this script with 'fixch' to run as root in the container and chown to the correct user SETUSER="--user $UID:$(id -g) --cap-drop=ALL" -# TODO: Validate arg spacing handling -POSTARG="--forward_restart $@" +POSTARG=("--forward_restart" "$@") if [[ "$1" == "fixch" ]] then SETUSER="" - POSTARG="fixch $UID" + POSTARG=("fixch" "$UID") fi # add "--network=host" if you want to access other services on the host network (eg a separated comfy instance) docker run -it \ @@ -37,7 +42,7 @@ docker run -it \ -v "$PWD/Models:/SwarmUI/Models" \ -v "$PWD/Output:/SwarmUI/Output" \ -v "$PWD/src/BuiltinExtensions/ComfyUIBackend/CustomWorkflows:/SwarmUI/src/BuiltinExtensions/ComfyUIBackend/CustomWorkflows" \ - --gpus=all -p 7801:7801 swarmui "$POSTARG" + --gpus=all -p 7801:7801 swarmui-"$GPU" "${POSTARG[@]}" if [ $? == 42 ]; then exec "$SCRIPT_DIR/launch-standard-docker.sh" "$@"