From 1fc1eeec388f77917408b7ac0ed094d683bc3b96 Mon Sep 17 00:00:00 2001 From: Eugene Brodsky Date: Wed, 7 Dec 2022 08:03:33 -0500 Subject: [PATCH 1/3] Fix `docker push` github action and expand with additional metadata (#1837) * update docker build (cloud) action with additional metadata, new labels * (docker) also add aarch64 cloud build and remove arch suffix * (docker) architecture suffix is needed for now * (docker) don't build aarch64 for now --- .github/workflows/build-cloud-img.yml | 47 ++++++++++++++++++++------- 1 file changed, 35 insertions(+), 12 deletions(-) diff --git a/.github/workflows/build-cloud-img.yml b/.github/workflows/build-cloud-img.yml index 94094c9c56..9ef41a26c3 100644 --- a/.github/workflows/build-cloud-img.yml +++ b/.github/workflows/build-cloud-img.yml @@ -4,9 +4,12 @@ on: push: branches: - main - - development tags: - v* + # we will NOT push the image on pull requests, only test buildability. + pull_request: + branches: + - main permissions: contents: read @@ -21,36 +24,56 @@ jobs: strategy: fail-fast: false matrix: - # only x86_64 for now. aarch64+cuda isn't really a thing yet arch: - x86_64 + # requires resolving a patchmatch issue + # - aarch64 runs-on: ubuntu-latest name: ${{ matrix.arch }} steps: - name: Checkout uses: actions/checkout@v3 + - name: Set up QEMU + uses: docker/setup-qemu-action@v2 + if: matrix.arch == 'aarch64' + - name: Docker meta id: meta uses: docker/metadata-action@v4 with: images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }} + # see https://github.com/docker/metadata-action + # will push the following tags: + # :edge + # :main (+ any other branches enabled in the workflow) + # : + # :1.2.3 (for semver tags) + # :1.2 (for semver tags) + # : tags: | + type=edge,branch=main type=ref,event=branch type=ref,event=tag - type=ref,event=pr + type=semver,pattern={{version}} + type=semver,pattern={{major}}.{{minor}} type=sha + # suffix image tags with architecture + flavor: | + latest=auto + suffix=-${{ matrix.arch }},latest=true - name: Set up Docker Buildx uses: docker/setup-buildx-action@v2 - # - if: github.event_name != 'pull_request' - # name: Docker login - # uses: docker/login-action@v2 - # with: - # registry: ghcr.io - # username: ${{ github.actor }} - # password: ${{ secrets.GITHUB_TOKEN }} + # do not login to container registry on PRs + - if: github.event_name != 'pull_request' + name: Docker login + uses: docker/login-action@v2 + with: + registry: ghcr.io + username: ${{ github.actor }} + password: ${{ secrets.GITHUB_TOKEN }} - name: Build and push cloud image uses: docker/build-push-action@v3 @@ -58,7 +81,7 @@ jobs: context: . file: docker-build/Dockerfile.cloud platforms: Linux/${{ matrix.arch }} - # push: ${{ github.event_name != 'pull_request' }} - push: false + # do not push the image on PRs + push: ${{ github.event_name != 'pull_request' }} tags: ${{ steps.meta.outputs.tags }} labels: ${{ steps.meta.outputs.labels }} From 04e77f3858b927012d20a13500089dd71b462033 Mon Sep 17 00:00:00 2001 From: Vedant Madane <6527493+VedantMadane@users.noreply.github.com> Date: Tue, 6 Dec 2022 13:03:10 +0530 Subject: [PATCH 2/3] Fix Broken Link To Notebook * The link pointed to https://github.com/invoke-ai/InvokeAI/blob/main/notebooks/Stable-Diffusion-local-Windows.ipynb which does not exist so it has been replaced with https://github.com/invoke-ai/InvokeAI/blob/main/notebooks/Stable_Diffusion_AI_Notebook.ipynb * Add buttons for running on Colab * Tried adding running InvokeAI on Binder but the error was: ERROR: Ignored the following versions that require a different python version: 0.55.2 Requires-Python <3.5 ERROR: Could not find a version that satisfies the requirement clipseg (from invokeai) (from versions: none) ERROR: No matching distribution found for clipseg Removing intermediate container 25be65428187 The command '/bin/sh -c ${KERNEL_PYTHON_PREFIX}/bin/pip install --no-cache-dir .' returned a non-zero code: 1 `## Running Online On JupyterHub Binder [![Binder](https://mybinder.org/badge_logo.svg)](https://mybinder.org/v2/gh/invoke-ai/InvokeAI/main?labpath=https%3A%2F%2Fgithub.com%2Finvoke-ai%2FInvokeAI%2Fblob%2Fmain%2Fnotebooks%2FStable_Diffusion_AI_Notebook.ipynb)` This will have to be added for having the Launch | Binder button after it runs properly. --- docs/installation/INSTALL_JUPYTER.md | 21 ++++++++++++++------- 1 file changed, 14 insertions(+), 7 deletions(-) diff --git a/docs/installation/INSTALL_JUPYTER.md b/docs/installation/INSTALL_JUPYTER.md index 369ca818f3..d3a830b395 100644 --- a/docs/installation/INSTALL_JUPYTER.md +++ b/docs/installation/INSTALL_JUPYTER.md @@ -2,12 +2,10 @@ title: Running InvokeAI on Google Colab using a Jupyter Notebook --- -# THIS DOCUMENTATION IS UNFINISHED - VOLUNTEERS GRATEFULLY ACCEPTED - ## Introduction We have a [Jupyter -notebook](https://github.com/invoke-ai/InvokeAI/blob/main/notebooks/Stable-Diffusion-local-Windows.ipynb) +notebook](https://github.com/invoke-ai/InvokeAI/blob/main/notebooks/Stable_Diffusion_AI_Notebook.ipynb) with cell-by-cell installation steps. It will download the code in this repo as one of the steps, so instead of cloning this repo, simply download the notebook from the link above and load it up in VSCode @@ -16,10 +14,19 @@ start running the cells one-by-one. !!! Note "you will need NVIDIA drivers, Python 3.10, and Git installed beforehand" -## Walkthrough +## Running Online On Google Colabotary +[![Open in Colab](https://colab.research.google.com/assets/colab-badge.svg)](https://colab.research.google.com/github/invoke-ai/InvokeAI/blob/main/notebooks/Stable_Diffusion_AI_Notebook.ipynb) -## Updating to newer versions +## Running Locally (Cloning) -### Updating the stable version +1. Install the Jupyter Notebook python library (one-time): +pip install jupyter -## Troubleshooting +2. Clone the InvokeAI repository: +git clone https://github.com/invoke-ai/InvokeAI.git +cd invoke-ai +3. Create a virtual environment using conda: +conda create -n invoke jupyter +4. Activate the environment and start the Jupyter notebook: +conda activate invoke +jupyter notebook From 42f5bd4e12e7418d77b0e7ea6bd64ebfb9523794 Mon Sep 17 00:00:00 2001 From: spezialspezial <75758219+spezialspezial@users.noreply.github.com> Date: Sat, 3 Dec 2022 22:01:43 +0100 Subject: [PATCH 3/3] Account for flat models Merged models from auto11 merge board are flat for some reason. Current behavior of invoke is not changed by this modification. --- ldm/invoke/model_cache.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/ldm/invoke/model_cache.py b/ldm/invoke/model_cache.py index 7d1654718a..f937b7eae5 100644 --- a/ldm/invoke/model_cache.py +++ b/ldm/invoke/model_cache.py @@ -227,7 +227,9 @@ class ModelCache(object): model_hash = self._cached_sha256(weights,weight_bytes) sd = torch.load(io.BytesIO(weight_bytes), map_location='cpu') del weight_bytes - sd = sd['state_dict'] + # merged models from auto11 merge board are flat for some reason + if 'state_dict' in sd: + sd = sd['state_dict'] model = instantiate_from_config(omega_config.model) model.load_state_dict(sd, strict=False)