mirror of
https://github.com/invoke-ai/InvokeAI
synced 2024-08-30 20:32:17 +00:00
Merge branch 'main' into dev/diffusers
This commit is contained in:
commit
0390e6740d
47
.github/workflows/build-cloud-img.yml
vendored
47
.github/workflows/build-cloud-img.yml
vendored
@ -4,9 +4,12 @@ on:
|
|||||||
push:
|
push:
|
||||||
branches:
|
branches:
|
||||||
- main
|
- main
|
||||||
- development
|
|
||||||
tags:
|
tags:
|
||||||
- v*
|
- v*
|
||||||
|
# we will NOT push the image on pull requests, only test buildability.
|
||||||
|
pull_request:
|
||||||
|
branches:
|
||||||
|
- main
|
||||||
|
|
||||||
permissions:
|
permissions:
|
||||||
contents: read
|
contents: read
|
||||||
@ -21,36 +24,56 @@ jobs:
|
|||||||
strategy:
|
strategy:
|
||||||
fail-fast: false
|
fail-fast: false
|
||||||
matrix:
|
matrix:
|
||||||
# only x86_64 for now. aarch64+cuda isn't really a thing yet
|
|
||||||
arch:
|
arch:
|
||||||
- x86_64
|
- x86_64
|
||||||
|
# requires resolving a patchmatch issue
|
||||||
|
# - aarch64
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
name: ${{ matrix.arch }}
|
name: ${{ matrix.arch }}
|
||||||
steps:
|
steps:
|
||||||
- name: Checkout
|
- name: Checkout
|
||||||
uses: actions/checkout@v3
|
uses: actions/checkout@v3
|
||||||
|
|
||||||
|
- name: Set up QEMU
|
||||||
|
uses: docker/setup-qemu-action@v2
|
||||||
|
if: matrix.arch == 'aarch64'
|
||||||
|
|
||||||
- name: Docker meta
|
- name: Docker meta
|
||||||
id: meta
|
id: meta
|
||||||
uses: docker/metadata-action@v4
|
uses: docker/metadata-action@v4
|
||||||
with:
|
with:
|
||||||
images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}
|
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)
|
||||||
|
# :<tag>
|
||||||
|
# :1.2.3 (for semver tags)
|
||||||
|
# :1.2 (for semver tags)
|
||||||
|
# :<sha>
|
||||||
tags: |
|
tags: |
|
||||||
|
type=edge,branch=main
|
||||||
type=ref,event=branch
|
type=ref,event=branch
|
||||||
type=ref,event=tag
|
type=ref,event=tag
|
||||||
type=ref,event=pr
|
type=semver,pattern={{version}}
|
||||||
|
type=semver,pattern={{major}}.{{minor}}
|
||||||
type=sha
|
type=sha
|
||||||
|
# suffix image tags with architecture
|
||||||
|
flavor: |
|
||||||
|
latest=auto
|
||||||
|
suffix=-${{ matrix.arch }},latest=true
|
||||||
|
|
||||||
- name: Set up Docker Buildx
|
- name: Set up Docker Buildx
|
||||||
uses: docker/setup-buildx-action@v2
|
uses: docker/setup-buildx-action@v2
|
||||||
|
|
||||||
# - if: github.event_name != 'pull_request'
|
# do not login to container registry on PRs
|
||||||
# name: Docker login
|
- if: github.event_name != 'pull_request'
|
||||||
# uses: docker/login-action@v2
|
name: Docker login
|
||||||
# with:
|
uses: docker/login-action@v2
|
||||||
# registry: ghcr.io
|
with:
|
||||||
# username: ${{ github.actor }}
|
registry: ghcr.io
|
||||||
# password: ${{ secrets.GITHUB_TOKEN }}
|
username: ${{ github.actor }}
|
||||||
|
password: ${{ secrets.GITHUB_TOKEN }}
|
||||||
|
|
||||||
- name: Build and push cloud image
|
- name: Build and push cloud image
|
||||||
uses: docker/build-push-action@v3
|
uses: docker/build-push-action@v3
|
||||||
@ -58,7 +81,7 @@ jobs:
|
|||||||
context: .
|
context: .
|
||||||
file: docker-build/Dockerfile.cloud
|
file: docker-build/Dockerfile.cloud
|
||||||
platforms: Linux/${{ matrix.arch }}
|
platforms: Linux/${{ matrix.arch }}
|
||||||
# push: ${{ github.event_name != 'pull_request' }}
|
# do not push the image on PRs
|
||||||
push: false
|
push: ${{ github.event_name != 'pull_request' }}
|
||||||
tags: ${{ steps.meta.outputs.tags }}
|
tags: ${{ steps.meta.outputs.tags }}
|
||||||
labels: ${{ steps.meta.outputs.labels }}
|
labels: ${{ steps.meta.outputs.labels }}
|
||||||
|
@ -2,12 +2,10 @@
|
|||||||
title: Running InvokeAI on Google Colab using a Jupyter Notebook
|
title: Running InvokeAI on Google Colab using a Jupyter Notebook
|
||||||
---
|
---
|
||||||
|
|
||||||
# THIS DOCUMENTATION IS UNFINISHED - VOLUNTEERS GRATEFULLY ACCEPTED
|
|
||||||
|
|
||||||
## Introduction
|
## Introduction
|
||||||
|
|
||||||
We have a [Jupyter
|
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
|
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
|
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
|
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"
|
!!! 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
|
||||||
|
@ -266,7 +266,9 @@ class ModelCache(object):
|
|||||||
model_hash = self._cached_sha256(weights, weight_bytes)
|
model_hash = self._cached_sha256(weights, weight_bytes)
|
||||||
sd = torch.load(io.BytesIO(weight_bytes), map_location='cpu')
|
sd = torch.load(io.BytesIO(weight_bytes), map_location='cpu')
|
||||||
del weight_bytes
|
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 = instantiate_from_config(omega_config.model)
|
||||||
model.load_state_dict(sd, strict=False)
|
model.load_state_dict(sd, strict=False)
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user