diff --git a/utils/socket_activation/README.md b/utils/socket_activation/README.md index 7fcdc218..0e45fff4 100644 --- a/utils/socket_activation/README.md +++ b/utils/socket_activation/README.md @@ -21,6 +21,7 @@ podman build -t localhost/comfy:latest . Place comfy.socket in ` ~/.config/systemd/user`, adjust ports and interfaces if needed. Place comfy.container in `~/.config/containers/systemd`. Adjust paths for models and config if desired. +**Important: if you set up multiple instances with multiple ROCM devices, adjust the VISIBLE_DEVICES environment variable in the service units** The files are in `utils/socket_activation`, next to this readme. Put model files into the models directory (`~/models`). diff --git a/utils/socket_activation/comfy.container b/utils/socket_activation/comfy.container index c59b9b17..8e7f8940 100644 --- a/utils/socket_activation/comfy.container +++ b/utils/socket_activation/comfy.container @@ -1,13 +1,16 @@ [Unit] Description=Comfy ui in a ROCM container -After=network-online.target -Wants=network-online.target +After=comfy.socket +Requires=comfy.socket + [Container] Image=localhost/comfy:latest #AutoRemove=yes #PublishPort=8080:8080 -Environment=ROCR_VISIBLE_DEVICES="GGPU-3b0c81617337ec1b" +# UUID given by ROCM-Info, uncomment to restrict to a particular device +# Alternatively can use numeric ID +#Environment=ROCR_VISIBLE_DEVICES="GGPU-3b0c81617337ec1b" Network=none Volume=%h/comfy/models:/comfyui/models:ro,z Volume=%h/comfy/input:/comfyui/input:Z diff --git a/utils/socket_activation/comfy2.container b/utils/socket_activation/comfy2.container index 8be303e0..e4c40694 100644 --- a/utils/socket_activation/comfy2.container +++ b/utils/socket_activation/comfy2.container @@ -1,13 +1,15 @@ [Unit] Description=Comfy ui in a ROCM container -After=network-online.target -Wants=network-online.target +After=comfy2.socket +Requires=comfy2.socket [Container] Image=localhost/comfy:latest #AutoRemove=yes #PublishPort=8080:8080 Network=none + +# Adjust UUID or device number Environment=ROCR_VISIBLE_DEVICES="GPU-3ce290c173497dfb" Volume=%h/comfy/models:/comfyui/models:ro,z Volume=%h/comfy/input2:/comfyui/input:Z