mirror of
https://github.com/invoke-ai/InvokeAI
synced 2024-08-30 20:32:17 +00:00
Merge remote-tracking branch 'origin/main' into dev/diffusers
# Conflicts: # .github/workflows/test-invoke-conda.yml # .github/workflows/test-invoke-pip.yml # environments-and-requirements/requirements-base.txt
This commit is contained in:
commit
a3e41d63ec
24
.github/workflows/test-invoke-conda.yml
vendored
24
.github/workflows/test-invoke-conda.yml
vendored
@ -4,7 +4,6 @@ on:
|
|||||||
branches:
|
branches:
|
||||||
- 'main'
|
- 'main'
|
||||||
- 'development'
|
- 'development'
|
||||||
- 'fix-gh-actions-fork'
|
|
||||||
pull_request:
|
pull_request:
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
@ -17,16 +16,24 @@ jobs:
|
|||||||
- environment-lin-amd.yml
|
- environment-lin-amd.yml
|
||||||
- environment-lin-cuda.yml
|
- environment-lin-cuda.yml
|
||||||
- environment-mac.yml
|
- environment-mac.yml
|
||||||
|
- environment-win-cuda.yml
|
||||||
include:
|
include:
|
||||||
- environment-yaml: environment-lin-amd.yml
|
- environment-yaml: environment-lin-amd.yml
|
||||||
os: ubuntu-latest
|
os: ubuntu-22.04
|
||||||
|
github-env: $GITHUB_ENV
|
||||||
default-shell: bash -l {0}
|
default-shell: bash -l {0}
|
||||||
- environment-yaml: environment-lin-cuda.yml
|
- environment-yaml: environment-lin-cuda.yml
|
||||||
os: ubuntu-latest
|
os: ubuntu-22.04
|
||||||
|
github-env: $GITHUB_ENV
|
||||||
default-shell: bash -l {0}
|
default-shell: bash -l {0}
|
||||||
- environment-yaml: environment-mac.yml
|
- environment-yaml: environment-mac.yml
|
||||||
os: macos-12
|
os: macos-12
|
||||||
|
github-env: $GITHUB_ENV
|
||||||
default-shell: bash -l {0}
|
default-shell: bash -l {0}
|
||||||
|
- environment-yaml: environment-win-cuda.yml
|
||||||
|
os: windows-2022
|
||||||
|
github-env: $env:GITHUB_ENV
|
||||||
|
default-shell: pwsh
|
||||||
name: ${{ matrix.environment-yaml }} on ${{ matrix.os }}
|
name: ${{ matrix.environment-yaml }} on ${{ matrix.os }}
|
||||||
runs-on: ${{ matrix.os }}
|
runs-on: ${{ matrix.os }}
|
||||||
env:
|
env:
|
||||||
@ -76,15 +83,15 @@ jobs:
|
|||||||
|
|
||||||
- name: set test prompt to main branch validation
|
- name: set test prompt to main branch validation
|
||||||
if: ${{ github.ref == 'refs/heads/main' }}
|
if: ${{ github.ref == 'refs/heads/main' }}
|
||||||
run: echo "TEST_PROMPTS=tests/preflight_prompts.txt" >> $GITHUB_ENV
|
run: echo "TEST_PROMPTS=tests/preflight_prompts.txt" >> ${{ matrix.github-env }}
|
||||||
|
|
||||||
- name: set test prompt to development branch validation
|
- name: set test prompt to development branch validation
|
||||||
if: ${{ github.ref == 'refs/heads/development' }}
|
if: ${{ github.ref == 'refs/heads/development' }}
|
||||||
run: echo "TEST_PROMPTS=tests/dev_prompts.txt" >> $GITHUB_ENV
|
run: echo "TEST_PROMPTS=tests/dev_prompts.txt" >> ${{ matrix.github-env }}
|
||||||
|
|
||||||
- name: set test prompt to Pull Request validation
|
- name: set test prompt to Pull Request validation
|
||||||
if: ${{ github.ref != 'refs/heads/main' && github.ref != 'refs/heads/development' }}
|
if: ${{ github.ref != 'refs/heads/main' && github.ref != 'refs/heads/development' }}
|
||||||
run: echo "TEST_PROMPTS=tests/validate_pr_prompt.txt" >> $GITHUB_ENV
|
run: echo "TEST_PROMPTS=tests/validate_pr_prompt.txt" >> ${{ matrix.github-env }}
|
||||||
|
|
||||||
- name: run configure_invokeai.py
|
- name: run configure_invokeai.py
|
||||||
id: run-preload-models
|
id: run-preload-models
|
||||||
@ -103,6 +110,7 @@ jobs:
|
|||||||
|
|
||||||
- name: Run the tests
|
- name: Run the tests
|
||||||
id: run-tests
|
id: run-tests
|
||||||
|
if: matrix.os != 'windows-2022'
|
||||||
env:
|
env:
|
||||||
# Set offline mode to make sure configure preloaded successfully.
|
# Set offline mode to make sure configure preloaded successfully.
|
||||||
HF_HUB_OFFLINE: 1
|
HF_HUB_OFFLINE: 1
|
||||||
@ -119,11 +127,13 @@ jobs:
|
|||||||
|
|
||||||
- name: export conda env
|
- name: export conda env
|
||||||
id: export-conda-env
|
id: export-conda-env
|
||||||
|
if: matrix.os != 'windows-2022'
|
||||||
run: |
|
run: |
|
||||||
mkdir -p outputs/img-samples
|
mkdir -p outputs/img-samples
|
||||||
conda env export --name ${{ env.CONDA_ENV_NAME }} > outputs/img-samples/environment-${{ runner.os }}-${{ runner.arch }}.yml
|
conda env export --name ${{ env.CONDA_ENV_NAME }} > ${{ env.INVOKEAI_ROOT }}/outputs/environment-${{ runner.os }}-${{ runner.arch }}.yml
|
||||||
|
|
||||||
- name: Archive results
|
- name: Archive results
|
||||||
|
if: matrix.os != 'windows-2022'
|
||||||
id: archive-results
|
id: archive-results
|
||||||
uses: actions/upload-artifact@v3
|
uses: actions/upload-artifact@v3
|
||||||
with:
|
with:
|
||||||
|
49
.github/workflows/test-invoke-pip.yml
vendored
49
.github/workflows/test-invoke-pip.yml
vendored
@ -16,24 +16,25 @@ jobs:
|
|||||||
- requirements-lin-cuda.txt
|
- requirements-lin-cuda.txt
|
||||||
- requirements-lin-amd.txt
|
- requirements-lin-amd.txt
|
||||||
- requirements-mac-mps-cpu.txt
|
- requirements-mac-mps-cpu.txt
|
||||||
|
- requirements-win-colab-cuda.txt
|
||||||
python-version:
|
python-version:
|
||||||
# - '3.9'
|
# - '3.9'
|
||||||
- '3.10'
|
- '3.10'
|
||||||
include:
|
include:
|
||||||
- requirements-file: requirements-lin-cuda.txt
|
- requirements-file: requirements-lin-cuda.txt
|
||||||
os: ubuntu-latest
|
os: ubuntu-22.04
|
||||||
default-shell: bash -l {0}
|
github-env: $GITHUB_ENV
|
||||||
- requirements-file: requirements-lin-amd.txt
|
- requirements-file: requirements-lin-amd.txt
|
||||||
os: ubuntu-latest
|
os: ubuntu-22.04
|
||||||
default-shell: bash -l {0}
|
github-env: $GITHUB_ENV
|
||||||
- requirements-file: requirements-mac-mps-cpu.txt
|
- requirements-file: requirements-mac-mps-cpu.txt
|
||||||
os: macOS-12
|
os: macOS-12
|
||||||
default-shell: bash -l {0}
|
github-env: $GITHUB_ENV
|
||||||
|
- requirements-file: requirements-win-colab-cuda.txt
|
||||||
|
os: windows-2022
|
||||||
|
github-env: $env:GITHUB_ENV
|
||||||
name: ${{ matrix.requirements-file }} on ${{ matrix.python-version }}
|
name: ${{ matrix.requirements-file }} on ${{ matrix.python-version }}
|
||||||
runs-on: ${{ matrix.os }}
|
runs-on: ${{ matrix.os }}
|
||||||
defaults:
|
|
||||||
run:
|
|
||||||
shell: ${{ matrix.default-shell }}
|
|
||||||
env:
|
env:
|
||||||
INVOKEAI_ROOT: '${{ github.workspace }}/invokeai'
|
INVOKEAI_ROOT: '${{ github.workspace }}/invokeai'
|
||||||
PYTHONUNBUFFERED: 1
|
PYTHONUNBUFFERED: 1
|
||||||
@ -43,6 +44,18 @@ jobs:
|
|||||||
id: checkout-sources
|
id: checkout-sources
|
||||||
uses: actions/checkout@v3
|
uses: actions/checkout@v3
|
||||||
|
|
||||||
|
- name: set INVOKEAI_ROOT Windows
|
||||||
|
if: matrix.os == 'windows-2022'
|
||||||
|
run: |
|
||||||
|
echo "INVOKEAI_ROOT=${{ github.workspace }}\invokeai" >> ${{ matrix.github-env }}
|
||||||
|
echo "INVOKEAI_OUTDIR=${{ github.workspace }}\invokeai\outputs" >> ${{ matrix.github-env }}
|
||||||
|
|
||||||
|
- name: set INVOKEAI_ROOT others
|
||||||
|
if: matrix.os != 'windows-2022'
|
||||||
|
run: |
|
||||||
|
echo "INVOKEAI_ROOT=${{ github.workspace }}/invokeai" >> ${{ matrix.github-env }}
|
||||||
|
echo "INVOKEAI_OUTDIR=${{ github.workspace }}/invokeai/outputs" >> ${{ matrix.github-env }}
|
||||||
|
|
||||||
- name: create models.yaml from example
|
- name: create models.yaml from example
|
||||||
run: |
|
run: |
|
||||||
mkdir -p ${{ env.INVOKEAI_ROOT }}/configs
|
mkdir -p ${{ env.INVOKEAI_ROOT }}/configs
|
||||||
@ -59,15 +72,15 @@ jobs:
|
|||||||
|
|
||||||
- name: set test prompt to main branch validation
|
- name: set test prompt to main branch validation
|
||||||
if: ${{ github.ref == 'refs/heads/main' }}
|
if: ${{ github.ref == 'refs/heads/main' }}
|
||||||
run: echo "TEST_PROMPTS=tests/preflight_prompts.txt" >> $GITHUB_ENV
|
run: echo "TEST_PROMPTS=tests/preflight_prompts.txt" >> ${{ matrix.github-env }}
|
||||||
|
|
||||||
- name: set test prompt to development branch validation
|
- name: set test prompt to development branch validation
|
||||||
if: ${{ github.ref == 'refs/heads/development' }}
|
if: ${{ github.ref == 'refs/heads/development' }}
|
||||||
run: echo "TEST_PROMPTS=tests/dev_prompts.txt" >> $GITHUB_ENV
|
run: echo "TEST_PROMPTS=tests/dev_prompts.txt" >> ${{ matrix.github-env }}
|
||||||
|
|
||||||
- name: set test prompt to Pull Request validation
|
- name: set test prompt to Pull Request validation
|
||||||
if: ${{ github.ref != 'refs/heads/main' && github.ref != 'refs/heads/development' }}
|
if: ${{ github.ref != 'refs/heads/main' && github.ref != 'refs/heads/development' }}
|
||||||
run: echo "TEST_PROMPTS=tests/validate_pr_prompt.txt" >> $GITHUB_ENV
|
run: echo "TEST_PROMPTS=tests/validate_pr_prompt.txt" >> ${{ matrix.github-env }}
|
||||||
|
|
||||||
- name: create requirements.txt
|
- name: create requirements.txt
|
||||||
run: cp 'environments-and-requirements/${{ matrix.requirements-file }}' '${{ matrix.requirements-file }}'
|
run: cp 'environments-and-requirements/${{ matrix.requirements-file }}' '${{ matrix.requirements-file }}'
|
||||||
@ -76,14 +89,14 @@ jobs:
|
|||||||
uses: actions/setup-python@v4
|
uses: actions/setup-python@v4
|
||||||
with:
|
with:
|
||||||
python-version: ${{ matrix.python-version }}
|
python-version: ${{ matrix.python-version }}
|
||||||
cache: 'pip'
|
# cache: 'pip'
|
||||||
cache-dependency-path: ${{ matrix.requirements-file }}
|
# cache-dependency-path: ${{ matrix.requirements-file }}
|
||||||
|
|
||||||
# - name: install dependencies
|
# - name: install dependencies
|
||||||
# run: ${{ env.pythonLocation }}/bin/pip install --upgrade pip setuptools wheel
|
# run: ${{ env.pythonLocation }}/bin/pip install --upgrade pip setuptools wheel
|
||||||
|
|
||||||
- name: install requirements
|
- name: install requirements
|
||||||
run: ${{ env.pythonLocation }}/bin/pip install -r '${{ matrix.requirements-file }}'
|
run: pip3 install -r '${{ matrix.requirements-file }}'
|
||||||
|
|
||||||
- name: run configure_invokeai.py
|
- name: run configure_invokeai.py
|
||||||
id: run-preload-models
|
id: run-preload-models
|
||||||
@ -92,7 +105,7 @@ jobs:
|
|||||||
mkdir -p ~/.huggingface
|
mkdir -p ~/.huggingface
|
||||||
echo -n '${{ secrets.HUGGINGFACE_TOKEN }}' > ~/.huggingface/token
|
echo -n '${{ secrets.HUGGINGFACE_TOKEN }}' > ~/.huggingface/token
|
||||||
fi
|
fi
|
||||||
${{ env.pythonLocation }}/bin/python scripts/configure_invokeai.py \
|
python3 scripts/configure_invokeai.py \
|
||||||
--no-interactive --yes \
|
--no-interactive --yes \
|
||||||
--full-precision # can't use fp16 weights without a GPU
|
--full-precision # can't use fp16 weights without a GPU
|
||||||
|
|
||||||
@ -102,22 +115,24 @@ jobs:
|
|||||||
|
|
||||||
- name: Run the tests
|
- name: Run the tests
|
||||||
id: run-tests
|
id: run-tests
|
||||||
|
if: matrix.os != 'windows-2022'
|
||||||
env:
|
env:
|
||||||
# Set offline mode to make sure configure preloaded successfully.
|
# Set offline mode to make sure configure preloaded successfully.
|
||||||
HF_HUB_OFFLINE: 1
|
HF_HUB_OFFLINE: 1
|
||||||
HF_DATASETS_OFFLINE: 1
|
HF_DATASETS_OFFLINE: 1
|
||||||
TRANSFORMERS_OFFLINE: 1
|
TRANSFORMERS_OFFLINE: 1
|
||||||
run: |
|
run: |
|
||||||
time ${{ env.pythonLocation }}/bin/python scripts/invoke.py \
|
time python3 scripts/invoke.py \
|
||||||
--no-patchmatch \
|
--no-patchmatch \
|
||||||
--no-nsfw_checker \
|
--no-nsfw_checker \
|
||||||
--model ${{ matrix.stable-diffusion-model }} \
|
--model ${{ matrix.stable-diffusion-model }} \
|
||||||
--from_file ${{ env.TEST_PROMPTS }} \
|
--from_file ${{ env.TEST_PROMPTS }} \
|
||||||
--root="${{ env.INVOKEAI_ROOT }}" \
|
--root="${{ env.INVOKEAI_ROOT }}" \
|
||||||
--outdir="${{ env.INVOKEAI_ROOT }}/outputs"
|
--outdir="${{ env.INVOKEAI_OUTDIR }}"
|
||||||
|
|
||||||
- name: Archive results
|
- name: Archive results
|
||||||
id: archive-results
|
id: archive-results
|
||||||
|
if: matrix.os != 'windows-2022'
|
||||||
uses: actions/upload-artifact@v3
|
uses: actions/upload-artifact@v3
|
||||||
with:
|
with:
|
||||||
name: results_${{ matrix.requirements-file }}_${{ matrix.python-version }}
|
name: results_${{ matrix.requirements-file }}_${{ matrix.python-version }}
|
||||||
|
@ -33,7 +33,7 @@ torch-fidelity
|
|||||||
torchmetrics
|
torchmetrics
|
||||||
transformers~=4.24
|
transformers~=4.24
|
||||||
picklescan
|
picklescan
|
||||||
git+https://github.com/invoke-ai/GFPGAN@basicsr-1.4.1#egg=gfpgan ; platform_system == 'Windows'
|
# git+https://github.com/invoke-ai/GFPGAN@basicsr-1.4.1#egg=gfpgan ; platform_system == 'Windows'
|
||||||
git+https://github.com/invoke-ai/GFPGAN@basicsr-1.4.2#egg=gfpgan ; platform_system != 'Windows'
|
git+https://github.com/invoke-ai/GFPGAN@basicsr-1.4.2#egg=gfpgan ; platform_system != 'Windows'
|
||||||
git+https://github.com/openai/CLIP.git@main#egg=clip
|
git+https://github.com/openai/CLIP.git@main#egg=clip
|
||||||
git+https://github.com/Birch-san/k-diffusion.git@mps#egg=k-diffusion
|
git+https://github.com/Birch-san/k-diffusion.git@mps#egg=k-diffusion
|
||||||
|
@ -1,7 +1,8 @@
|
|||||||
-r environments-and-requirements/requirements-base.txt
|
-r environments-and-requirements/requirements-base.txt
|
||||||
# Get hardware-appropriate torch/torchvision
|
# Get hardware-appropriate torch/torchvision
|
||||||
--extra-index-url https://download.pytorch.org/whl/cu116 --trusted-host https://download.pytorch.org
|
--extra-index-url https://download.pytorch.org/whl/cu116 --trusted-host https://download.pytorch.org
|
||||||
basicsr==1.4.1
|
gfpgan
|
||||||
|
basicsr
|
||||||
torch==1.12.1
|
torch==1.12.1
|
||||||
torchvision==0.13.1
|
torchvision==0.13.1
|
||||||
-e .
|
-e .
|
||||||
|
@ -62,7 +62,7 @@ const PromptInput = () => {
|
|||||||
<Textarea
|
<Textarea
|
||||||
id="prompt"
|
id="prompt"
|
||||||
name="prompt"
|
name="prompt"
|
||||||
placeholder="I'm dreaming of..."
|
placeholder="Type prompt here. [negative tokens], (upweight)++, (downweight)--, swap and blend are available (see docs)"
|
||||||
size={'lg'}
|
size={'lg'}
|
||||||
value={prompt}
|
value={prompt}
|
||||||
onChange={handleChangePrompt}
|
onChange={handleChangePrompt}
|
||||||
|
@ -763,7 +763,7 @@ class Generate:
|
|||||||
elif text_mask:
|
elif text_mask:
|
||||||
init_mask = self._txt2mask(image, text_mask, width, height, fit=fit)
|
init_mask = self._txt2mask(image, text_mask, width, height, fit=fit)
|
||||||
|
|
||||||
if invert_mask:
|
if init_mask and invert_mask:
|
||||||
init_mask = ImageOps.invert(init_mask)
|
init_mask = ImageOps.invert(init_mask)
|
||||||
|
|
||||||
return init_image,init_mask
|
return init_image,init_mask
|
||||||
|
@ -282,7 +282,7 @@ def main_loop(gen, opt):
|
|||||||
prefix = file_writer.unique_prefix()
|
prefix = file_writer.unique_prefix()
|
||||||
step_callback = make_step_callback(gen, opt, prefix) if opt.save_intermediates > 0 else None
|
step_callback = make_step_callback(gen, opt, prefix) if opt.save_intermediates > 0 else None
|
||||||
|
|
||||||
def image_writer(image, seed, upscaled=False, first_seed=None, use_prefix=None):
|
def image_writer(image, seed, upscaled=False, first_seed=None, use_prefix=None, prompt_in=None):
|
||||||
# note the seed is the seed of the current image
|
# note the seed is the seed of the current image
|
||||||
# the first_seed is the original seed that noise is added to
|
# the first_seed is the original seed that noise is added to
|
||||||
# when the -v switch is used to generate variations
|
# when the -v switch is used to generate variations
|
||||||
@ -311,7 +311,7 @@ def main_loop(gen, opt):
|
|||||||
if use_prefix is not None:
|
if use_prefix is not None:
|
||||||
prefix = use_prefix
|
prefix = use_prefix
|
||||||
postprocessed = upscaled if upscaled else operation=='postprocess'
|
postprocessed = upscaled if upscaled else operation=='postprocess'
|
||||||
opt.prompt = gen.concept_lib().replace_triggers_with_concepts(opt.prompt) # to avoid the problem of non-unique concept triggers
|
opt.prompt = gen.concept_lib().replace_triggers_with_concepts(opt.prompt or prompt_in) # to avoid the problem of non-unique concept triggers
|
||||||
filename, formatted_dream_prompt = prepare_image_metadata(
|
filename, formatted_dream_prompt = prepare_image_metadata(
|
||||||
opt,
|
opt,
|
||||||
prefix,
|
prefix,
|
||||||
|
@ -40,7 +40,7 @@ class Embiggen(Generator):
|
|||||||
image = make_image()
|
image = make_image()
|
||||||
results.append([image, seed])
|
results.append([image, seed])
|
||||||
if image_callback is not None:
|
if image_callback is not None:
|
||||||
image_callback(image, seed)
|
image_callback(image, seed, prompt_in=prompt)
|
||||||
seed = self.new_seed()
|
seed = self.new_seed()
|
||||||
return results
|
return results
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user