# Tensors + ComfyUI for AMD ROCm (local testing) # tensors API exposed, ComfyUI internal only FROM saiden/sd-rocm WORKDIR /workspace # Install git and curl RUN apt-get update && apt-get install -y --no-install-recommends git curl && \ rm -rf /var/lib/apt/lists/* # Install ComfyUI RUN git clone https://github.com/comfyanonymous/ComfyUI.git && \ cd ComfyUI && \ pip install --break-system-packages -r requirements.txt # Install ComfyUI Manager RUN cd /workspace/ComfyUI/custom_nodes && \ git clone https://github.com/ltdrdata/ComfyUI-Manager.git && \ cd ComfyUI-Manager && \ pip install --break-system-packages -r requirements.txt # Install tensors with server dependencies COPY . /tmp/tensors RUN pip install --break-system-packages /tmp/tensors'[server]' && \ rm -rf /tmp/tensors # Configure tensors RUN mkdir -p /root/.config/tensors && \ cat > /root/.config/tensors/config.toml << 'EOF' [paths] models_dir = "/workspace/ComfyUI/models" checkpoints = "/workspace/ComfyUI/models/checkpoints" loras = "/workspace/ComfyUI/models/loras" vae = "/workspace/ComfyUI/models/vae" embeddings = "/workspace/ComfyUI/models/embeddings" [comfyui] url = "http://127.0.0.1:8188" EOF # Startup script: ComfyUI internal + tensors API exposed RUN cat > /workspace/start.sh << 'EOF' #!/bin/bash # Start ComfyUI in background (internal only, localhost) python /workspace/ComfyUI/main.py --listen 127.0.0.1 --port 8188 & # Wait for ComfyUI to be ready echo "Waiting for ComfyUI..." until curl -s http://127.0.0.1:8188/system_stats > /dev/null 2>&1; do sleep 1 done echo "ComfyUI ready" # Start tensors API (exposed) exec tsr serve --host 0.0.0.0 --port 8080 EOF RUN chmod +x /workspace/start.sh # Only expose tensors API EXPOSE 8080 CMD ["/workspace/start.sh"]