From e6e8d0dad7b6dba34d2a492146b2633485df6189 Mon Sep 17 00:00:00 2001 From: Xe Iaso Date: Tue, 14 Jan 2025 11:48:07 -0500 Subject: [PATCH] add models and autobuild Signed-off-by: Xe Iaso --- .github/workflows/docker-build.yml | 55 ++++++++++++++++++++++++++++++ Dockerfile | 2 ++ models/checkpoints/.gitignore | 2 ++ models/embeddings/.gitignore | 2 ++ models/loras/.gitignore | 2 ++ models/vae/.gitignore | 2 ++ 6 files changed, 65 insertions(+) create mode 100644 .github/workflows/docker-build.yml create mode 100644 models/checkpoints/.gitignore create mode 100644 models/embeddings/.gitignore create mode 100644 models/loras/.gitignore create mode 100644 models/vae/.gitignore diff --git a/.github/workflows/docker-build.yml b/.github/workflows/docker-build.yml new file mode 100644 index 0000000..0d19dcd --- /dev/null +++ b/.github/workflows/docker-build.yml @@ -0,0 +1,55 @@ +name: Create and publish a Docker image to GitHub Container Registry + +on: + push: + branches: ['main'] + +env: + REGISTRY: ghcr.io + OWNER: xeserv + IMAGE_NAME: ${{ github.repository }} + AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }} + AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }} + AWS_ENDPOINT_URL_S3: https://fly.storage.tigris.dev + AWS_ENDPOINT_URL_IAM: https://fly.iam.storage.tigris.dev + AWS_REGION: auto + +jobs: + build-and-push-image: + runs-on: ubuntu-latest + permissions: + contents: read + packages: write + + steps: + - name: Checkout repository + uses: actions/checkout@v3 + + - name: Log in to the Container registry + uses: docker/login-action@v2 + with: + registry: ${{ env.REGISTRY }} + username: ${{ env.OWNER }} + password: ${{ secrets.GITHUB_TOKEN }} + + - id: install-aws-cli + uses: unfor19/install-aws-cli-action@v1 + with: + arch: amd64 + + - name: Extract metadata (tags, labels) for Docker + id: meta + uses: docker/metadata-action@v4 + with: + images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }} + + - run: | + aws s3 sync s3://waifuwave/models models + + - name: Build and push Docker image + uses: docker/build-push-action@v4 + with: + context: . + push: true + tags: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }} + labels: ${{ steps.meta.outputs.labels }} diff --git a/Dockerfile b/Dockerfile index 777639c..0ecd9a4 100644 --- a/Dockerfile +++ b/Dockerfile @@ -13,4 +13,6 @@ COPY waifuwave.py . COPY fetch_models.py . COPY startup.sh . +COPY models /opt/comfyui/models + CMD ["/opt/comfyui/startup.sh"] \ No newline at end of file diff --git a/models/checkpoints/.gitignore b/models/checkpoints/.gitignore new file mode 100644 index 0000000..0015227 --- /dev/null +++ b/models/checkpoints/.gitignore @@ -0,0 +1,2 @@ +*.safetensors +*.pt \ No newline at end of file diff --git a/models/embeddings/.gitignore b/models/embeddings/.gitignore new file mode 100644 index 0000000..0015227 --- /dev/null +++ b/models/embeddings/.gitignore @@ -0,0 +1,2 @@ +*.safetensors +*.pt \ No newline at end of file diff --git a/models/loras/.gitignore b/models/loras/.gitignore new file mode 100644 index 0000000..0015227 --- /dev/null +++ b/models/loras/.gitignore @@ -0,0 +1,2 @@ +*.safetensors +*.pt \ No newline at end of file diff --git a/models/vae/.gitignore b/models/vae/.gitignore new file mode 100644 index 0000000..0015227 --- /dev/null +++ b/models/vae/.gitignore @@ -0,0 +1,2 @@ +*.safetensors +*.pt \ No newline at end of file