diff --git a/.github/workflows/docker-publish.yml b/.github/workflows/docker-publish.yml new file mode 100644 index 0000000..14e533b --- /dev/null +++ b/.github/workflows/docker-publish.yml @@ -0,0 +1,61 @@ +name: Build and Publish Docker Image + +on: + push: + branches: + - main + tags: + - "v*" + pull_request: + branches: + - main + workflow_dispatch: + +env: + REGISTRY: ghcr.io + IMAGE_NAME: ${{ github.repository }} + +jobs: + build-and-push: + runs-on: ubuntu-latest + permissions: + contents: read + packages: write + + steps: + - name: Checkout repository + uses: actions/checkout@v4 + + - name: Set up Docker Buildx + uses: docker/setup-buildx-action@v3 + + - name: Log in to Container Registry + if: github.event_name != 'pull_request' + uses: docker/login-action@v3 + with: + registry: ${{ env.REGISTRY }} + username: ${{ github.actor }} + password: ${{ secrets.GITHUB_TOKEN }} + + - name: Extract metadata (tags, labels) + id: meta + uses: docker/metadata-action@v5 + with: + images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }} + tags: | + type=ref,event=branch + type=semver,pattern={{version}} + type=semver,pattern={{major}}.{{minor}} + type=sha,prefix= + type=raw,value=latest,enable={{is_default_branch}} + + - name: Build and push Docker image + uses: docker/build-push-action@v5 + with: + context: . + file: ./Containerfile + push: ${{ github.event_name != 'pull_request' }} + tags: ${{ steps.meta.outputs.tags }} + labels: ${{ steps.meta.outputs.labels }} + cache-from: type=gha + cache-to: type=gha,mode=max diff --git a/README.md b/README.md new file mode 100644 index 0000000..a3fcae6 --- /dev/null +++ b/README.md @@ -0,0 +1,75 @@ +# ComfyUI for Framework Desktop AI MAX + +A containerized setup for running [ComfyUI](https://github.com/comfyanonymous/ComfyUI) on the Framework Desktop AI MAX with AMD Ryzen AI MAX (Strix Halo) and integrated Radeon graphics. + +## Requirements + +- Framework Desktop AI MAX +- Docker with Compose plugin +- ROCm-compatible kernel and drivers + +## Quick Start + +1. **Build and start the container:** + + ```bash + docker compose up -d --build + ``` + +2. **Access the UI:** + + Open your browser and navigate to `http://localhost:8188` + +3. **View logs:** + + ```bash + docker compose logs -f comfyui + ``` + +4. **Stop the container:** + + ```bash + docker compose down + ``` + +## Directory Structure + +- `models/` — Place your model files here (checkpoints, VAE, LoRAs, etc.) +- `output/` — Generated images and videos are saved here + +## Environment Variables + +The Containerfile sets several ROCm-specific environment variables for Strix Halo compatibility: + +| Variable | Value | Description | +| -------------------------- | --------------------------- | -------------------------------------------------------- | +| `HSA_OVERRIDE_GFX_VERSION` | `11.5.1` | Forces ROCm to recognize gfx1151 (Strix Halo) | +| `HSA_ENABLE_SDMA` | `0` | Disables System DMA engine to avoid compatibility issues | +| `ROCBLAS_USE_HIPBLASLT` | `1` | Enables optimized BLAS library for better performance | +| `PYTORCH_HIP_ALLOC_CONF` | `expandable_segments:False` | Uses simpler memory allocation for stability | + +## Included Custom Nodes + +- [ComfyUI-Manager](https://github.com/ltdrdata/ComfyUI-Manager) — Node management and installation +- [ComfyUI-WanVideoWrapper](https://github.com/kijai/ComfyUI-WanVideoWrapper) — WAN 2.1 video generation +- [ComfyUI-VideoHelperSuite](https://github.com/Kosinkadink/ComfyUI-VideoHelperSuite) — Video utilities + +## Troubleshooting + +### Segmentation faults during model loading + +Ensure the ROCm base image version matches the PyTorch ROCm wheels. Mismatched versions cause ABI incompatibilities. + +### GPU not detected + +Verify that `/dev/kfd` and `/dev/dri` are accessible and your user is in the `video` and `render` groups: + +```bash +sudo usermod -aG video,render $USER +``` + +Log out and back in for the group changes to take effect. + +### Performance issues + +If using `HIP_LAUNCH_BLOCKING=1` for debugging, remember to remove it for normal use — it forces synchronous execution and significantly reduces performance. diff --git a/compose.yaml b/compose.yaml index 9f752a1..8920d97 100644 --- a/compose.yaml +++ b/compose.yaml @@ -13,12 +13,6 @@ services: ipc: host network_mode: host restart: unless-stopped - environment: - HSA_OVERRIDE_GFX_VERSION: 11.5.1 - HSA_ENABLE_SDMA: 0 - ROCBLAS_USE_HIPBLASLT: 1 - PYTORCH_HIP_ALLOC_CONF: expandable_segments:False - HIP_LAUNCH_BLOCKING: 1 volumes: - ./models:/workspace/ComfyUI/models - ./output:/workspace/ComfyUI/output