Compare commits

..

538 Commits

Author SHA1 Message Date
971f5c5ab1 Configure the NSFW checker at install time with default on (#1624)
* configure the NSFW checker at install time with default on

1. Changes the --safety_checker argument to --nsfw_checker and
--no-nsfw_checker. The original argument is recognized for backward
compatibility.

2. The configure script asks users whether to enable the checker
(default yes). Also offers users ability to select default sampler and
number of generation steps.

3.Enables the pasting of the caution icon on blurred images when
InvokeAI is installed into the package directory.

4. Adds documentation for the NSFW checker, including caveats about
accuracy, memory requirements, and intermediate image dispaly.

* use better fitting icon

* NSFW defaults false for testing

* set default back to nsfw active

Co-authored-by: Matthias Wild <40327258+mauwii@users.noreply.github.com>
Co-authored-by: mauwii <Mauwii@outlook.de>
2022-11-30 14:50:57 -05:00
22133392b2 disable NSFW checker loading during the CI tests (#1641)
* disable NSFW checker loading during the CI tests

The NSFW filter apparently causes invoke.py to crash during CI testing,
possibly due to out of memory errors. This workaround disables NSFW
model loading.

* doc change

* fix formatting errors in yml files
2022-11-30 14:11:51 -05:00
5e81f51f6a Web UI 2.2 bugfixes (#1572)
* Fixes bug preventing multiple images from being generated

* Fixes valid seam strength value range

* Update Delete Alert Text

Indicates to the user that images are not permanently deleted.

* Fixes left/right arrows not working on gallery

* Fixes initial image on load erroneously set to a user uploaded image

Should be a result gallery image.

* Lightbox Fixes

- Lightbox is now a button in the current image buttons
- Lightbox is also now available in the gallery context menu
- Lightbox zoom issues fixed
- Lightbox has a fade in animation.

* Fix image display wrapper in current preview not overflow bounds

* Revert "Fix image display wrapper in current preview not overflow bounds"

This reverts commit 5511c82714dbf1d1999d64e8bc357bafa34ddf37.

* Change Staging Area discard icon from Bin to X

* Expose Snap Threshold and Move Snap Settings to BBox Panel

* Changes img2img strength default to 0.75

* Fixes drawing triggering when mouse enters canvas w/ button down

When we only supported inpainting and no zoom, this was useful. It allowed the cursor to leave the canvas (which was easy to do given the limited canvas dimensions) and without losing the "I am drawing" state. 

With a zoomable canvas this is no longer as useful.

Additionally, we have more popovers and tools (like the color pickers) which result in unexpected brush strokes. This fixes that issue.

* Revert "Expose Snap Threshold and Move Snap Settings to BBox Panel"

We will handle this a bit differently - by allowing the grid origin to be moved. I will dig in at some point.

This reverts commit 33c92ecf4da724c2f17d9d91c7ea31a43a2f6deb.

* Adds Limit Strokes to Box

* Adds fill bounding box button

* Adds erase bounding box button

* Changes Staging area discard icon to match others

* Fixes right click breaking move tool

* Fixes brush preview visibility issue with "darken outside box"

* Fixes history bugs with addFillRect, addEraseRect, and other actions

* Adds missing `key`

* Fixes postprocessing being applied to canvas generations

* Fixes bbox not getting scaled in various situations

* Fixes staging area show image toggle not resetting on accept/discard

* Locks down canvas while generating/staging

* Fixes move tool breaking when canvas loses focus during move/transform

* Hides cursor when restrict strokes is on and mouse outside bbox

* Lints

* Builds fresh bundle

* Fix overlapping hotkey for Fill Bounding Box

* Build Fresh Bundle

* Fixes bug with mask and bbox overlay

* Builds fresh bundle

Co-authored-by: blessedcoolant <54517381+blessedcoolant@users.noreply.github.com>
Co-authored-by: Lincoln Stein <lincoln.stein@gmail.com>
2022-11-30 12:08:06 -05:00
9fae65ed69 add .editorconfig (#1636) 2022-11-30 08:35:15 -05:00
2443e5dc01 add k_dpmpp_2_a and k_dpmpp_2 solvers options (#1389)
* add k_dpmpp_2_a and k_dpmpp_2 solvers options

* update frontend

Co-authored-by: Victor <victorca25@users.noreply.github.com>
Co-authored-by: Lincoln Stein <lincoln.stein@gmail.com>
2022-11-30 08:32:52 -05:00
a9aa4e45aa fix error when inpainting using runwayml inpainting model (#1634)
- error was "Omnibus object has no attribute pil_image"
- closes #1596
2022-11-30 08:32:33 -05:00
9b6b27a156 Fix inpainting with iterations (#1635) 2022-11-30 08:28:20 -05:00
b68074bb8f Removes symlinked environment.yaml (#1631)
Was unintentionally added in #1621
2022-11-30 00:24:21 -05:00
1f8e56672c Fix installer script for macOS. (#1630)
* refer to the platform as 'osx' instead of 'mac', otherwise the
composed URL to micromamba is wrong.
* move the `-O` option to `tar` to be grouped with the other tar flags
to avoid the `-O` being interpreted as something to unarchive.
2022-11-29 23:49:29 -05:00
f8708f5dbe disable patchmatch in CI actions (#1626)
* disable patchmatch in CI actions

* fix indention

* replace tab with spaces

Co-authored-by: Matthias Wild <40327258+mauwii@users.noreply.github.com>
Co-authored-by: mauwii <Mauwii@outlook.de>
2022-11-30 05:03:54 +01:00
103efea641 include a step after config to cat ~/.invokeai (#1629) 2022-11-30 03:34:24 +01:00
b60edab0fa 2.2 Doc Updates (#1589)
* Unified Canvas Docs & Assets

Unified Canvas draft

Advanced Tools Updates

Doc Updates (lstein feedback)

* copy edits to Unified Canvas docs

- consistent capitalisation and feature naming
- more intimate address (replace "the user" with "you") for improved User
  Engagement(tm)
- grammatical massaging and *poesie*

Co-authored-by: Lincoln Stein <lincoln.stein@gmail.com>
Co-authored-by: damian <git@damianstewart.com>
2022-11-29 16:09:54 -05:00
6bc11bfd3f Test installer (#1618)
* test linux install

* try removing http from parsed requirements

* pip install confirmed working on linux

* ready for linux testing

- rebuilt py3.10-linux-x86_64-cuda-reqs.txt to include pypatchmatch
  dependency.
- point install.sh and install.bat to test-installer branch.

* Updates MPS reqs

* detect broken readline history files

* fix download.pytorch.org URL

* Test installer (Win 11) (#1620)

Co-authored-by: Cyrus Chan <cyruswkc@hku.hk>

* Test installer (MacOS 13.0.1 w/ torch==1.12.0) (#1621)

* Test installer (Win 11)

* Test installer (MacOS 13.0.1 w/ torch==1.12.0)

Co-authored-by: Cyrus Chan <cyruswkc@hku.hk>

* change sourceball to development for testing

* Test installer (MacOS 13.0.1 w/ torch==1.12.1 & torchvision==1.13.1) (#1622)

* Test installer (Win 11)

* Test installer (MacOS 13.0.1 w/ torch==1.12.0)

* Test installer (MacOS 13.0.1 w/ torch==1.12.1 & torchvision==1.13.1)

Co-authored-by: Cyrus Chan <cyruswkc@hku.hk>

Co-authored-by: psychedelicious <4822129+psychedelicious@users.noreply.github.com>
Co-authored-by: Cyrus Chan <82143712+cyruschan360@users.noreply.github.com>
Co-authored-by: Cyrus Chan <cyruswkc@hku.hk>
2022-11-29 15:05:43 -05:00
5897e511f1 Debloat-docker (#1612)
* debloat Dockerfile
- less options more but more userfriendly
- better Entrypoint to simulate CLI usage
- without command the container still starts the web-host

* debloat build.sh

* better syntax in run.sh

* update Docker docs
- fix description of VOLUMENAME
- update run script example to reflect new entrypoint
2022-11-29 10:04:03 -05:00
f43b767b87 update index.md (#1609)
- comment out non existing link
- fix indention
- add seperator between feature categories
2022-11-29 10:02:55 -05:00
61cc41aa3f Fixes for #1604 (#1605)
* Converts ESRGAN image input to RGB

- Also adds typing for image input.
- Partially resolves #1604

* ensure there are unmasked pixels before color matching

Co-authored-by: Kyle Schouviller <kyle0654@hotmail.com>
2022-11-29 09:34:38 -05:00
40c3ab0181 revert to older version of list_models() (#1611)
This restores the correct behavior of list_models() and quenches
the bug of list_models() returning a single model entry named "name".

I have not investigated what was wrong with the new version, but I
think it may have to do with changes to the behavior in dict.update()
2022-11-29 08:54:39 -05:00
8999a5564b make concepts library work with Web UI (#1608)
## The concepts library now works with the Web UI

This PR makes it possible to include a Hugging Face concepts library
<style-or-subject-trigger> in the WebUI prompts. The metadata seems to
be correctly handled.
2022-11-29 12:20:05 +01:00
8423be539b tweak setup and environment files for linux & pypatchmatch (#1580)
* tweak setup and environment files for linux & pypatchmatch

- Downgrade python requirements to 3.9 because 3.10 is not supported
  on Ubuntu 20.04 LTS (widely-used distro)
- Use our github pypatchmatch 0.1.3 in order to install Makefile
  where it needs to be.
- Restored "-e ." as the last install step on pip installs. Hopefully
  this will not trigger the high-CPU hang we've previously experienced.

* keep windows on basicsr 1.4.1

* keep windows on basicsr 1.4.1

* bump pypatchmatch requirement to 0.1.4

- This brings in a version of pypatchmatch that will gracefully
  handle internet connection not available at startup time.
- Also refactors and simplifies the handling of gfpgan's basicsr requirement
  across various platforms.
2022-11-28 20:22:31 -05:00
6cc56043e2 documentation enhancements (#1603)
- Add documentation for the Hugging Face concepts library and TI embedding.

- Fixup index.md to point to each of the feature documentation files,
  including ones that are pending.
2022-11-28 18:48:56 -05:00
62cda009dd make concepts library work with Web UI
This PR makes it possible to include a Hugging Face concepts library
<style-or-subject-trigger> in the WebUI prompt. The metadata seems
to be correctly handled.
2022-11-28 23:44:41 +00:00
45e51bac9a Fix #1599 by relaxing the match_trigger regex (#1601)
* Fix #1599 by relaxing the `match_trigger` regex

Also simplify logic and reduce duplication.

* restrict trigger regex again (but not so far)
2022-11-28 17:58:52 -05:00
a514f9b236 add a --no-patchmatch option to disable patchmatch loading (#1598)
This feature was added to prevent the CI Macintosh tests from erroring
out when patchmatch is unable to retrieve its shared library from
github assets.
2022-11-28 16:29:52 -05:00
90b21db86c Adds psychedelicious to statement of values signature (#1602) 2022-11-28 15:49:04 -05:00
bc44ab786c Bug Fix: Model import fixes (#1566)
These bug fixes address issues #1546 and #1547 .
2022-11-28 21:46:27 +01:00
281a2e3ecb make the docstring more readable and improve the list_models logic (fixes #1539) (#1594) 2022-11-28 21:20:56 +01:00
84cd96decf set readline root to ROOTDIR for model import 2022-11-28 18:34:42 +00:00
a3121b8137 !model_import autocompletes in ROOTDIR 2022-11-28 17:44:32 +00:00
3f6d0fb7da update dockerfile (#1551)
* update dockerfile

* remove not existing file from .dockerignore

* remove bloat and unecesary step
also use --no-cache-dir for pip install
image is now close to 2GB

* make Dockerfile a variable

* set base image to `ubuntu:22.10`

* add build-essential

* link outputs folder for persistence

* update tag variable

* update docs

* fix not customizeable build args, add reqs output
2022-11-28 18:20:25 +01:00
08ef4d62e9 add statement of values (#1584)
* this adds the Statement of Values

Google doc source = https://docs.google.com/document/d/1-PrUKDJcxy8OyNGc8CyiHhv2VgLvjt7LRGlEpbg1nmQ/edit?usp=sharing

* Fix heading

* Update InvokeAI_Statement_of_Values.md

* Update InvokeAI_Statement_of_Values.md

* Update InvokeAI_Statement_of_Values.md

* Update InvokeAI_Statement_of_Values.md

* Update InvokeAI_Statement_of_Values.md

* add keturn and mauwii to the team member list

* Fix punctuation

* this adds the Statement of Values

Google doc source = https://docs.google.com/document/d/1-PrUKDJcxy8OyNGc8CyiHhv2VgLvjt7LRGlEpbg1nmQ/edit?usp=sharing

* add keturn and mauwii to the team member list

* fix formating
- make sub bullets use * (decide to all use - or *)
- indent sub bullets
Sorry, first only looked at the code version and found this only after
looking at the markdown rendered version

* use multiparagraph numbered sections

* Break up Statement Of Values as per comments on #1584

* remove duplicated word, reduce vagueness

it's important not to overstate how many artists we are consulting.

* fix typo (sorry blessedcoolant)

Co-authored-by: mauwii <Mauwii@outlook.de>
Co-authored-by: damian <git@damianstewart.com>
2022-11-28 11:00:43 -05:00
81cb7fd1b7 Merge branch 'development' into model-import-fixes 2022-11-28 09:28:14 -05:00
7c658c6d76 model_cache.py: fix list_models
Signed-off-by: devops117 <55235206+devops117@users.noreply.github.com>
2022-11-28 19:20:38 +05:30
495104e941 Merge branch 'invoke-ai:development' into development 2022-11-28 19:14:31 +05:30
1e1f871ee1 Embedding merging (#1526)
* add whole <style token> to vocab for concept library embeddings

* add ability to load multiple concept .bin files

* make --log_tokenization respect custom tokens

* start working on concept downloading system

* preliminary support for dynamic loading and merging of multiple embedded models

- The embedding_manager is now enhanced with ldm.invoke.concepts_lib,
  which handles dynamic downloading and caching of embedded models from
  the Hugging Face concepts library (https://huggingface.co/sd-concepts-library)

- Downloading of a embedded model is triggered by the presence of one or more
  <concept> tags in the prompt.

- Once the embedded model is downloaded, its trigger phrase will be loaded
  into the embedding manager and the prompt's <concept> tag will be replaced
  with the <trigger_phrase>

- The downloaded model stays on disk for fast loading later.

- The CLI autocomplete will complete partial <concept> tags for you. Type a
  '<' and hit tab to get all ~700 concepts.

BUGS AND LIMITATIONS:

- MODEL NAME VS TRIGGER PHRASE

  You must use the name of the concept embed model from the SD
  library, and not the trigger phrase itself. Usually these are the
  same, but not always. For example, the model named "hoi4-leaders"
  corresponds to the trigger "<HOI4-Leader>"

  One reason for this design choice is that there is no apparent
  constraint on the uniqueness of the trigger phrases and one trigger
  phrase may map onto multiple models. So we use the model name
  instead.

  The second reason is that there is no way I know of to search
  Hugging Face for models with certain trigger phrases. So we'd have
  to download all 700 models to index the phrases.

  The problem this presents is that this may confuse users, who will
  want to reuse prompts from distributions that use the trigger phrase
  directly. Usually this will work, but not always.

- WON'T WORK ON A FIREWALLED SYSTEM

  If the host running IAI has no internet connection, it can't
  download the concept libraries. I will add a script that allows
  users to preload a list of concept models.

- BUG IN PROMPT REPLACEMENT WHEN MODEL NOT FOUND

  There's a small bug that occurs when the user provides an invalid
  model name. The <concept> gets replaced with <None> in the prompt.

* fix loading .pt embeddings; allow multi-vector embeddings; warn on dupes

* simplify replacement logic and remove cuda assumption

* download list of concepts from hugging face

* remove misleading customization of '*' placeholder

the existing code as-is did not do anything; unclear what it was supposed to do.

the obvious alternative -- setting using 'placeholder_strings' instead of
'placeholder_tokens' to match model.params.personalization_config.params.placeholder_strings --
caused a crash. i think this is because the passed string also needed to be handed over
on init of the PersonalizedBase as the 'placeholder_token' argument.
this is weird config dict magic and i don't want to touch it. put a
breakpoint in personalzied.py line 116 (top of PersonalizedBase.__init__) if
you want to have a crack at it yourself.

* address all the issues raised by damian0815 in review of PR #1526

* actually resize the token_embeddings

* multiple improvements to the concept loader based on code reviews

1. Activated the --embedding_directory option (alias --embedding_path)
   to load a single embedding or an entire directory of embeddings at
   startup time.

2. Can turn off automatic loading of embeddings using --no-embeddings.

3. Embedding checkpoints are scanned with the pickle scanner.

4. More informative error messages when a concept can't be loaded due
   either to a 404 not found error or a network error.

* autocomplete terms end with ">" now

* fix startup error and network unreachable

1. If the .invokeai file does not contain the --root and --outdir options,
  invoke.py will now fix it.

2. Catch and handle network problems when downloading hugging face textual
   inversion concepts.

* fix misformatted error string

Co-authored-by: Damian Stewart <d@damianstewart.com>
2022-11-28 02:40:24 -05:00
30c5a0b067 Interactive configuration (#1517)
* Update scripts/configure_invokeai.py

prevent crash if output exists

Co-authored-by: psychedelicious <4822129+psychedelicious@users.noreply.github.com>

* implement changes requested by reviews

* default to correct root and output directory on Windows systems

- Previously the script was relying on the readline buffer editing
  feature to set up the correct default. But this feature doesn't
  exist on windows.

- This commit detects when user typed return with an empty directory
  value and replaces with the default directory.

* improved readability of directory choices

* Update scripts/configure_invokeai.py

Co-authored-by: psychedelicious <4822129+psychedelicious@users.noreply.github.com>

* better error reporting at startup

- If user tries to run the script outside of the repo or runtime directory,
  a more informative message will appear explaining the problem.

Co-authored-by: psychedelicious <4822129+psychedelicious@users.noreply.github.com>
2022-11-27 21:29:56 -05:00
9f02595ef2 Fixes outpainting with resized inpaint size 2022-11-27 22:24:15 +13:00
b101334b4e Merge branch 'development' into model-import-fixes 2022-11-27 08:26:05 +01:00
0608d259dd move requirements-mkdocs.txt to docs folder (#1575)
* move requirements-mkdocs.txt to docs folder

* update copyright
2022-11-27 07:59:56 +01:00
12eff0dd42 Update-requirements and test-invoke-pip workflow (#1574)
* update requirements files

* update test-invoke-pip workflow
2022-11-27 03:43:04 +01:00
939164eaa7 Merge branch 'development' into model-import-fixes 2022-11-27 01:30:43 +01:00
f2d2a49977 disable checks for python 3.9 2022-11-26 17:43:09 -05:00
37535f5897 fix output path for Archive results 2022-11-26 17:43:09 -05:00
e5646dee27 also set fail-fast to it's default (true)
in this way the whole action fails if one job fails
this should unblock the runners!!!
2022-11-26 17:43:09 -05:00
d5011efaa1 fix model cache path 2022-11-26 17:43:09 -05:00
74487a95a9 Merge branch 'development' into model-import-fixes 2022-11-26 16:54:21 -05:00
a50f4da9d1 install frontend/dist into package directory (#1554)
- When invokeai installed with `pip install .`, the frontend will be in
the venv directory under invokeai.
- When invokeai installed with `pip install -e .`, the frontend will be
in the source repo. -invoke_ai_web_sever.py will look in both places
using relative
  addressing.
2022-11-26 16:21:00 -05:00
4ae1df5b5e Merge branch 'development' into backend-can-find-frontend 2022-11-26 14:01:23 -05:00
7f3ba16cd2 Revert "make the docstring more readable and improve the list_models logic"
This reverts commit 248068fe5d.
2022-11-26 13:38:20 -05:00
7a0438586c Merge branch 'development' into model-import-fixes 2022-11-26 10:18:49 -05:00
9adaf8f8ad prevent "!switch state gets confused if model switching fails"
- If !switch were to fail on a particular model, then generate got
  confused and wouldn't try again until you switch to a different working
  model and back again.

- This commit fixes and closes #1547
2022-11-26 15:15:10 +00:00
a341297b0c stop crash on !import_models call on model inside rootdir
- addresses bug report #1546
2022-11-26 14:58:22 +00:00
9e0504abe5 Builds fresh bundle 2022-11-27 03:35:49 +13:00
3131edb255 Fixes canvas dimensions not setting on first load 2022-11-27 03:35:49 +13:00
b0697bc4ff Fix desktop mode being broken with new versions of flaskwebgui 2022-11-27 03:35:49 +13:00
1e9121c8d6 Builds fresh bundle 2022-11-27 03:35:49 +13:00
916e795c26 Adds gallery drag and drop to img2img/canvas 2022-11-27 03:35:49 +13:00
3aebe754fa Fixes unnecessary canvas scaling 2022-11-27 03:35:49 +13:00
3f0cfaac4a Builds fresh bundle 2022-11-27 03:35:49 +13:00
a3a0a87f55 Fixes canvas failing to scale on first run 2022-11-27 03:35:49 +13:00
f5e8ffe7b4 Builds fresh bundle 2022-11-27 03:35:49 +13:00
404d81f6fd Fixes shouldShowStagingImage not resetting to true on commit 2022-11-27 03:35:49 +13:00
c7864f8a6d Fixes bug with clear mask and history 2022-11-27 03:35:49 +13:00
9568ac66e0 Improves scaled bbox display logic 2022-11-27 03:35:49 +13:00
d4280bbaaa Adds auto-scaling for inpaint size 2022-11-27 03:35:49 +13:00
46a5fd67ed Adds inpaint size (as scale bounding box) to UI 2022-11-27 03:35:49 +13:00
b93336dbf9 Bug fix for inpaint size 2022-11-27 03:35:49 +13:00
9fe9301762 Add inpaint size options to inpaint at a larger size than the actual inpaint image, then scale back down for recombination 2022-11-27 03:35:49 +13:00
7f1b95fbda Removes force_outpaint param 2022-11-27 03:35:49 +13:00
52c79fa097 Lints 2022-11-27 03:35:49 +13:00
62ac725ba9 Adds brush color alpha hotkey 2022-11-27 03:35:49 +13:00
db188cd3c3 Color picker does not overwrite user-selected alpha 2022-11-27 03:35:49 +13:00
e67ef4aec2 Committing color picker color changes tool to brush 2022-11-27 03:35:49 +13:00
473869b8ed Fixes mask brush preview color 2022-11-27 03:35:49 +13:00
c8c1b3e217 Simplifies Accordion
Prep for adding reset buttons for each section
2022-11-27 03:35:49 +13:00
fcd3ef1f98 Fixes invoke hotkey not working in input fields 2022-11-27 03:35:49 +13:00
a7f11a8c09 Fixes variation params not set correctly when recalled 2022-11-27 03:35:49 +13:00
318426b67a Changes color picker preview to circles 2022-11-27 03:35:49 +13:00
6f3e99efc3 Un-floors cursor position 2022-11-27 03:35:49 +13:00
7515bcfe78 Fixes iterations being disabled when seed random & variations are off 2022-11-27 03:35:49 +13:00
8d0ef022eb Lints & builds fresh bundle 2022-11-27 03:35:49 +13:00
9f1c1cf2e6 Adds color picker 2022-11-27 03:35:49 +13:00
d44112c209 Builds fresh bundle 2022-11-27 03:35:49 +13:00
b31f90c0bd Fixes postprocessing not being disabled when clicking use all 2022-11-27 03:35:49 +13:00
344cdf0ade Renames "Threshold" > "Noise Threshold" 2022-11-27 03:35:49 +13:00
500bde5b0e Fixes missing threshold and perlin parameters in metadata viewer 2022-11-27 03:35:49 +13:00
df03927ec6 Fixes img2img attempting inpaint when init image has transparency 2022-11-27 03:35:49 +13:00
419f670f86 Updates npm dependencies 2022-11-27 03:35:49 +13:00
30dc9220c1 Fixes crash on cancel with intermediates enabled, fixes #1416 2022-11-27 03:35:49 +13:00
941d427302 Adds single-column gallery layout 2022-11-27 03:35:49 +13:00
876ae7f70f Move full screen hotkey to floating to prevent tab rerenders 2022-11-27 03:35:49 +13:00
a86049f822 Adds Training icon 2022-11-27 03:35:49 +13:00
ec3d25d778 Add Training WIP Tab 2022-11-27 03:35:49 +13:00
69a4a6fec5 Simplify fullscreen hotkey selector 2022-11-27 03:35:49 +13:00
7b76b79887 Floating panel re-render fix 2022-11-27 03:35:49 +13:00
3ea732365c Fix rerenders on model select 2022-11-27 03:35:49 +13:00
dc5d696ed2 Builds fresh bundle 2022-11-27 03:35:49 +13:00
0060551490 Fixes missing postprocessed image metadata before refresh 2022-11-27 03:35:49 +13:00
2fcc7d9b36 Isolate Cursor Pos debug text on canvas to prevent rerenders 2022-11-27 03:35:49 +13:00
78217f5ef9 Fix unnecessary gallery re-renders 2022-11-27 03:35:49 +13:00
c6112e3295 memoize outpainting options 2022-11-27 03:35:49 +13:00
8b08af714d Tab Styling Fixes 2022-11-27 03:35:49 +13:00
723dcf4236 Adds infill method 2022-11-27 03:35:49 +13:00
ddfd82559f Styling Updates 2022-11-27 03:35:49 +13:00
8488575e5c Minor styling fixes to new options panel layout 2022-11-27 03:35:49 +13:00
7e4e51b224 Removes Advanced checkbox, cleans up options panel for unified canvas 2022-11-27 03:35:49 +13:00
f3b7316683 Fix to gallery resizing 2022-11-27 03:35:49 +13:00
25b19b9ab8 Add loopback to just img2img. Remove from settings. 2022-11-27 03:35:49 +13:00
9a6a970771 Fix gallery not resizing correctly on open and close 2022-11-27 03:35:49 +13:00
93de78b6e8 Highlight mask icon when on mask layer 2022-11-27 03:35:49 +13:00
00da042dab Update feature tooltip text 2022-11-27 03:35:49 +13:00
6445e802f6 Fix Lightbox images of different res not centering 2022-11-27 03:35:49 +13:00
7caf20aad3 Builds fresh bundle 2022-11-27 03:35:49 +13:00
11969c2e2e Fixes gallery width on lightbox, fixes gallery button expansion 2022-11-27 03:35:49 +13:00
e821b97cfc Linting 2022-11-27 03:35:49 +13:00
ef1dbdb33d Adds outpainting specific options 2022-11-27 03:35:49 +13:00
0cdb7bb0cd Fixes metadata viewer not showing metadata after refresh
Also adds Dream-style prompt to metadata
2022-11-27 03:35:49 +13:00
306ed44e19 Moves Loopback to app settings 2022-11-27 03:35:49 +13:00
b0810e1ed7 Adds IAIAlertDialog component 2022-11-27 03:35:49 +13:00
089c85a017 Fixes bug when postprocessing image with no metadata 2022-11-27 03:35:49 +13:00
a1d80fd106 Cap gallery size on canvas tab so it doesnt overflow 2022-11-27 03:35:49 +13:00
d9c7a28c90 Improves gallery resize behaviour 2022-11-27 03:35:49 +13:00
c787a3a801 Styling fixes 2022-11-27 03:35:49 +13:00
1f772e4bdc Fix input checkbox styling being incorrect on light theme 2022-11-27 03:35:49 +13:00
cb7458db77 Fix styling on alert modals 2022-11-27 03:35:49 +13:00
ef482b4d3e Builds fresh bundle 2022-11-27 03:35:49 +13:00
3e22160462 Updates mask options popover behavior 2022-11-27 03:35:49 +13:00
6a3d725dbb Adds clear temp folder 2022-11-27 03:35:49 +13:00
8a16c8a196 Crop to Bounding Box > Save Box Region Only 2022-11-27 03:35:49 +13:00
90eaac5134 Masking option tweaks 2022-11-27 03:35:49 +13:00
896c2532c7 Adds option to crop to bounding box on save 2022-11-27 03:35:49 +13:00
f68702520b Update Layer hotkey display to UI 2022-11-27 03:35:49 +13:00
286e46aaa3 Fix gallery maxwidth on unified canvas 2022-11-27 03:35:49 +13:00
088fd97418 Rearrange some canvas toolbar icons
Put brush stuff together and canvas movement stuff together
2022-11-27 03:35:49 +13:00
e1e978b423 Adds Save to Gallery button to staging toolbar 2022-11-27 03:35:49 +13:00
d27d92325d Fixes bug where discarding staged images results in loss of history 2022-11-27 03:35:49 +13:00
80f6f9a931 First pass on Canvas options panel 2022-11-27 03:35:49 +13:00
7dff8ccd31 Styles buttons for clearing canvas history and mask 2022-11-27 03:35:49 +13:00
3f6b275bec Image gallery resize/style tweaks 2022-11-27 03:35:49 +13:00
5ed6a31b97 Removes reasonsWhyNotReady
The popover doesn't play well with the button being disabled, and I don't think adds any value.
2022-11-27 03:35:49 +13:00
b72b61b790 Styling updates 2022-11-27 03:35:49 +13:00
b81231823e Builds fresh bundle 2022-11-27 03:35:49 +13:00
c7c6940e1a Fixes repo root .gitignore ignoring frontend things 2022-11-27 03:35:49 +13:00
6c33d1356d Removes unused imports 2022-11-27 03:35:49 +13:00
f08c78a043 Minor bugfixes
- When doing long-running canvas image exporting actions, display indeterminate progress bar
- Fix staging area image outline not displaying after committing/discarding results
2022-11-27 03:35:49 +13:00
b6dd5b664c Fixes bug causing gallery to close on context menu open 2022-11-27 03:35:49 +13:00
76e7e82f5e Removes stray console.log() 2022-11-27 03:35:49 +13:00
d4376ed240 Adds hotkey to reset canvas interaction state
If the canvas' interaction state (e.g. isMovingBoundingBox, isDrawing, etc) get stuck somehow, user can press Escape to reset the state.
2022-11-27 03:35:49 +13:00
9d34213b4c Gracefully handles corrupted images; fixes #1486
- App does not crash if corrupted image loaded
- Error is displayed in the UI console and CLI output if an image cannot be loaded
2022-11-27 03:35:49 +13:00
b908f2b4bc Improves metadata handling, fixes #1450
- Removes model list from metadata
- Adds generation's specific model to metadata
- Displays full metadata in JSON viewer
2022-11-27 03:35:49 +13:00
9418324030 Cleans up IAICanvasStatusText 2022-11-27 03:35:49 +13:00
0f6856b719 Fixes canvas toolbar upload button 2022-11-27 03:35:49 +13:00
83d8e69219 Reworks canvas toolbar 2022-11-27 03:35:49 +13:00
7f999e9dfc Fixes another similar index error, simplifies logic 2022-11-27 03:35:49 +13:00
0c3ae232af WIP - Lightbox Fixes
Still need to fix the images not being centered on load when the image res changes
2022-11-27 03:35:49 +13:00
9950790f4c Fix index error on going past last image in Gallery 2022-11-27 03:35:49 +13:00
b50a1eb63f Disables canvas image saving functions when processing 2022-11-27 03:35:49 +13:00
d55b1e169c Fix Lightbox Issues 2022-11-27 03:35:49 +13:00
1071a12777 Thumbnail size = 256px 2022-11-27 03:35:49 +13:00
d987d0a336 Saves thumbnails to separate thumbnails directory 2022-11-27 03:35:49 +13:00
50a67a7172 Implements thumbnails for gallery
- Thumbnails are saved whenever an image is saved, and when gallery requests images from server
- Thumbnails saved at original image aspect ratio with width of 128px as WEBP
- If the thumbnail property of an image is unavailable for whatever reason, the image's full size URL is used instead
2022-11-27 03:35:49 +13:00
a3308c853d Fix canvas resizing when both options and gallery are unpinned 2022-11-27 03:35:49 +13:00
cde395e02f Hotkey Cleanup
- Viewer is now Z
- Canvas Move tool is V - sync with PS
- Removed some unused hotkeys
2022-11-27 03:35:49 +13:00
e7f670a5b6 Fixes stage position changing on zoom 2022-11-27 03:35:49 +13:00
917c576ddb Fix missing key on ThemeChanger map 2022-11-27 03:35:49 +13:00
dfc0c587b1 Adds theme changer popover 2022-11-27 03:35:49 +13:00
548bcaceb2 Adds model drop-down to site header 2022-11-27 03:35:49 +13:00
5fd43fca13 Fixes paste image to upload 2022-11-27 03:35:49 +13:00
37a356d377 Improves canvas status text and adds option to toggle debug info 2022-11-27 03:35:49 +13:00
cccbfb12aa Removes stale code 2022-11-27 03:35:49 +13:00
d018b2d7a7 Fixes intermediate images being tiny in txt2img/img2img 2022-11-27 03:35:49 +13:00
e358adecdd Fix metadata viewer image url length when viewing intermediate 2022-11-27 03:35:49 +13:00
cdc5f66592 Fixes Use All Parameters 2022-11-27 03:35:49 +13:00
b8cebf29f2 Adds staging area hotkeys, disables gallery left/right when staging 2022-11-27 03:35:49 +13:00
68aebad7ad Fixes staging area outline 2022-11-27 03:35:49 +13:00
ae4a44de3e Fixes Canvas Auto Save to Gallery 2022-11-27 03:35:49 +13:00
2ab868314f Reorganises app file structure 2022-11-27 03:35:49 +13:00
bc46c46835 Refactors upload-related async thunks
- Now standard thunks instead of RTK createAsyncThunk()
- Adds toasts for all canvas upload-related actions
2022-11-27 03:35:49 +13:00
d82a21cfb2 Integrates #1487 - touch events
Need to add:
- Pinch zoom
- Touch-specific handling (some things aren't quite right)
2022-11-27 03:35:49 +13:00
87439feeb2 Add arguments to use SSL to webserver 2022-11-27 03:35:49 +13:00
e5951ad098 Revert "Fix theme changer not displaying current theme on page refresh"
This reverts commit 903edfb803e743500242589ff093a8a8a0912726.
2022-11-27 03:35:49 +13:00
4f51680307 Staging Area delete button is now red
So it doesnt feel blended into to the rest of them.
2022-11-27 03:35:49 +13:00
d0ceabd372 Fix staging area display toggle not working 2022-11-27 03:35:49 +13:00
2bda3d6d2f Unify Brush and Eraser Sizes 2022-11-27 03:35:49 +13:00
a96af7a15d Fix tab count in hotkeys panel 2022-11-27 03:35:49 +13:00
93192b90f4 Fix theme changer not displaying current theme on page refresh 2022-11-27 03:35:49 +13:00
024acf42af Update Hotkey Info
Add missing tooltip hotkeys and update the hotkeys modal to reflect the new hotkeys for the Unified Canvas.
2022-11-27 03:35:49 +13:00
04cb2d39cb Adds useToastWatcher hook
- Dispatch an `addToast` action with standard Chakra toast options object to add a toast to the toastQueue
- The hook is called in App.tsx and just useEffect's w/ toastQueue as dependency to create the toasts
- So now you can add toasts anywhere you have access to `dispatch`, which includes middleware and thunks
- Adds first usage of this for the save image buttons in canvas
2022-11-27 03:35:49 +13:00
c69573e65d Disables canvas actions which cannot be done during processing 2022-11-27 03:35:49 +13:00
84f702b6d0 Resets bounding box coords/dims when no image present 2022-11-27 03:35:49 +13:00
bb70c32ad5 Improves behaviour when setting init canvas image/reset view 2022-11-27 03:35:49 +13:00
425a1713ab Fixes possible hang on MaskCompositer 2022-11-27 03:35:49 +13:00
70e67c45dd Fixes canvas showing spinner on first load
Also adds good default canvas scale and positioning when no image is on it
2022-11-27 03:35:49 +13:00
07ca0876ec Updates hotkeys 2022-11-27 03:35:49 +13:00
aa96a457b6 Adds hotkeys and refactors sharing of konva instances
Adds hotkeys to canvas. As part of this change, the access to konva instance objects was refactored:

Previously closure'd refs were used to indirectly get access to the konva instances outside of react components.

Now, a  getter and setter function are used to provide access directly to the konva objects.
2022-11-27 03:35:49 +13:00
e28599cadb Sets status immediately when clicking Invoke 2022-11-27 03:35:49 +13:00
ae6dd219d9 Fix Current Image display background going over image bounds 2022-11-27 03:35:49 +13:00
19322fc1ec Fixes save to gallery including empty area, adds download and copy image 2022-11-27 03:35:49 +13:00
635e7da05d Abandons "inpainting" canvas lock 2022-11-27 03:35:49 +13:00
c0005eb063 Fixes bounding box not being rounded to 64 2022-11-27 03:35:49 +13:00
74485411a8 Fixes send to buttons 2022-11-27 03:35:49 +13:00
ed70fc683c Fixes reset canvas view when locked 2022-11-27 03:35:49 +13:00
425d3bc95d Clips lines drawn while canvas locked
When drawing with the locked canvas, if a brush stroke gets too close to the edge of the canvas and its stroke would extend past the edge of the canvas, the edge of that stroke will be seen after unlocking the canvas.

This could cause a problem if you unlock the canvas and now have a bunch of strokes just outside the init image area, which are far back in undo history and you cannot easily erase.

With this change, lines drawn while the canvas is locked get clipped to the initial image bbox, fixing this issue.

Additionally, the merge and save to gallery functions have been updated to respect the initial image bbox so they function how you'd expect.
2022-11-27 03:35:49 +13:00
3994c28b77 Fixes 2px layout shift on toggle canvas lock 2022-11-27 03:35:49 +13:00
0100a63b59 Stops unnecessary canvas rescales on gallery state change 2022-11-27 03:35:49 +13:00
432dc704a6 Organises features/canvas 2022-11-27 03:35:49 +13:00
1d540219fa Fixes bounding box ending up offscreen 2022-11-27 03:35:49 +13:00
827f516baf Organises features/canvas 2022-11-27 03:35:49 +13:00
48ad0c289c Rebases on dev, updates new env files w/ patchmatch 2022-11-27 03:35:49 +13:00
223e0529ba Fixes app after removing in/out-painting refs 2022-11-27 03:35:49 +13:00
98e3bbb3bd Add patchmatch and infill_method parameter to prompt2image (options are 'patchmatch' or 'tile'). 2022-11-27 03:35:49 +13:00
e3efcc620c Removes all references to split inpainting/outpainting canvas 2022-11-27 03:35:49 +13:00
15dd1339d2 Initial unification of canvas 2022-11-27 03:35:49 +13:00
caf8f0ae35 Removes console.log from redux-persist patch 2022-11-27 03:35:49 +13:00
cfb87bc116 WIP refactor to unified canvas 2022-11-27 03:35:49 +13:00
c0ad1b3469 Fixes: outpainting temp images show in gallery 2022-11-27 03:35:49 +13:00
4382cd0b91 Moves image uploading to HTTP
- It all seems to work fine
- A lot of cleanup is still needed
- Logging needs to be added
- May need types to be reviewed
2022-11-27 03:35:49 +13:00
b049bbc64e Fix iterative outpainting by restoring original images 2022-11-27 03:35:49 +13:00
34395ff490 Fixes crashes during iterative outpaint. Still doesn't work correctly though. 2022-11-27 03:35:49 +13:00
1bc1085542 Fixes bbox not resizing in outpainting if partially off screen 2022-11-27 03:35:49 +13:00
d7884432c9 Fixes inpainting not doing img2img when no mask 2022-11-27 03:35:49 +13:00
82f6402d04 Hides staging area outline on mouseover prev/next 2022-11-27 03:35:49 +13:00
0e7b735611 Fixes error on inpainting paste back
`TypeError: 'float' object cannot be interpreted as an integer`
2022-11-27 03:35:49 +13:00
5304ef504c Fixes wonky canvas layer ordering & compositing 2022-11-27 03:35:49 +13:00
17b295871f Outpainting tab loads to empty canvas instead of upload 2022-11-27 03:35:49 +13:00
70dcfa1684 Builds fresh bundle 2022-11-27 03:35:49 +13:00
5d484273ed Fixes "use all" not setting variationAmount
Now sets to 0 when the image had variations.
2022-11-27 03:35:49 +13:00
179656d541 Adds staging area 2022-11-27 03:35:49 +13:00
73099af6ec Fixes disappearing canvas grid lines 2022-11-27 03:35:49 +13:00
c223d93b4d Fix gallery width size for Outpainting
Also fixes the canvas resizing failing n fast pushes
2022-11-27 03:35:49 +13:00
4e34194479 Increases CFG Scale max to 200 2022-11-27 03:35:49 +13:00
00e2674076 Add Metadata To Viewer 2022-11-27 03:35:49 +13:00
0a2e67df1a Hotkeys improvement 2022-11-27 03:35:49 +13:00
7831468304 Canvas styling 2022-11-27 03:35:49 +13:00
88d02585e7 Limits history to 256 for each of undo and redo 2022-11-27 03:35:49 +13:00
f82e82f1bb Debounce > 300ms 2022-11-27 03:35:49 +13:00
317762861f Fixes invert mask 2022-11-27 03:35:49 +13:00
3f1360368d Fixes undo/redo 2022-11-27 03:35:49 +13:00
d5467e7db5 Attempts to fix redux-persist debounce patch 2022-11-27 03:35:49 +13:00
9284983429 Updates package.json to use redux-persist patches 2022-11-27 03:35:49 +13:00
bb79c78fe8 Fixes AttributeError: 'dict' object has no attribute 'invert_mask' 2022-11-27 03:35:49 +13:00
e3735ebb45 Adds debouncing 2022-11-27 03:35:49 +13:00
eb17dfdeaa Patches redux-persist and redux-deep-persist with debounced persists
Our app changes redux state very, very often. As our undo/redo history grows, the calls to persist state start to take in the 100ms range, due to a the deep cloning of the history. This causes very noticeable performance lag.

The deep cloning is required because we need to blacklist certain items in redux from being persisted (e.g. the app's connection status).

Debouncing the whole process of persistence is a simple and effective solution. Unfortunately, `redux-persist` dropped `debounce` between v4 and v5, replacing it with `throttle`. `throttle`, instead of delaying the expensive action until a period of X ms of inactivity, simply ensures the action is executed at least every X ms. Of course, this does not fix our performance issue. 

The patch is very simple. It adds a `debounce` argument - a number of milliseconds - and debounces `redux-persist`'s `update()` method (provided by `createPersistoid`) by that many ms.

Before this, I also tried writing a custom storage adapter for `redux-persist` to debounce the calls to `localStorage.setItem()`. While this worked and was far less invasive, it doesn't actually address the issue. It turns out `setItem()` is a very fast part of the process.

We use `redux-deep-persist` to simplify the `redux-persist` configuration, which can get complicated when you need to blacklist or whitelist deeply nested state. There is also a patch here for that library because it uses the same types as `redux-persist`.

Unfortunately, the last release of `redux-persist` used a package `flat-stream` which was malicious and has been removed from npm. The latest commits to `redux-persist` (about 1 year ago) do not build; we cannot use the master branch. And between the last release and last commit, the changes have all been breaking.

Patching this last release (about 3 years old at this point) directly is far simpler than attempting to fix the upstream library's master branch or figuring out an alternative to the malicious and now non-existent dependency.
2022-11-27 03:35:49 +13:00
1114ac97e2 Fixes (?) spacebar issues 2022-11-27 03:35:49 +13:00
c7ef41af54 Changes "Invert Mask" to "Preserve Masked Areas" 2022-11-27 03:35:49 +13:00
7075a17091 Implements invert mask 2022-11-27 03:35:49 +13:00
7f0fb47cf3 Remove save button from Canvas Controls (cleanup) 2022-11-27 03:35:49 +13:00
775f032c56 Mask Brush Preview now always at 0.5 opacity
The new mask is only visible properly at max opacity but at max opacity the brush preview becomes fully opaque blocking the view. So the mask brush preview no remains at 0.5 no matter what the Brush opacity is.
2022-11-27 03:35:49 +13:00
5410d42da0 Disable stage info in Inpainting Tab 2022-11-27 03:35:49 +13:00
e21e901fa2 Fixes inpainting + code cleanup 2022-11-27 03:35:49 +13:00
00385240e7 Adds mask design file 2022-11-27 03:35:49 +13:00
0a96d2a888 Fixes mask for FF 2022-11-27 03:35:49 +13:00
016551e036 Fixes warning about NaN? 2022-11-27 03:35:49 +13:00
b8bb46042c SVG mask 2022-11-27 03:35:49 +13:00
b44e9c7752 Changes mask to diagonal line pattern 2022-11-27 03:35:49 +13:00
8ed10c732b Revert "Fix Inpainting Canvas Rendering"
This reverts commit 114a74982944fbcd0feb3ce79e81fade4d3da147.
2022-11-27 03:35:49 +13:00
82a53782d0 Fix Inpainting Canvas Rendering 2022-11-27 03:35:49 +13:00
6adebf065f Fixes bad import 2022-11-27 03:35:49 +13:00
83f369053f Fixes issue with intermediates size
Sorry @lstein !
2022-11-27 03:35:49 +13:00
77d3839860 Do not show progress images in the viewer 2022-11-27 03:35:49 +13:00
c02a0da837 Builds fresh bundle 2022-11-27 03:35:49 +13:00
4f4c6bbe33 Fix delete hotkey not working 2022-11-27 03:35:49 +13:00
72ea5453ce Fix broken styling on the Clear Mask button 2022-11-27 03:35:49 +13:00
458081f9c9 Builds fresh bundle 2022-11-27 03:35:49 +13:00
d1fbe81a60 Pins react-hotkeys-hook to v4.0.2
See: https://github.com/JohannesKlauss/react-hotkeys-hook/issues/835
2022-11-27 03:35:49 +13:00
6c7191712f Rebases against development 2022-11-27 03:35:49 +13:00
248068fe5d make the docstring more readable and improve the list_models logic
Signed-off-by: devops117 <55235206+devops117@users.noreply.github.com>
2022-11-26 08:49:41 -05:00
9b281856ee Merge branch 'development' into development 2022-11-26 17:37:57 +05:30
fdf41cc739 Installer final tweaks (#1550)
This is the same as PR #1537 except that it removes a redundant
`scripts` argument from `setup.py` that appeared at some point.

I also had to unpin the github dependencies in `requirements.in` in
order to get conda CI tests to pass. However, dependencies are still
pinned in `requirements-base.txt` and the environment files, and install
itself is working. So I think we are good.
2022-11-25 11:24:30 -05:00
d079445943 install frontend/dist into package directory
- When invokeai installed with `pip install .`, the frontend
  will be in the venv directory under invokeai.
- When invokeai installed with `pip install -e .`, the frontend
  will be in the source repo.
-invoke_ai_web_sever.py will look in both places using relative
  addressing.
2022-11-25 06:42:00 +00:00
a997ab2cf6 Merge branch 'development' into development 2022-11-25 11:06:06 +05:30
e98068a546 unpinned clip, clipseg, gfpgan and k-diffusion
- conflicts with their counterparts in the environment files was
  causing the CI conda-based tests to fail.
- installer seems to work still
2022-11-25 04:49:41 +00:00
b945ae4e01 two more fixups
1. removed redundant `data_files` argument from setup.py
2. upped requirement to Python >= 3.9. This is due to a feature
   used in `argparse` that is only available in 3.9 or higher.
2022-11-25 03:50:52 +00:00
b23c471cf0 make mauwii code owner for docker build (#1549) 2022-11-25 04:46:10 +01:00
964e584bd3 remove redundant scripts arg from setup.py 2022-11-25 03:03:24 +00:00
461358bdde Merge branch 'development' into feat-install-unify-setup-requirements-pip 2022-11-24 21:55:39 -05:00
2433cc344a add test-invoke-pip.yml (#1521)
* add test-invoke-pip.yml

* update requirements-base.txt to fix tests

* install requirements-base.txt separate
since it requires to have torch already installed
also restore origin requirements-base.txt after suc. test in my fork

* restore origin requirements
add `basicsr>=1.4.2` to requirements-base.txt
remove second installation step

* re-add previously overseen req in lin-cuda

* fix typo in setup.py - `scripts/preload_models.py`

* use GFBGAN from branch `basicsr-1.4.2`

* remove `basicsr>=1.4.2` from base reqs

* add INVOKEAI_ROOT to env

* disable upgrade of `pip`, `setuptools` and `wheel`

* try to use a venv which should not contain `wheel`

* add relative path to pip command

* use `configure_invokeai.py --no-interactive --yes`

* set grpcio to `<1.51.0`

* revert changes to use venv

* remove `--prefer-binary`

* disable step to create models.yaml
since this will not be used anymore with new `configure_invokeai.py`

* use `pip install --no-binary=":all:"`

* another try to use venv

* try uninstalling wheel before installing reqs

* dont use requirements.txt as filename

* update cache-dependency-path

* add facexlib to requirements-base.txt

* first install requirements-base.txt

* first install `-e .`, then install requirements
I know that this is obviously the wrong order, but still have a feeling

* add facexlib to requirements.in

* remove `-e .` from reqs and install after reqs

* unpin torch and torchvision in requirements.in

* fix model dl path

* fix curl output path

* create directory before downloading model

* set INVOKEAI_ROOT_PATH
https://docs.github.com/en/actions/learn-github-actions/environment-variables#naming-conventions-for-environment-variables

* INVOKEAI_ROOT ${{ env.GITHUB_WORKSPACE }}/invokeai

* fix matrix stable-diffusion-model-dl-path

* fix INVOKEAI_ROOT

* fix INVOKEAI_ROOT

* add --root and --outdir to run-tests step

* create models.yaml from example

* fix scripts variable in setup.py
by removing unused scripts

* fix archive-results path

* fix workflow to reflect latest code changes

* fix copy paste error

* fix job name

* fix matrix.stable-diffusion-model

* restructure matrix

* fix `activate conda env` step

* update the environment yamls
use same 4 git packages as for pip

* rename job in test-invoke-conda

* add tqdm to environment-lin-amd.yml

* fix python commands in test-invoke-conda.yml

Co-authored-by: Lincoln Stein <lincoln.stein@gmail.com>
2022-11-25 01:24:24 +01:00
bd2eea1c70 Merge branch 'development' into development 2022-11-24 10:30:48 +05:30
16df759499 fix non-interactive behavior of config_invokeai.py
This corrects behavior of --no-interactive, which was in fact
asking for interaction!

New behavior:

If you pass --no-interactive it will behave exactly as it did before
and completely skip the downloading of SD models.

If you pass --yes it will do almost the same, but download the
recommended models. The combination of the two arguments is the same
as --no-interactive.
2022-11-23 23:07:47 -05:00
5a1a36ec29 feat(install); unify setup.py, requirements.in, pip
This allows populating setup.py's 'install_requires' directly from 'requirements.in'

- setup.py:
  - read 'requirements.in' instead of 'requirements.txt'
  - add correct upstream pytorch repo to "dependency_links"
- requirements.in:
  - append "name @" to git packages
  - fix torch repo URL -> 'download.pytorch.org/whl/torch_stable.html'

Signed-off-by: Ben Alkov <ben.alkov@gmail.com>
2022-11-23 13:34:42 -05:00
c76badfb08 make the docstring more readable and improve the list_models logic
Signed-off-by: devops117 <55235206+devops117@users.noreply.github.com>
2022-11-23 10:40:27 +05:30
71c4f401b0 Merge branch 'fix-model-load-error-handling' of github.com:/invoke-ai/InvokeAI into fix-model-load-error-handling 2022-11-22 19:15:06 +00:00
c59b9897d9 remove file that shouldn't have been in PR 2022-11-22 19:14:52 +00:00
4cf1c856ed Merge branch 'development' into fix-model-load-error-handling 2022-11-22 14:11:26 -05:00
a78a1020be grpcio 1.51.0 is broken on M1 Macs. limit it to last good version til fixed 2022-11-22 12:05:45 -05:00
90cb7a6442 fix behavior when models.yaml missing entirely 2022-11-22 16:56:38 +00:00
8f5cded86e fix regression in ldm.invoke.model_cache.list_models()
- this was introduced in PR #1525 and not caught during my
  code review
2022-11-22 16:46:26 +00:00
02d02a86b1 gracefully handle broken or missing models at initial load time
- If initial model fails to load, invoke.py will inform the user that
  something is wrong with models.yaml or the models themselves and
  drop user into configure_invokeai.py to repair the problem.

- The model caching system will longer try to reload the current model
  if there is none.
2022-11-22 16:36:11 +00:00
ba9c695463 Merge branch 'development' into fix-model-load-error-reporting 2022-11-22 16:24:00 +00:00
8202f34f38 Merge remote-tracking branch 'origin' into fix-model-load-error-reporting 2022-11-22 16:22:29 +00:00
40a7f47d22 change typehint "a|b" operation to Union[a,b] to run on Python < 3.10
- this incompatibility was introduced by #1525 and missed during
  code review
2022-11-22 11:21:04 -05:00
37bcf9cc47 this small fix adds back the load_models.py script
- fixes broken setup.py in current dev
- it is just an alias for configure_invokeai.py
- preload_models.py will be deprecated, but for now
  it is a second alias
2022-11-22 11:21:04 -05:00
0340d9ad53 fix(install): more fixes
- install scripts:
   - allow EN-abling pip cache (use 'use-cache' as an arg to the install script)
   - debug message showing which sourceball we're downloading
   - add 'wheel' to pip update, so we can speed up installs from source (and quiet deprecations)
- install.sh: use absolute path for micromamba
- setup.py:
  - fill 'install_requires' using 'requirements.in'
  - fix 'load_models' script name
Signed-off-by: Ben Alkov <ben.alkov@gmail.com>
2022-11-22 11:06:50 -05:00
0d35a67e9c fix run-breaking typo (#1532) 2022-11-22 14:27:23 +01:00
1260e28d94 fix typo 2022-11-22 14:21:15 +01:00
229f782e3b check the function signatures and add some easy annotations
Signed-off-by: devops117 <55235206+devops117@users.noreply.github.com>
2022-11-22 08:14:58 -05:00
c15b839dd4 remove additional newline from the textwrap.dedent string
Signed-off-by: devops117 <55235206+devops117@users.noreply.github.com>
2022-11-22 08:14:58 -05:00
a095214e52 cleanup ldm/invoke/model_cache.py
remove duplicate import: os
ldm.util.ask_user is imported only once now
introduce textwrap and contextlib packages to clean up the code
return, returns None implicitly so it is omitted
a function returns None by default so it is omitted
dict.get returns None by default if the value is not found so it is omitted
type of True is a bool and if the module only returns True then it should not return anything in the first place
added some indentations and line breaks to further improve readability

Signed-off-by: devops117 <55235206+devops117@users.noreply.github.com>
2022-11-22 08:14:58 -05:00
8e81425e89 fix outcropping crash when png has no InvokeAI metadata
- Closes #1461
2022-11-21 16:35:00 -05:00
c5cbe8f87d When doing -t/--log_tokenization, also log prompt parser output (#1529)
The log was deleted at some point, this brings it back when user does
`--log_tokenization`/`-t`
2022-11-21 19:37:55 +01:00
e0581a2c37 when doing --log_tokenization/-t also log parsed prompt 2022-11-21 19:27:44 +01:00
32f538bf3a fix another place where rename() should be replace() 2022-11-21 08:44:26 -05:00
3c5a14a814 fixes configure_invokeai.py crash on Windows systems
The step in which the new models.yaml file replaces the old one was
crashing on Windows due to the fact that on Windows, the os.rename()
function will refuse to replace an existing file, unlike the behavior
on Linux and Mac. The os.replace() function, which was introduced in
python3, supposedly fixes this.
2022-11-21 08:44:26 -05:00
0661256b61 Merge branch 'interactive-configuration' into development 2022-11-20 23:32:28 +00:00
602e35db65 Fix issues with '.' not being consisent when run using web gui. 2022-11-20 18:22:13 -05:00
bc7ece771d instead linking modelfile use custom models.yaml 2022-11-20 18:21:34 -05:00
38bdb440d0 remove several debugging messages
- dangling debug messages in several files, introduced during
  testing of the external root directory
- these need to be removed before they are interpreted as errors by users
2022-11-20 18:20:40 -05:00
ce8c2bea2f fix(install): load_models needs to be absolutely last
setup.py: Put in the name of the *product*, not the project

Signed-off-by: Ben Alkov <ben.alkov@gmail.com>
2022-11-20 12:23:20 -05:00
3ac0f11e97 toil(invoke): more meaningful messaging
Signed-off-by: Ben Alkov <ben.alkov@gmail.com>
2022-11-20 12:23:20 -05:00
98fe49cb55 hotfix(unified install): last minute changes missing from PR #1506
'requirements.in':
  - add picklescan
  - finally find a good compromise for torch (==1.12.0) and
    torchvision (==0.13.0) across all platforms
'invoke.sh: hotfix for MacOS - add `export PYTORCH_ENABLE_MPS_FALLBACK=1`

Signed-off-by: Ben Alkov <ben.alkov@gmail.com>
2022-11-20 12:23:20 -05:00
2b7e3abe57 fix(args): fix INITFILE spelling (#1518)
fixes #1516
2022-11-20 01:45:27 +01:00
150c4a5d2d fix(args): fix INITFILE spelling 2022-11-19 12:01:02 -08:00
0381a853b5 add interactive configuration to the model loader
- Loader is renamed `configure_invokeai.py`, but `preload_models.py` is retained
  (as a shell) for backward compatibility

- At startup, if no runtime root directory exists and no `.invokeai` startup file is
  present, user will be prompted to select the runtime and outputs directories.

- Also expanded the number of initial models offered to the user to include the
  most "liked" ones from HuggingFace, including the two trinart models, the
  PaperCut model, and the VoxelArt model.

- Created a configuration file for initial models to be offered to the user, at
  configs/INITIAL_MODELS.yaml
2022-11-19 19:20:28 +00:00
c79ec204ec Fixed default --embiggen_strength to None to avoid it being printed on every run (#1515) 2022-11-19 13:24:11 +01:00
8d3b1582a5 Fixed default to None 2022-11-19 11:50:26 +00:00
5fd7d71a7a remove several debugging messages
- dangling debug messages in several files, introduced during
  testing of the external root directory
- these need to be removed before they are interpreted as errors by users
2022-11-18 21:14:28 +00:00
1f0220697b Fix micromamba tar command for macOS
Moved the -O from after the file to after the tar command for compatibility with macOS

Signed-off-by: Kevin Coakley <kcoakley@sdsc.edu>
2022-11-18 15:57:06 -05:00
18ae3949ef fix typo in error message 2022-11-18 20:53:49 +00:00
aa95510444 Merge branch 'development' into create-invokeai-run-directory 2022-11-18 15:27:51 -05:00
f33df25830 address all review comments; needs testing 2022-11-18 15:25:23 -05:00
3a5a8ceba5 Merge branch 'create-invokeai-run-directory' of github.com:/invoke-ai/InvokeAI into create-invokeai-run-directory 2022-11-18 19:35:45 +00:00
a1e5f17d1e realesrgan and facexlib now download models to correct directory
- fix issue in which both realesrgan and facexlib were downloading
  weight files to source directory

- cleaned up status reporting in load_models.py
2022-11-18 19:35:13 +00:00
303431be89 move CLI into its own module 2022-11-18 19:35:10 +00:00
8e9f80cc97 web server runs off runtime directory now 2022-11-18 19:34:28 +00:00
3ad598761c support for wheel building; webserver broken 2022-11-18 19:34:28 +00:00
b4eaf8b751 fix (unified installer): various fixes (#1506)
This list makes it look like there's lot going on for a single commit,
but the changes are actually pretty small

- 'install'/'invoke' scripts:
  - use venv's 'activate' script instead of hacking PATH
- 'deactivate' before exiting, so we don't leave a confusing environment
hanging around
- 'setup.py':
- make 'install_requires" an accurate list of our direct dependencies,
as it should be
  - add more info/details for eventual use in pypi
- 'invoke' scripts: "developer console" invocation simplified/better
logging (it's now *much* more obvious from inspection what the
"developer console" actually *is*)
- 'requirements.in':
- move 'clipseg' package out of installer and into requirements where it
should be
- bump/pin 'accelerate' package to 0.14.0 to bypass torch 1.13 SIGKILL
issue on Windows (prep for when we decide to upgrade)
- pin 'torch' as well as 'torchvision', to reduce pip-compile's
confusion
- notebooks: delete unused/deprecated notebook installer

Signed-off-by: Ben Alkov <ben.alkov@gmail.com>
2022-11-18 16:54:00 +01:00
fa608efa11 move CLI into its own module 2022-11-18 06:48:42 +00:00
e9d319bfde ensure web server works with legacy runtime directory 2022-11-18 06:48:14 +00:00
561721aef7 web server runs off runtime directory now 2022-11-18 06:10:52 +00:00
891c0f21d5 web server now observes --root option 2022-11-18 05:00:02 +00:00
8973ce7d47 support for wheel building; webserver broken 2022-11-18 03:21:07 +00:00
51c283ba56 fix(install): various fixes
- 'install'/'invoke' scripts: use venv 'activate' script
- 'setup.py':
  - make  'install_requires" accurate
  - add more details for eventual use in pypi
- 'invoke' scripts: "developer" console invocation simplified/better logging
- requirements:
  - move 'clipseg' package out of installer and into requirements where it should be
  - bump/pin 'accelerate' package to 0.14.0 to bypass torch 1.13 SIGKILL issue on Windows (prep for when we decide to upgrade)
- 'requirements.in': pin torch as well to reduce pip-compile's confusion
- notebooks: delete unused/deprecated notebook installer

Signed-off-by: Ben Alkov <ben.alkov@gmail.com>
2022-11-17 16:35:24 -05:00
7d262fc158 Fix macOS install.sh by patching sysconfig (#1488)
On macOS, patch python sysconfig just before creating the venv so that
extensions (greenlet & grpcio) can build.

Ref https://github.com/indygreg/python-build-standalone/issues/103, in
particular the solution from @alecthomas posted here:
https://github.com/indygreg/python-build-standalone/issues/103#issuecomment-1234942425

To use: checkout, cd into `installer`, run `create_installers.sh`, copy
`InvokeAI-mac.zip` into an empty folder outside of your existing
invokeAI install, unzip it and run `install.sh`.
2022-11-17 22:34:23 +01:00
fdb16000ab add module __init__ files for backend 2022-11-17 19:54:28 +00:00
f62cc7db9d add a ~/.invokeai file the first time we load
- If there is not already a `.invokeai` file in the user's home directory
  the first time invoke.py runs, it will create an empty one with comments
  showing how to customize it.
2022-11-17 10:15:05 -05:00
9fa3e28dd4 Fixed Google Colab requirements URL
Signed-off-by: slashtechno <77907286+slashtechno@users.noreply.github.com>
2022-11-17 10:14:43 -05:00
9200b26f21 Merge branch 'development' into create-invokeai-run-directory 2022-11-16 23:10:46 -05:00
d998b2f806 Add picklescan to env files 2022-11-16 23:02:35 -05:00
ac8a7ff70b Unpin picklescan req and cleanup 2022-11-16 23:02:35 -05:00
2d6e0baa87 Add Model Scanning 2022-11-16 23:02:35 -05:00
c212b74990 add code of conduct 2022-11-16 21:40:36 -05:00
0352979a8b Added documentation about --embiggen_strength 2022-11-16 11:55:45 -05:00
70bd61d616 Fixed opt.embiggen_strength again 2022-11-16 11:55:45 -05:00
f2a6985c78 Added --embiggen_strength option 2022-11-16 11:55:45 -05:00
fe5a581313 allow images to be saved into invokeai run directory
- This fixes an issue in which generated images were not being saved
  into the ~/invokeai/outputs directory, but were instead being stored
  to a relative './outputs/img_samples' path as before.

- Note that if you specify a relative directory in the --outdir argument,
  it will now be interpreted as relative to the invokeai run directory.
  You will need to provide an absolute pathname in order to save the
  outputs outside this directory.

- Also found and fixed a minor problem in which commands with syntax
  errors were not being stored to the CLI command history.
2022-11-15 20:33:58 +00:00
2ec9792f50 fix clipseg model loading
- This fixes the clipseg loading code so that it looks in the root directory
  for the model.

- It also adds several __init__.py files needed to allow InvokeAI to be
  installed without the -e (editable) flag. This lets you delete the
  source code directory after installation.
2022-11-15 19:17:14 +00:00
a4204abfce This commit separates the InvokeAI source code from end-user files
- preload_models.py has been renamed load_models.py. I've left a
  shell legacy version with the previous name to avoid breaking any
  code.

- The load_models.py script now takes an optional --root argument,
  which points to an install directory for the models, scripts, config
  files, and the default outputs directory. In the future, the
  embeddings manager directory will also be stored here.

- If no --root is provided, and no init file or environment variable
  is present, load_models.py will install to '.' by default, which is
  the current behavior. (This has *not* been tested thoroughly.)

- The location of the root directory is stored in the file .invokeai
  in the user's home directory ($HOME on Linux/Mac, or HOMEPATH on
  windows). The load_models.py script creates this file if it
  does not already exist.

- invoke.py and load_models.py use the following search path to find
  the install directory:

  1. Contents of the environment variable INVOKEAI_ROOT
  2. The --root=XXXXX option in ~/.invokeai
  3. The --root option passed on the script command line.
  4. As a last gasp, the currently working directory (".")

    Running `python scripts/load_models.py --root ~/invokeai`  will
    create a directory structured like this (shortened for clarity):

    ~/invokeai
    ├── configs
    │   ├── models.yaml
    │   └── stable-diffusion
    │       ├── v1-finetune.yaml
    │       ├── v1-finetune_style.yaml
    │       ├── v1-inference.yaml
    │       ├── v1-inpainting-inference.yaml
    │       └── v1-m1-finetune.yaml
    ├── models
    │   ├── CompVis
    │   ├── bert-base-uncased
    │   ├── clipseg
    │   ├── codeformer
    │   ├── gfpgan
    │   ├── ldm
    │   │   └── stable-diffusion-v1
    │   │       ├── sd-v1-5-inpainting.ckpt
    │   │       └── vae-ft-mse-840000-ema-pruned.ckpt
    │   └── openai
    ├── outputs
    └── scripts
	├── dream.py
	├── images2prompt.py
	├── invoke.py
	├── legacy_api.py
	├── load_models.py
	├── merge_embeddings.py
	├── orig_scripts
	│   ├── download_first_stages.sh
	│   ├── train_searcher.py
	│   └── txt2img.py
	├── preload_models.py
	└── sd-metadata.py

1. You can now run invoke.py anywhere! Just copy it to one of your
   bin directories, or put the ~/invokeai/scripts onto your PATH.

2. git pulls will no longer fight with you over models.yaml

3. It keeps end users out of the source code repo and will create
   a path for us to do installs from invokeai.tar.gz.
2022-11-15 18:39:31 +00:00
274b276133 model paths fixed, codeformer needs attention 2022-11-15 18:39:31 +00:00
7707bc7818 patch python sysconfig so that extensions (greenlet & grpcio) can build 2022-11-15 18:41:58 +01:00
4c035ad4ae update test-tube version requirements to match yanl files, partitally fixes pip install build on macOS 2022-11-14 17:34:10 -05:00
e9090bca8f make @mauwii codeowner for the CI workflows 2022-11-14 12:45:15 -05:00
398a9bc0c6 fix incorrect bounding-box calculation in ImageResizer
- Under some circumstances, the image resizer was fitting
  the wrong dimension to the user-provided bounding box
  when an init image provided.
- Closes #1470.
2022-11-14 17:41:02 +00:00
38b9658c15 adding troubleshooting tips to the newer doc 2022-11-14 15:32:22 +00:00
f04d1bab21 Merge branch 'development' into sync-dev-with-main 2022-11-13 21:51:17 +00:00
c23efb8e2b change installer download repo to main.tar.gz 2022-11-13 21:49:09 +00:00
5604d3c447 documentation hot fixes
- changes pointers to installation instructions from README
- Adds the changelog for the 2.1.3 release
2022-11-13 21:46:54 +00:00
206101f59d revert initializer words for embeddings 2022-11-13 15:47:28 -05:00
23348dcd3f sync dev to main 2022-11-13 13:47:26 +00:00
9bf6013fdd refactor(cross_attention_control): remove outer CrossAttentionControl class (#1459)
I was working on attention control in #1384, started making a few
changes to improve the typing and make it easier to work with. Then the
whitespace changes touched so many lines it seemed worth separating out
these refactoring operations to this PR so they don't get mixed up with
other functional changes.

It would be helpful to merge this to `development` before continuing
work on attention control in #1384

The github diff isn't good at showing these together since they changed
whitespace on so many lines. It may be easier to review by looking at
the individual commits, and/or toggling the "hide whitespace
differences" option in the view.
2022-11-13 14:20:18 +01:00
1d11e06e6f Remove gfpgan_dir
+ Update GFPGAN Model Path Defaults
>  Update them to match the new file heirarchy
2022-11-12 19:24:11 -05:00
47e6f94111 refactor(cross_attention_control): type hints and other lint 🚮 2022-11-12 11:25:39 -08:00
810fad9e06 refactor(cross_attention_control): re-order enum class for easier reference 2022-11-12 11:05:33 -08:00
853c6af623 refactor(cross_attention_control): remove outer CrossAttentionControl class
Python has modules. We don't need to use a class to provide a namespace.
2022-11-12 11:01:10 -08:00
1b6bbfb4db Merge branch 'lstein-outcrop-improvements' of github.com:/invoke-ai/InvokeAI into lstein-outcrop-improvements 2022-11-12 15:41:16 +00:00
67e25624b9 simplify logic around negative seeds 2022-11-12 15:41:01 +00:00
9c218788e2 Merge branch 'development' into lstein-outcrop-improvements 2022-11-12 10:39:57 -05:00
bb084a844b simplify logic around negative seeds 2022-11-12 15:39:03 +00:00
0a88243911 Revert "Outcrop improvements" (#1449)
Reverts invoke-ai/InvokeAI#1414

- missed review comments from @Kyle0654
2022-11-11 15:38:02 -05:00
8a0a90d0f3 Merge branch 'lstein-outcrop-improvements' of github.com:/invoke-ai/InvokeAI into lstein-outcrop-improvements 2022-11-11 20:37:13 +00:00
9141132a5c enhance outcropping with ability to direct contents of new regions
This commit does several things that improve the customizability of the CLI `outcrop` command:

1. When outcropping an image you can now add a `--new_prompt` option, to specify a new prompt to be applied to the outpainted region instead of the prompt used to generate the image.
2. Similarly you can provide a new seed using `--seed` (or `-S`). A seed less than zero will pick one randomly.
3. The metadata written into the outcropped file is now more informative about what was previously stored.
4. This PR also fixes the crash that happened when trying to outcrop an image  that does not contain InvokeAI metadata.

Other changes:

- add error checking suggested by @Kyle0654
- add special case in invoke.py to allow -1 to be passed as seed.
  This now only occurs for postprocessing commands. Previously, -1
  caused previous seed to be used, and this still applies to generate
  operations.
2022-11-11 20:34:21 +00:00
78f7bef1a3 Revert "enable outcropping of random JPG/PNG images"
This reverts commit 48aa6416dc.
2022-11-11 10:30:44 -05:00
1fb7b50be7 Revert "enhance outcropping with ability to direct contents of new regions"
This reverts commit 8aa94d5774.
2022-11-11 10:30:44 -05:00
b57c81ab38 Remove editable flag from clipseg in requirements 2022-11-11 09:32:07 -05:00
af040e97af prevent two models from being marked default in models.yaml 2022-11-11 09:28:17 -05:00
8dc7f119e5 Fix performance issue introduced by torch cuda cache clear during generation 2022-11-10 23:01:32 -08:00
4b4111a802 fix invoke.py crash if no models.yaml file present
- Script will now offer the user the ability to create a
  minimal models.yaml and then gracefully exit.
- Closes #1420
2022-11-10 21:54:26 -05:00
832f183320 fix #1402 2022-11-10 21:54:13 -05:00
8aa94d5774 enhance outcropping with ability to direct contents of new regions
- When outcropping an image you can now add a `--new_prompt` option, to specify
  a new prompt to be used instead of the original one used to generate the image.

- Similarly you can provide a new seed using `--seed` (or `-S`). A seed of zero
  will pick one randomly.

- This PR also fixes the crash that happened when trying to outcrop an image
  that does not contain InvokeAI metadata.
2022-11-10 21:53:52 -05:00
48aa6416dc enable outcropping of random JPG/PNG images
- Works best with runwayML inpainting model
- Numerous code changes required to propagate seed to final metadata.
  Original code predicated on the image being generated within InvokeAI.
2022-11-10 21:53:52 -05:00
47ddda1f64 Revert "Log strength with hires"
This reverts commit 82d4904c07.
2022-11-10 16:50:00 -05:00
c248ae44d4 Revert "Resize hires as an image"
This reverts commit d05b1b3544.
2022-11-10 16:50:00 -05:00
9e4545b2fc Fixes typos in README.md 2022-11-10 09:15:29 -05:00
8cf3883adc re-change TencentARC/GFPGAN to invoke-ai/GFPGAN 2022-11-09 12:53:36 -05:00
e06a6ed4c8 add changes required by @tildebyte 2022-11-09 12:53:36 -05:00
12a33f6e2d fix conflict in environment-linux-aarch64.yml 2022-11-09 12:53:36 -05:00
6d9638ba31 remove PIP_EXISTS_ACTION from env 2022-11-09 12:53:36 -05:00
c54eb00055 update python version 2022-11-09 12:53:36 -05:00
72338506ed update environment.yml 2022-11-09 12:53:36 -05:00
78c1d07c4b update environment-linux-aarch64.yml 2022-11-09 12:53:36 -05:00
143b18af8a update pip dependencies
- remove realesrgan
- add git+https://github.com/invoke-ai/Real-ESRGAN.git
- remove git+https://github.com/CompVis/taming-transformers.git
- add taming-transformers-rom1504
- change TencentARC/GFPGAN to invoke-ai/GFPGAN
2022-11-09 12:53:36 -05:00
9d39d6ecb3 add PIP_EXISTS_ACTION=w to test-invoke-conda`s env 2022-11-09 12:53:36 -05:00
9686bf0ea8 switch back to getpass_asterisk... ... until preload_models.py is ready 2022-11-09 12:53:36 -05:00
7aa7be6b24 use taming-transformers-rom1504, remove -e ...
... to address required changes
2022-11-09 12:53:36 -05:00
443c9110f1 remove push triggers, since pr trigger is enough 2022-11-09 12:53:36 -05:00
ae0ce82609 add 2 missed versions
unpinned them for testing purpose with linux container, 4got to re-pin
2022-11-09 12:53:36 -05:00
f1982cb6d8 update push triggers in test-invoke-conda.yml 2022-11-09 12:53:36 -05:00
af62958323 update environment-mac.yml 2022-11-09 12:53:36 -05:00
9342ad8d97 prevent crash when switching to an invalid model 2022-11-09 10:07:15 -05:00
5214742d02 don't suppress exceptions when doing cross-attention control 2022-11-09 07:21:21 -05:00
178f0c78d8 Fix #1362 by improving VRAM usage patterns when doing .swap()
commit ef3f7a26e242b73c2beb0195c7fd8f654ef47f55
Author: damian0815 <null@damianstewart.com>
Date:   Tue Nov 8 12:18:37 2022 +0100

    remove log spam

commit 7189d649622d4668b120b0dd278388ad672142c4
Author: damian0815 <null@damianstewart.com>
Date:   Tue Nov 8 12:10:28 2022 +0100

    change the way saved slicing strategy is applied

commit 01c40f751ab72955140165c16f95ae411732265b
Author: damian0815 <null@damianstewart.com>
Date:   Tue Nov 8 12:04:43 2022 +0100

    fix slicing_strategy_getter callsite

commit f8cfe25150a346958903316bc710737d99839923
Author: damian0815 <null@damianstewart.com>
Date:   Tue Nov 8 11:56:22 2022 +0100

    cleanup, consistent dim=0 also tested

commit 5bf9b1e890d48e962afd4a668a219b68271e5dc1
Author: damian0815 <null@damianstewart.com>
Date:   Tue Nov 8 11:34:09 2022 +0100

    refactored context, tested with non-sliced cross attention control

commit d58a46e39bf562e7459290d2444256e8c08ad0b6
Author: damian0815 <null@damianstewart.com>
Date:   Sun Nov 6 00:41:52 2022 +0100

    cleanup

commit 7e2c658b4c06fe239311b65b9bb16fa3adec7fd7
Author: damian0815 <null@damianstewart.com>
Date:   Sat Nov 5 22:57:31 2022 +0100

    disable logs

commit 20ee89d93841b070738b3d8a4385c93b097d92eb
Author: damian0815 <null@damianstewart.com>
Date:   Sat Nov 5 22:36:58 2022 +0100

    slice saved attention if necessary

commit 0a7684a22c880ec0f48cc22bfed4526358f71546
Author: damian0815 <null@damianstewart.com>
Date:   Sat Nov 5 22:32:38 2022 +0100

    raise instead of asserting

commit 7083104c7f3a0d8fd96e94a2f391de50a3c942e4
Author: damian0815 <null@damianstewart.com>
Date:   Sat Nov 5 22:31:00 2022 +0100

    store dim when saving slices

commit f7c0808ed383ec1dc70645288a798ed2aa4fa85c
Author: damian0815 <null@damianstewart.com>
Date:   Sat Nov 5 22:27:16 2022 +0100

    don't retry on exception

commit 749a721e939b3fe7c1741e7998dab6bd2c85a0cb
Author: damian0815 <null@damianstewart.com>
Date:   Sat Nov 5 22:24:50 2022 +0100

    stuff

commit 032ab90e9533be8726301ec91b97137e2aadef9a
Author: damian0815 <null@damianstewart.com>
Date:   Sat Nov 5 22:20:17 2022 +0100

    more logging

commit 3dc34b387f033482305360e605809d95a40bf6f8
Author: damian0815 <null@damianstewart.com>
Date:   Sat Nov 5 22:16:47 2022 +0100

    logs

commit 901c4c1aa4b9bcef695a6551867ec8149e6e6a93
Author: damian0815 <null@damianstewart.com>
Date:   Sat Nov 5 22:12:39 2022 +0100

    actually set save_slicing_strategy to True

commit f780e0a0a7c6b6a3db320891064da82589358c8a
Author: damian0815 <null@damianstewart.com>
Date:   Sat Nov 5 22:10:35 2022 +0100

    store slicing strategy

commit 93bb6d566fd18c5c69ef7dacc8f74ba2cf671cb7
Author: damian <git@damianstewart.com>
Date:   Sat Nov 5 20:43:48 2022 +0100

    still not it

commit 5e3a9541f8ae00bde524046963910323e20c40b7
Author: damian <git@damianstewart.com>
Date:   Sat Nov 5 17:20:02 2022 +0100

    wip offloading attention slices on-demand

commit 4c2966aa856b6f3b446216da3619ae931552ef08
Author: damian0815 <null@damianstewart.com>
Date:   Sat Nov 5 15:47:40 2022 +0100

    pre-emptive offloading, idk if it works

commit 572576755e9f0a878d38e8173e485126c0efbefb
Author: root <you@example.com>
Date:   Sat Nov 5 11:25:32 2022 +0000

    push attention slices to cpu. slow but saves memory.

commit b57c83a68f2ac03976ebc89ce2ff03812d6d185f
Author: damian0815 <null@damianstewart.com>
Date:   Sat Nov 5 12:04:22 2022 +0100

    verbose logging

commit 3a5dae116f110a96585d9eb71d713b5ed2bc3d2b
Author: damian0815 <null@damianstewart.com>
Date:   Sat Nov 5 11:50:48 2022 +0100

    wip fixing mem strategy crash (4 test on runpod)

commit 3cf237db5fae0c7b0b4cc3c47c81830bdb2ae7de
Author: damian0815 <null@damianstewart.com>
Date:   Fri Nov 4 09:02:40 2022 +0100

    wip, only works on cuda
2022-11-09 07:21:21 -05:00
2487040ae3 enhance outcropping with ability to direct contents of new regions
- When outcropping an image you can now add a `--new_prompt` option, to specify
  a new prompt to be used instead of the original one used to generate the image.

- Similarly you can provide a new seed using `--seed` (or `-S`). A seed of zero
  will pick one randomly.

- This PR also fixes the crash that happened when trying to outcrop an image
  that does not contain InvokeAI metadata.
2022-11-08 17:27:42 +00:00
5606af5083 enable outcropping of random JPG/PNG images
- Works best with runwayML inpainting model
- Numerous code changes required to propagate seed to final metadata.
  Original code predicated on the image being generated within InvokeAI.
2022-11-08 15:22:32 +00:00
4b5a96501d load favorite options from ~/.invokeai init file 2022-11-08 13:55:42 +00:00
ededeaed86 Merge branch 'add-invokeai-initfile' into development 2022-11-08 13:41:11 +00:00
636620b1d5 change initfile to ~/.invokeai
- adjust documentation
- also fix 'clipseg_models' to 'clipseg', which seems to be working now
2022-11-08 03:26:16 +00:00
21961f0c32 Revert "Use array slicing to calc ddim timesteps"
This reverts commit 1f0c5b4cf1.
2022-11-07 15:37:53 -05:00
1fe41146f0 add support for an initialization file, invokeai.init
- Place preferred startup command switches in a file named
  "invokeai.init". The file can consist of a single line of switches
  such as "--web --steps=28", a series of switches on each
  line, or any combination of the two.

 Example:
 ```
   --web
   --host=0.0.0.0
   --steps=28
   --grid
   -f 0.6 -C 11.0 -A k_euler_a
```

- The following options, which were previously only available within
  the CLI, are now available on the command line as well:

  --steps
  --strength
  --cfg_scale
  --width
  --height
  --fit
2022-11-06 22:02:45 -05:00
2ad6ef355a update discord link 2022-11-06 18:08:36 +00:00
865502ee4f update changelog 2022-11-06 09:27:59 -08:00
c7984f3299 update TROUBLESHOOT.md 2022-11-06 09:27:59 -08:00
7f150ed833 remove :from headlines in CONTRIBUTORS.md 2022-11-06 09:27:59 -08:00
badf4e256c enable navigation tabs
Since the docs are growing, this way they look cleaner
2022-11-06 09:27:59 -08:00
e64c60bbb3 remove preflight checks from assets
seems like somebody executed tests and commited them
2022-11-06 09:27:59 -08:00
1780618543 update INSTALLING_MODELS.md 2022-11-06 09:27:59 -08:00
f91fd27624 Bug fix for inpaint size 2022-11-06 09:25:50 -08:00
09e41e8f76 Add inpaint size options to inpaint at a larger size than the actual inpaint image, then scale back down for recombination 2022-11-06 09:25:50 -08:00
6eeb2107b3 remove create-caches.yml since not used anywhere 2022-11-06 09:21:43 -08:00
17053ad8b7 fix duplicated argument introduced by conflict resolution 2022-11-05 16:01:55 -04:00
fefb4dc1f8 Merge branch 'development' into fix_generate.py 2022-11-05 12:47:35 -07:00
d05b1b3544 Resize hires as an image 2022-11-05 11:54:23 -07:00
82d4904c07 Log strength with hires 2022-11-05 11:54:23 -07:00
1cdcf33cfa Merge branch 'main' into development
- this synchronizes recent document fixes by mauwii
2022-11-05 09:57:38 -04:00
6616fa835a fix Windows library dependency issues
This commit addresses two bugs:

1) invokeai.py crashes immediately with a message about an undefined
   attritube sigKILL (closes #1288). The fix is to pin torch at 1.12.1.

2) Version 1.4.2 of basicsr fails to load properly on Windows, and is
   a requirement of realesrgan, however 1.4.1 works. Pinning basicsr
   in our requirements file resulted in a dependency conflict, so I
   ended up cloning realesrgan into the invoke-ai Git space and changing
   the requirements file there.

If there is a more elegant solution, please advise.
2022-11-05 09:46:29 -04:00
7b9a4564b1 Update-docs (#1382)
* update IMG2IMG.md

* update INPAINTING.md

* update WEBUIHOTKEYS.md

* more doc updates (mostly fix formatting):
- OUTPAINTING.md
- POSTPROCESS.md
- PROMPTS.md
- VARIATIONS.md
- WEB.md
- WEBUIHOTKEYS.md
2022-11-05 09:36:45 -04:00
fcdefa0620 Hotifx docs (#1376) (#1377) 2022-11-04 12:47:31 -07:00
ef8b3ce639 Merge-main-into-development (#1373)
To get the rid of the difference between main and development.

Since otherwise it will be a pain to start fixing the documentatino
(when the state between main and development is not the same ...)

Also this should fix the problem of all tests failing since environment
yamls get updated.
2022-11-04 12:08:44 -04:00
36870a8f53 Merge branch 'development' into merge-main-into-development 2022-11-04 16:25:00 +01:00
b70420951d fix parsing error doing eg forest ().swap(in winter) 2022-11-03 20:15:23 -04:00
1f0c5b4cf1 Use array slicing to calc ddim timesteps 2022-11-03 20:11:04 -04:00
8648da8111 update environment-linux-aarch64 to use python 3.9 2022-11-03 20:06:26 -04:00
45b4593563 update environment-linux-aarch64.yml
- move getpass_asterisk to pip
2022-11-03 20:06:26 -04:00
41b04316cf rename job, remove debug branch from triggers 2022-11-03 20:06:26 -04:00
e97c6db2a3 include build matrix to build x86_64 and aarch64 2022-11-03 20:06:26 -04:00
896820a349 disable caching 2022-11-03 20:06:26 -04:00
06c8f468bf disable PR-Validation
since there are no files passed from context this is unecesarry
2022-11-03 20:06:26 -04:00
61920e2701 update action to use current branch
also update build-args of dockerfile and build.sh
2022-11-03 20:06:26 -04:00
f34ba7ca70 remove unecesarry mkdir command again 2022-11-03 20:06:26 -04:00
c30ef0895d remove symlink to GFPGANv1.4
also re-add mkdir to prevent action from failing
2022-11-03 20:06:26 -04:00
aa3a774f73 update build-container.yml to use cachev3 2022-11-03 20:06:26 -04:00
2c30555b84 update Dockerfile
- create models.yaml from models.yaml.example
- run preload_models.py with --no-interactive
2022-11-03 20:06:26 -04:00
743f605773 update build.sh to download sd-v1.5 model 2022-11-03 20:06:26 -04:00
519c661abb replace old fashined markdown templates with forms
this will help the readability of issues a lot 🤓
2022-11-03 21:21:43 +01:00
22c956c75f Merge branch 'development' of github.com:invoke-ai/InvokeAI into development 2022-11-03 10:20:21 -04:00
13696adc3a speculative change to solve windows esrgan issues 2022-11-03 10:20:10 -04:00
0196571a12 remove merge markers from preload_models.py 2022-11-02 22:39:35 -04:00
9666f466ab use refined model by default 2022-11-02 18:35:35 -04:00
240e5486c8 Merge branch 'spezialspezial-patch-9' into development 2022-11-02 18:35:00 -04:00
8164b6b9cf Merge branch 'development' of github.com:invoke-ai/InvokeAI into development 2022-11-02 17:06:46 -04:00
4fc82d554f [WebUI] Final 2.1 Release Build 2022-11-02 16:46:07 -04:00
96b34c0f85 Final WebUI build for Release 2.1
- squashed commit of 52 commits from PR #1327

don't log base64 progress images

Fresh Build For WebUI

[WebUI] Loopback Default False

Fixes bugs/styling

- Fixes missing web app state on new version:
Adds stateReconciler to redux-persist.

When we add more values to the state and then release the update app, they will be automatically merged in.

Reseting web UI will be needed far less.
7159ec

- Fixes console z-index
- Moves reset web UI button to visible area

Decreases gallery width on inpainting

Increases workarea split padding to 1rem

Adds missing tooltips to site header

Changes inpainting controls settings to hover

Fixes hotkeys and settings buttons not working

Improves bounding box interactions

- Bounding box can now be moved by dragging any of its edges
- Bounding box does not affect drawing if already drawing a stroke
- Can lock bounding box to draw directly on the bounding box edges
- Removes spacebar-hold behaviour due to technical issues

Fixes silent crash when init image too large

To send the mask to the server, the UI rendered the mask onto the init image and sent the whole image. The mask was then cropped by the server.

If the image was too large, the app silently failed. Maybe it exceeds the websocket size limit.

Fixed by cropping the mask in the UI layer, sending only bounding-box-sized mask image data.

Disabled bounding box settings when locked

Styles image uploader

Builds fresh bundle

Improves bounding box interaction

Added spacebar-hold-to-transform back.

Address bounding box feedback

- Adds back toggle to hide bounding box
- Box quick toggle = q, normal toggle = shift + q
- Styles canvas alert icons

Adds hints when unable to invoke

- Popover on Invoke button indicates why exactly it is disabled, e.g. prompt is empty, something else is processing, etc.
- There may be more than one reason; all are displayed.

Fix Inpainting Alerts Styling

Preventing unnecessary re-renders across the app

Code Split Inpaint Options

Isolate features to their own components so they dont re-render the other stuff each time.

[TESTING] Remove  global isReady checking

I dont believe this is need at all because the isready state is constantly updated when needed and tracked real time in the Redux store. This causes massive re-renders. @psychedelicious If this is absolutely essential for a reason that I do not see, please hit me up on Discord.

Fresh Bundle

Fix Bounding Box Settings re-rendering on brush stroke

[Code Splitting] Bounding Box Options

Isolated all bounding box components to trigger unnecessary re-renders. Still need to fix  bounding box  triggering re-renders on the control panel inside the canvas itself. But the options panel should be a good to go with this change.

Inpainting Controls Code Spitting and Performance

Codesplit the entirety of the inpainting controls. Created new selectors for each and every component to ensure there are no unnecessary re-renders. App feels a lot smoother.

Fixes rerenders on ClearBrushHistory

Fixes crash when requesting post-generation upscale/face restoration

- Moves the inpainting paste to before the postprocessing.

Removes unused isReady state

Changes Report Bug icon to a bug

Restores shift+q bounding box shortcut

Adds alert for bounding box size to status icons

Adds asCheckbox to IAIIconButton

Rough draft of this. Not happy with the styling but it's clearer than having them look just like buttons.

Fixes crash related to old value of progress_latents in state

Styling changes and settings modal minor refactor

Fixes: uploaded JPG images not loading

Reworks CurrentImageButtons.tsx

- Change all icons to FA iconset for consistency
- Refactors IAIIconButton, IAIButton, IAIPopover to handle ref forwarding
- Redesigns buttons into group

Only generate 1 iteration when seed fixed & variations disabled

Fixes progress images select

Fixes edge case: upload over gets stuck while alt tabbing

- Press esc to close it now

Fixes display progress images select typing

Fixes current image button rerenders

Adds min width to ImageUploader

Makes fast-latents in progress default

Update Icon Button Checkbox Style Styling

Fixes next/prev image buttons

Refactor canvas buttons + more

Add Save Intermediates Step Count

For accurate mode only.

Co-Authored-By: Richard Macarthy <richardmacarthy@protonmail.com>

Restores "initial image" text

Address feedback

- moves mask clear button
- fixes intermediates
- shrinks inpainting icons by 10%

Fix Loopback Styling

Adds escape hotkey to close floating panels

Readd Hotkey for Dual Display

Updated Current Image Button Styling
2022-11-02 16:46:18 -04:00
dd5a88dcee [WebUI] Final 2.1 Release Build 2022-11-02 16:40:47 -04:00
95ed56bf82 Updated Current Image Button Styling 2022-11-02 16:40:47 -04:00
1ae80f5ab9 Readd Hotkey for Dual Display 2022-11-02 16:40:47 -04:00
1f0bd3ca6c Adds escape hotkey to close floating panels 2022-11-02 16:40:47 -04:00
a1971f6830 Fix Loopback Styling 2022-11-02 16:40:47 -04:00
c6118e8898 Address feedback
- moves mask clear button
- fixes intermediates
- shrinks inpainting icons by 10%
2022-11-02 16:40:47 -04:00
7ba958cf7f Restores "initial image" text 2022-11-02 16:40:47 -04:00
383905d5d2 Add Save Intermediates Step Count
For accurate mode only.

Co-Authored-By: Richard Macarthy <richardmacarthy@protonmail.com>
2022-11-02 16:40:47 -04:00
6173e3e9ca Refactor canvas buttons + more 2022-11-02 16:40:47 -04:00
3feb7d8922 Fixes next/prev image buttons 2022-11-02 16:40:47 -04:00
1d9edbd0dd Update Icon Button Checkbox Style Styling 2022-11-02 16:40:47 -04:00
d439abdb89 Makes fast-latents in progress default 2022-11-02 16:40:47 -04:00
ee47ea0c89 Adds min width to ImageUploader 2022-11-02 16:40:47 -04:00
300bb2e627 Fixes current image button rerenders 2022-11-02 16:40:47 -04:00
ccf8593501 Fixes display progress images select typing 2022-11-02 16:40:47 -04:00
0fda612f3f Fixes edge case: upload over gets stuck while alt tabbing
- Press esc to close it now
2022-11-02 16:40:47 -04:00
5afff65b71 Fixes progress images select 2022-11-02 16:40:47 -04:00
7e55bdefce Only generate 1 iteration when seed fixed & variations disabled 2022-11-02 16:40:47 -04:00
620cf84d3d Reworks CurrentImageButtons.tsx
- Change all icons to FA iconset for consistency
- Refactors IAIIconButton, IAIButton, IAIPopover to handle ref forwarding
- Redesigns buttons into group
2022-11-02 16:40:47 -04:00
cfe567c62a Fixes: uploaded JPG images not loading 2022-11-02 16:40:47 -04:00
cefe12f1df Styling changes and settings modal minor refactor 2022-11-02 16:40:47 -04:00
1e51c39928 Fixes crash related to old value of progress_latents in state 2022-11-02 16:40:47 -04:00
42a02bbb80 Adds asCheckbox to IAIIconButton
Rough draft of this. Not happy with the styling but it's clearer than having them look just like buttons.
2022-11-02 16:40:47 -04:00
f1ae6dae4c Adds alert for bounding box size to status icons 2022-11-02 16:40:47 -04:00
6195579910 Restores shift+q bounding box shortcut 2022-11-02 16:40:47 -04:00
16c8b23b34 Changes Report Bug icon to a bug 2022-11-02 16:40:47 -04:00
07ae626b22 Removes unused isReady state 2022-11-02 16:40:47 -04:00
8d171bb044 Fixes crash when requesting post-generation upscale/face restoration
- Moves the inpainting paste to before the postprocessing.
2022-11-02 16:40:47 -04:00
6e33ca7e9e Fixes rerenders on ClearBrushHistory 2022-11-02 16:40:47 -04:00
db46e12f2b Inpainting Controls Code Spitting and Performance
Codesplit the entirety of the inpainting controls. Created new selectors for each and every component to ensure there are no unnecessary re-renders. App feels a lot smoother.
2022-11-02 16:40:47 -04:00
868e4b2db8 [Code Splitting] Bounding Box Options
Isolated all bounding box components to trigger unnecessary re-renders. Still need to fix  bounding box  triggering re-renders on the control panel inside the canvas itself. But the options panel should be a good to go with this change.
2022-11-02 16:40:47 -04:00
2e562742c1 Fix Bounding Box Settings re-rendering on brush stroke 2022-11-02 16:40:47 -04:00
68e6958009 Fresh Bundle 2022-11-02 16:40:47 -04:00
ea6e3a7949 [TESTING] Remove global isReady checking
I dont believe this is need at all because the isready state is constantly updated when needed and tracked real time in the Redux store. This causes massive re-renders. @psychedelicious If this is absolutely essential for a reason that I do not see, please hit me up on Discord.
2022-11-02 16:40:47 -04:00
b2879ca99f Code Split Inpaint Options
Isolate features to their own components so they dont re-render the other stuff each time.
2022-11-02 16:40:47 -04:00
4e911566c3 Preventing unnecessary re-renders across the app 2022-11-02 16:40:47 -04:00
9bafda6a15 Fix Inpainting Alerts Styling 2022-11-02 16:40:47 -04:00
871a8a5375 Adds hints when unable to invoke
- Popover on Invoke button indicates why exactly it is disabled, e.g. prompt is empty, something else is processing, etc. 
- There may be more than one reason; all are displayed.
2022-11-02 16:40:47 -04:00
0eef74bc00 Address bounding box feedback
- Adds back toggle to hide bounding box
- Box quick toggle = q, normal toggle = shift + q
- Styles canvas alert icons
2022-11-02 16:40:47 -04:00
423ae32097 Improves bounding box interaction
Added spacebar-hold-to-transform back.
2022-11-02 16:40:47 -04:00
8282e5d045 Builds fresh bundle 2022-11-02 16:40:47 -04:00
19305cdbdf Styles image uploader 2022-11-02 16:40:47 -04:00
eb9028ab30 Disabled bounding box settings when locked 2022-11-02 16:40:47 -04:00
21483f5d07 Fixes silent crash when init image too large
To send the mask to the server, the UI rendered the mask onto the init image and sent the whole image. The mask was then cropped by the server.

If the image was too large, the app silently failed. Maybe it exceeds the websocket size limit.

Fixed by cropping the mask in the UI layer, sending only bounding-box-sized mask image data.
2022-11-02 16:40:47 -04:00
82dcbac28f Improves bounding box interactions
- Bounding box can now be moved by dragging any of its edges
- Bounding box does not affect drawing if already drawing a stroke
- Can lock bounding box to draw directly on the bounding box edges
- Removes spacebar-hold behaviour due to technical issues
2022-11-02 16:40:47 -04:00
d43bd4625d Fixes hotkeys and settings buttons not working 2022-11-02 16:40:47 -04:00
ea891324a2 Changes inpainting controls settings to hover 2022-11-02 16:40:47 -04:00
8fd9ea2193 Adds missing tooltips to site header 2022-11-02 16:40:47 -04:00
fb02666856 Increases workarea split padding to 1rem 2022-11-02 16:40:47 -04:00
f6f5c2731b Decreases gallery width on inpainting 2022-11-02 16:40:47 -04:00
b4e3f771e0 Fixes bugs/styling
- Fixes missing web app state on new version:
Adds stateReconciler to redux-persist.

When we add more values to the state and then release the update app, they will be automatically merged in.

Reseting web UI will be needed far less.
7159ec

- Fixes console z-index
- Moves reset web UI button to visible area
2022-11-02 16:40:47 -04:00
99bb9491ac [WebUI] Loopback Default False 2022-11-02 16:40:47 -04:00
0453f21127 Fresh Build For WebUI 2022-11-02 23:26:49 +13:00
9fc09aa4bd don't log base64 progress images 2022-11-02 22:32:31 +13:00
5e87062cf8 Option to directly invert the grayscale heatmap - fix 2022-11-01 22:24:31 -04:00
3e7a459990 Update txt2mask.py 2022-11-01 22:24:31 -04:00
bbf4c03e50 Option to directly invert the grayscale heatmap
Theoretically less work inverting the image while it's small but I can't measure a significant difference. Though, handy option to have in some cases.
2022-11-01 22:24:31 -04:00
611a3a9753 fix name of caching step 2022-11-01 22:17:23 -04:00
1611f0d181 readd caching of sd-models
- this would remove the necesarrity of the secret availability in PRs
2022-11-01 22:17:23 -04:00
08835115e4 pin pytorch_lightning to 1.7.7, issue #1331 2022-11-01 22:11:44 -04:00
2d84e28d32 Merge branch 'development' of github.com:invoke-ai/InvokeAI into development 2022-11-01 22:11:04 -04:00
ef17aae8ab add damian0815 to contributors list 2022-11-02 13:55:52 +13:00
0cc39f01a3 report full size for fast latents and update conversion matrix for v1.5 2022-11-02 13:55:29 +13:00
688d7258f1 fix a bug that broke cross attention control index mapping 2022-11-02 13:54:54 +13:00
4513320bf1 save VRAM by not recombining tensors that have been sliced to save VRAM 2022-11-02 13:54:54 +13:00
533fd04ef0 Merge branch 'development' of github.com:invoke-ai/InvokeAI into development 2022-11-01 17:40:36 -04:00
dff5681cf0 shorter strings 2022-11-01 17:39:08 -04:00
5a2790a69b convert progress display to a drop-down 2022-11-01 17:39:08 -04:00
7c5305ccba do not try to save base64 intermediates in gallery on cancellation 2022-11-01 17:39:08 -04:00
4013e8ad6f Fixes b64 image sending and displaying 2022-11-01 17:39:08 -04:00
d1dfd257f9 wip base64 2022-11-01 17:39:08 -04:00
5322d735ee update frontend 2022-11-01 17:39:08 -04:00
cdb107dcda add option to show intermediate latent space 2022-11-01 17:39:08 -04:00
be1393a41c ensure existing exception handling code also handles new exception class 2022-11-01 17:37:26 -04:00
e554c2607f Rebuilt prompt parsing logic
Complete re-write of the prompt parsing logic to be more readable and
logical, and therefore also hopefully easier to debug, maintain, and
augment.

In the process it has also become more robust to badly-formed prompts.

Squashed commit of the following:

commit 8fcfa88a16e1390d41717e940d72aed64712171c
Author: Damian at mba <damian@frey.NOSPAMco.nz>
Date:   Sun Oct 30 17:05:57 2022 +0100

    further cleanup

commit 1a1fd78bcfeb49d072e3e6d5808aa8df15441629
Author: Damian at mba <damian@frey.NOSPAMco.nz>
Date:   Sun Oct 30 16:07:57 2022 +0100

    cleanup and document

commit 099c9659fa8b8135876f9a5a50fe80b20bc0635c
Author: Damian at mba <damian@frey.NOSPAMco.nz>
Date:   Sun Oct 30 15:54:58 2022 +0100

    works fully

commit 5e6887ea8c25a1e21438ff6defb381fd027d25fd
Author: Damian at mba <damian@frey.NOSPAMco.nz>
Date:   Sun Oct 30 15:24:31 2022 +0100

    further...

commit 492fda120844d9bc1ad4ec7dd408a3374762d0ff
Author: Damian at mba <damian@frey.NOSPAMco.nz>
Date:   Sun Oct 30 14:08:57 2022 +0100

    getting there...

commit c6aab05a8450cc3c95c8691daf38fdc64c74f52d
Author: Damian at mba <damian@frey.NOSPAMco.nz>
Date:   Fri Oct 28 14:29:03 2022 +0200

    wip doesn't compile

commit 5e533f731cfd20cd435330eeb0012e5689e87e81
Author: Damian at mba <damian@frey.NOSPAMco.nz>
Date:   Fri Oct 28 13:21:43 2022 +0200

    working with CrossAttentionCtonrol but no Attention support yet

commit 9678348773431e500e110e8aede99086bb7b5955
Author: Damian at mba <damian@frey.NOSPAMco.nz>
Date:   Fri Oct 28 13:04:52 2022 +0200

    wip rebuiling prompt parser
2022-11-01 17:37:26 -04:00
6215592b12 Merge branch 'development' of github.com:invoke-ai/InvokeAI into development 2022-11-01 17:34:55 -04:00
349cc25433 fix crash (be a little less aggressive clearing out the attention slice) 2022-11-01 17:34:28 -04:00
214d276379 be more aggressive at clearing out saved_attn_slice 2022-11-01 17:34:28 -04:00
ef24d76adc fix library problems in preload_modules 2022-11-01 17:23:27 -04:00
ab2b5a691d fix model_cache memory management issues 2022-11-01 17:23:20 -04:00
c7de2b2801 disable checks with sd-V1.4 model...
...to save some resources, since V1.5 is the default now
2022-10-31 21:19:53 -04:00
e8075658ac update test-invoke-conda.yml
- fix model dl path for sd-v1-4.ckpt
- copy configs/models.yaml.example to configs/models.yaml
2022-10-31 21:19:53 -04:00
4202dabee1 fix models example weights for sd-v1.4 2022-10-31 21:19:53 -04:00
d67db2bcf1 [WebUI] Loopback Default False 2022-10-31 21:18:03 -04:00
7159ec885f further improvements to preload_models.py
- Faster startup for command line switch processing
- Specify configuration file to modify using --config option:

  ./scripts/preload_models.ply --config models/my-models-file.yaml
2022-10-31 11:33:05 -04:00
b5cf734ba9 improve behavior of preload_models.py
- NEVER overwrite user's existing models.yaml
- Instead, merge its contents into new config file,
  and rename original to models.yaml.orig (with
  message)
- models.yaml has been removed from repository and renamed
  models.yaml.example
2022-10-31 11:08:19 -04:00
f7dc8eafee restore models.yaml to virgin state 2022-10-31 10:47:35 -04:00
762ca60a30 Update INPAINTING.md 2022-10-04 22:55:10 -04:00
e7fb9f342c add argument --outdir 2022-10-05 10:08:53 +09:00
50 changed files with 927 additions and 1230 deletions

View File

@ -171,12 +171,12 @@ title: Changelog
- Integrate sd-v1-5 model into test matrix (easily expandable), remove
unecesarry caches by @mauwii in
https://github.com/invoke-ai/InvokeAI/pull/1293
- add --no-interactive to configure_invokeai step by @mauwii in
- add --no-interactive to preload_models step by @mauwii in
https://github.com/invoke-ai/InvokeAI/pull/1302
- 1-click installer and updater. Uses micromamba to install git and conda into a
contained environment (if necessary) before running the normal installation
script by @cmdr2 in https://github.com/invoke-ai/InvokeAI/pull/1253
- configure_invokeai.py script downloads the weight files by @lstein in
- preload_models.py script downloads the weight files by @lstein in
https://github.com/invoke-ai/InvokeAI/pull/1290
## v2.0.1 <small>(13 October 2022)</small>

View File

@ -130,34 +130,20 @@ file should contain the startup options as you would type them on the
command line (`--steps=10 --grid`), one argument per line, or a
mixture of both using any of the accepted command switch formats:
!!! example "my unmodified initialization file"
!!! example ""
```bash title="~/.invokeai" linenums="1"
# InvokeAI initialization file
# This is the InvokeAI initialization file, which contains command-line default values.
# Feel free to edit. If anything goes wrong, you can re-initialize this file by deleting
# or renaming it and then running configure_invokeai.py again.
# The --root option below points to the folder in which InvokeAI stores its models, configs and outputs.
--root="/Users/mauwii/invokeai"
# the --outdir option controls the default location of image files.
--outdir="/Users/mauwii/invokeai/outputs"
# You may place other frequently-used startup commands here, one or more per line.
# Examples:
# --web --host=0.0.0.0
# --steps=20
# -Ak_euler_a -C10.0
```bash
--web
--steps=28
--grid
-f 0.6 -C 11.0 -A k_euler_a
```
!!! note
The initialization file only accepts the command line arguments.
There are additional arguments that you can provide on the `invoke>` command
line (such as `-n` or `--iterations`) that cannot be entered into this file.
Also be alert for empty blank lines at the end of the file, which will cause
an arguments error at startup time.
Note that the initialization file only accepts the command line arguments.
There are additional arguments that you can provide on the `invoke>` command
line (such as `-n` or `--iterations`) that cannot be entered into this file.
Also be alert for empty blank lines at the end of the file, which will cause
an arguments error at startup time.
## List of prompt arguments
@ -209,17 +195,15 @@ Here are the invoke> command that apply to txt2img:
| `--with_variations <pattern>` | | `None` | Combine two or more variations. See [Variations](./VARIATIONS.md) for now to use this. |
| `--save_intermediates <n>` | | `None` | Save the image from every nth step into an "intermediates" folder inside the output directory |
!!! note
Note that the width and height of the image must be multiples of 64. You can
provide different values, but they will be rounded down to the nearest multiple
of 64.
the width and height of the image must be multiples of 64. You can
provide different values, but they will be rounded down to the nearest multiple
of 64.
### This is an example of img2img:
!!! example "This is a example of img2img"
```bash
invoke> waterfall and rainbow -I./vacation-photo.png -W640 -H480 --fit
```
```
invoke> waterfall and rainbow -I./vacation-photo.png -W640 -H480 --fit
```
This will modify the indicated vacation photograph by making it more like the
prompt. Results will vary greatly depending on what is in the image. We also ask
@ -269,7 +253,7 @@ description of the part of the image to replace. For example, if you have an
image of a breakfast plate with a bagel, toast and scrambled eggs, you can
selectively mask the bagel and replace it with a piece of cake this way:
```bash
```
invoke> a piece of cake -I /path/to/breakfast.png -tm bagel
```
@ -281,7 +265,7 @@ are getting too much or too little masking you can adjust the threshold down (to
get more mask), or up (to get less). In this example, by passing `-tm` a higher
value, we are insisting on a more stringent classification.
```bash
```
invoke> a piece of cake -I /path/to/breakfast.png -tm bagel 0.6
```
@ -291,16 +275,16 @@ You can load and use hundreds of community-contributed Textual
Inversion models just by typing the appropriate trigger phrase. Please
see [Concepts Library](CONCEPTS.md) for more details.
## Other Commands
# Other Commands
The CLI offers a number of commands that begin with "!".
### Postprocessing images
## Postprocessing images
To postprocess a file using face restoration or upscaling, use the `!fix`
command.
#### `!fix`
### `!fix`
This command runs a post-processor on a previously-generated image. It takes a
PNG filename or path and applies your choice of the `-U`, `-G`, or `--embiggen`
@ -327,19 +311,19 @@ Some examples:
[1] outputs/img-samples/000017.4829112.gfpgan-00.png: !fix "outputs/img-samples/0000045.4829112.png" -s 50 -S -W 512 -H 512 -C 7.5 -A k_lms -G 0.8
```
#### `!mask`
### !mask
This command takes an image, a text prompt, and uses the `clipseg` algorithm to
automatically generate a mask of the area that matches the text prompt. It is
useful for debugging the text masking process prior to inpainting with the
`--text_mask` argument. See [INPAINTING.md] for details.
### Model selection and importation
## Model selection and importation
The CLI allows you to add new models on the fly, as well as to switch among them
rapidly without leaving the script.
#### `!models`
### !models
This prints out a list of the models defined in `config/models.yaml'. The active
model is bold-faced
@ -352,7 +336,7 @@ laion400m not loaded <no description>
waifu-diffusion not loaded Waifu Diffusion v1.3
</pre>
#### `!switch <model>`
### !switch <model>
This quickly switches from one model to another without leaving the CLI script.
`invoke.py` uses a memory caching system; once a model has been loaded,
@ -377,7 +361,7 @@ invoke> !switch waifu-diffusion
| Making attention of type 'vanilla' with 512 in_channels
| Using faster float16 precision
>> Model loaded in 18.24s
>> Max VRAM used to load the model: 2.17G
>> Max VRAM used to load the model: 2.17G
>> Current VRAM usage:2.17G
>> Setting Sampler to k_lms
@ -397,7 +381,7 @@ laion400m not loaded <no description>
waifu-diffusion cached Waifu Diffusion v1.3
</pre>
#### `!import_model <path/to/model/weights>`
### !import_model <path/to/model/weights>
This command imports a new model weights file into InvokeAI, makes it available
for image generation within the script, and writes out the configuration for the
@ -444,10 +428,10 @@ OK to import [n]? <b>y</b>
| Working with z of shape (1, 4, 32, 32) = 4096 dimensions.
| Making attention of type 'vanilla' with 512 in_channels
| Using faster float16 precision
invoke>
invoke>
</pre>
#### `!edit_model <name_of_model>`
###!edit_model <name_of_model>
The `!edit_model` command can be used to modify a model that is already defined
in `config/models.yaml`. Call it with the short name of the model you wish to
@ -484,12 +468,12 @@ text... Outputs: [2] outputs/img-samples/000018.2273800735.embiggen-00.png: !fix
"outputs/img-samples/000017.243781548.gfpgan-00.png" -s 50 -S 2273800735 -W 512
-H 512 -C 7.5 -A k_lms --embiggen 3.0 0.75 0.25 ```
### History processing
## History processing
The CLI provides a series of convenient commands for reviewing previous actions,
retrieving them, modifying them, and re-running them.
#### `!history`
### !history
The invoke script keeps track of all the commands you issue during a session,
allowing you to re-run them. On Mac and Linux systems, it also writes the
@ -501,22 +485,20 @@ during the session (Windows), or the most recent 1000 commands (Mac|Linux). You
can then repeat a command by using the command `!NNN`, where "NNN" is the
history line number. For example:
!!! example ""
```bash
invoke> !history
...
[14] happy woman sitting under tree wearing broad hat and flowing garment
[15] beautiful woman sitting under tree wearing broad hat and flowing garment
[18] beautiful woman sitting under tree wearing broad hat and flowing garment -v0.2 -n6
[20] watercolor of beautiful woman sitting under tree wearing broad hat and flowing garment -v0.2 -n6 -S2878767194
[21] surrealist painting of beautiful woman sitting under tree wearing broad hat and flowing garment -v0.2 -n6 -S2878767194
...
invoke> !20
invoke> watercolor of beautiful woman sitting under tree wearing broad hat and flowing garment -v0.2 -n6 -S2878767194
```
```bash
invoke> !history
...
[14] happy woman sitting under tree wearing broad hat and flowing garment
[15] beautiful woman sitting under tree wearing broad hat and flowing garment
[18] beautiful woman sitting under tree wearing broad hat and flowing garment -v0.2 -n6
[20] watercolor of beautiful woman sitting under tree wearing broad hat and flowing garment -v0.2 -n6 -S2878767194
[21] surrealist painting of beautiful woman sitting under tree wearing broad hat and flowing garment -v0.2 -n6 -S2878767194
...
invoke> !20
invoke> watercolor of beautiful woman sitting under tree wearing broad hat and flowing garment -v0.2 -n6 -S2878767194
```
####`!fetch`
### !fetch
This command retrieves the generation parameters from a previously generated
image and either loads them into the command line (Linux|Mac), or prints them
@ -526,36 +508,33 @@ a folder with image png files, and wildcard \*.png to retrieve the dream command
used to generate the images, and save them to a file commands.txt for further
processing.
!!! example "load the generation command for a single png file"
This example loads the generation command for a single png file:
```bash
invoke> !fetch 0000015.8929913.png
# the script returns the next line, ready for editing and running:
invoke> a fantastic alien landscape -W 576 -H 512 -s 60 -A plms -C 7.5
```
```bash
invoke> !fetch 0000015.8929913.png
# the script returns the next line, ready for editing and running:
invoke> a fantastic alien landscape -W 576 -H 512 -s 60 -A plms -C 7.5
```
!!! example "fetch the generation commands from a batch of files and store them into `selected.txt`"
This one fetches the generation commands from a batch of files and stores them
into `selected.txt`:
```bash
invoke> !fetch outputs\selected-imgs\*.png selected.txt
```
```bash
invoke> !fetch outputs\selected-imgs\*.png selected.txt
```
#### `!replay`
### !replay
This command replays a text file generated by !fetch or created manually
!!! example
```
invoke> !replay outputs\selected-imgs\selected.txt
```
```bash
invoke> !replay outputs\selected-imgs\selected.txt
```
Note that these commands may behave unexpectedly if given a PNG file that was
not generated by InvokeAI.
!!! note
These commands may behave unexpectedly if given a PNG file that was
not generated by InvokeAI.
#### `!search <search string>`
### !search <search string>
This is similar to !history but it only returns lines that contain
`search string`. For example:
@ -565,7 +544,7 @@ invoke> !search surreal
[21] surrealist painting of beautiful woman sitting under tree wearing broad hat and flowing garment -v0.2 -n6 -S2878767194
```
#### `!clear`
### `!clear`
This clears the search history from memory and disk. Be advised that this
operation is irreversible and does not issue any warnings!

View File

@ -1,110 +1,130 @@
---
title: Concepts Library
title: The Hugging Face Concepts Library and Importing Textual Inversion files
---
# :material-library-shelves: The Hugging Face Concepts Library and Importing Textual Inversion files
# :material-file-document: Concepts Library
## Using Textual Inversion Files
Textual inversion (TI) files are small models that customize the output of
Stable Diffusion image generation. They can augment SD with specialized subjects
and artistic styles. They are also known as "embeds" in the machine learning
world.
Stable Diffusion image generation. They can augment SD with
specialized subjects and artistic styles. They are also known as
"embeds" in the machine learning world.
Each TI file introduces one or more vocabulary terms to the SD model. These are
known in InvokeAI as "triggers." Triggers are often, but not always, denoted
using angle brackets as in "&lt;trigger-phrase&gt;". The two most common type of
TI files that you'll encounter are `.pt` and `.bin` files, which are produced by
different TI training packages. InvokeAI supports both formats, but its
[built-in TI training system](TEXTUAL_INVERSION.md) produces `.pt`.
Each TI file introduces one or more vocabulary terms to the SD
model. These are known in InvokeAI as "triggers." Triggers are often,
but not always, denoted using angle brackets as in
"&lt;trigger-phrase&gt;". The two most common type of TI files that you'll
encounter are `.pt` and `.bin` files, which are produced by different
TI training packages. InvokeAI supports both formats, but its [built-in
TI training system](TEXTUAL_INVERSION.md) produces `.pt`.
The [Hugging Face company](https://huggingface.co/sd-concepts-library) has
amassed a large ligrary of &gt;800 community-contributed TI files covering a
broad range of subjects and styles. InvokeAI has built-in support for this
library which downloads and merges TI files automatically upon request. You can
also install your own or others' TI files by placing them in a designated
directory.
The [Hugging Face company](https://huggingface.co/sd-concepts-library)
has amassed a large ligrary of &gt;800 community-contributed TI files
covering a broad range of subjects and styles. InvokeAI has built-in
support for this library which downloads and merges TI files
automatically upon request. You can also install your own or others'
TI files by placing them in a designated directory.
### An Example
Here are a few examples to illustrate how it works. All these images were
generated using the command-line client and the Stable Diffusion 1.5 model:
Here are a few examples to illustrate how it works. All these images
were generated using the command-line client and the Stable Diffusion
1.5 model:
| Japanese gardener | Japanese gardener &lt;ghibli-face&gt; | Japanese gardener &lt;hoi4-leaders&gt; | Japanese gardener &lt;cartoona-animals&gt; |
| :--------------------------------: | :-----------------------------------: | :------------------------------------: | :----------------------------------------: |
| ![](../assets/concepts/image1.png) | ![](../assets/concepts/image2.png) | ![](../assets/concepts/image3.png) | ![](../assets/concepts/image4.png) |
Japanese gardener
<br>
<img src="../assets/concepts/image1.png">
Japanese gardener &lt;ghibli-face&gt;
<br>
<img src="../assets/concepts/image2.png">
Japanese gardener &lt;hoi4-leaders&gt;
<br>
<img src="../assets/concepts/image3.png">
Japanese gardener &lt;cartoona-animals&gt;
<br>
<img src="../assets/concepts/image4.png">
You can also combine styles and concepts:
<figure markdown>
![](../assets/concepts/image5.png)
<figcaption>A portrait of &lt;alf&gt; in &lt;cartoona-animal&gt; style</figcaption>
</figure>
A portrait of &lt;alf&gt; in &lt;cartoona-animal&gt; style
<br>
<img src="../assets/concepts/image5.png">
## Using a Hugging Face Concept
Hugging Face TI concepts are downloaded and installed automatically as you
require them. This requires your machine to be connected to the Internet. To
find out what each concept is for, you can browse the
[Hugging Face concepts library](https://huggingface.co/sd-concepts-library) and
look at examples of what each concept produces.
Hugging Face TI concepts are downloaded and installed automatically as
you require them. This requires your machine to be connected to the
Internet. To find out what each concept is for, you can browse the
[Hugging Face concepts
library](https://huggingface.co/sd-concepts-library) and look at
examples of what each concept produces.
When you have an idea of a concept you wish to try, go to the command-line
client (CLI) and type a "&lt;" character and the beginning of the Hugging Face
concept name you wish to load. Press the Tab key, and the CLI will show you all
matching concepts. You can also type "&lt;" and Tab to get a listing of all ~800
concepts, but be prepared to scroll up to see them all! If there is more than
one match you can continue to type and Tab until the concept is completed.
When you have an idea of a concept you wish to try, go to the
command-line client (CLI) and type a "&lt;" character and the beginning
of the Hugging Face concept name you wish to load. Press the Tab key,
and the CLI will show you all matching concepts. You can also type "&lt;"
and Tab to get a listing of all ~800 concepts, but be prepared to
scroll up to see them all! If there is more than one match you can
continue to type and Tab until the concept is completed.
For example if you type "&lt;x" and Tab, you'll be prompted with the
completions:
For example if you type "&lt;x" and Tab, you'll be prompted with the completions:
```
<xatu2> <xatu> <xbh> <xi> <xidiversity> <xioboma> <xuna> <xyz>
<xatu2> <xatu> <xbh> <xi> <xidiversity> <xioboma> <xuna> <xyz>
```
Now type "id" and press Tab. It will be autocompleted to "&lt;xidiversity&gt;"
because this is a unique match.
Now type "id" and press Tab. It will be autocompleted to
"&lt;xidiversity&gt;" because this is a unique match.
Finish your prompt and generate as usual. You may include multiple concept terms
in the prompt.
Finish your prompt and generate as usual. You may include multiple
concept terms in the prompt.
If you have never used this concept before, you will see a message that the TI
model is being downloaded and installed. After this, the concept will be saved
locally (in the `models/sd-concepts-library` directory) for future use.
If you have never used this concept before, you will see a message
that the TI model is being downloaded and installed. After this, the
concept will be saved locally (in the `models/sd-concepts-library`
directory) for future use.
Several steps happen during downloading and installation, including a scan of
the file for malicious code. Should any errors occur, you will be warned and the
concept will fail to load. Generation will then continue treating the trigger
term as a normal string of characters (e.g. as literal "&lt;ghibli-face&gt;").
Several steps happen during downloading and
installation, including a scan of the file for malicious code. Should
any errors occur, you will be warned and the concept will fail to
load. Generation will then continue treating the trigger term as a
normal string of characters (e.g. as literal "&lt;ghibli-face&gt;").
Currently auto-installation of concepts is a feature only available on the
command-line client. Support for the WebUI is a work in progress.
Currently auto-installation of concepts is a feature only available on
the command-line client. Support for the WebUI is a work in progress.
## Installing your Own TI Files
You may install any number of `.pt` and `.bin` files simply by copying them into
the `embeddings` directory of the InvokeAI runtime directory (usually `invokeai`
in your home directory). You may create subdirectories in order to organize the
files in any way you wish. Be careful not to overwrite one file with another.
For example, TI files generated by the Hugging Face toolkit share the named
`learned_embedding.bin`. You can use subdirectories to keep them distinct.
You may install any number of `.pt` and `.bin` files simply by copying
them into the `embeddings` directory of the InvokeAI runtime directory
(usually `invokeai` in your home directory). You may create
subdirectories in order to organize the files in any way you wish. Be
careful not to overwrite one file with another. For example, TI files
generated by the Hugging Face toolkit share the named
`learned_embedding.bin`. You can use subdirectories to keep them
distinct.
At startup time, InvokeAI will scan the `embeddings` directory and load any TI
files it finds there. At startup you will see a message similar to this one:
At startup time, InvokeAI will scan the `embeddings` directory and
load any TI files it finds there. At startup you will see a message
similar to this one:
```bash
```
>> Current embedding manager terms: *, <HOI4-Leader>, <princess-knight>
```
Note the `*` trigger term. This is a placeholder term that many early TI
tutorials taught people to use rather than a more descriptive term.
Unfortunately, if you have multiple TI files that all use this term, only the
first one loaded will be triggered by use of the term.
Note the "*" trigger term. This is a placeholder term that many early
TI tutorials taught people to use rather than a more descriptive
term. Unfortunately, if you have multiple TI files that all use this
term, only the first one loaded will be triggered by use of the term.
To avoid this problem, you can use the `merge_embeddings.py` script to merge two
or more TI files together. If it encounters a collision of terms, the script
will prompt you to select new terms that do not collide. See
[Textual Inversion](TEXTUAL_INVERSION.md) for details.
To avoid this problem, you can use the `merge_embeddings.py` script to
merge two or more TI files together. If it encounters a collision of
terms, the script will prompt you to select new terms that do not
collide. See [Textual Inversion](TEXTUAL_INVERSION.md) for details.
## Further Reading

View File

@ -12,19 +12,21 @@ stable diffusion to build the prompt on top of the image you provide, preserving
the original's basic shape and layout. To use it, provide the `--init_img`
option as shown here:
!!! example ""
```commandline
tree on a hill with a river, nature photograph, national geographic -I./test-pictures/tree-and-river-sketch.png -f 0.85
```
```commandline
tree on a hill with a river, nature photograph, national geographic -I./test-pictures/tree-and-river-sketch.png -f 0.85
```
This will take the original image shown here:
<figure markdown>
<figure markdown>
![original-image](https://user-images.githubusercontent.com/50542132/193946000-c42a96d8-5a74-4f8a-b4c3-5213e6cadcce.png){ width=320 }
</figure>
| original image | generated image |
| :------------: | :-------------: |
| ![original-image](https://user-images.githubusercontent.com/50542132/193946000-c42a96d8-5a74-4f8a-b4c3-5213e6cadcce.png){ width=320 } | ![generated-image](https://user-images.githubusercontent.com/111189/194135515-53d4c060-e994-4016-8121-7c685e281ac9.png){ width=320 } |
and generate a new image based on it as shown here:
</figure>
<figure markdown>
![generated-image](https://user-images.githubusercontent.com/111189/194135515-53d4c060-e994-4016-8121-7c685e281ac9.png){ width=320 }
</figure>
The `--init_img` (`-I`) option gives the path to the seed picture. `--strength`
(`-f`) controls how much the original will be modified, ranging from `0.0` (keep
@ -86,15 +88,13 @@ from a prompt. If the step count is 10, then the "latent space" (Stable
Diffusion's internal representation of the image) for the prompt "fire" with
seed `1592514025` develops something like this:
!!! example ""
```bash
invoke> "fire" -s10 -W384 -H384 -S1592514025
```
```bash
invoke> "fire" -s10 -W384 -H384 -S1592514025
```
<figure markdown>
![latent steps](../assets/img2img/000019.steps.png){ width=720 }
</figure>
<figure markdown>
![latent steps](../assets/img2img/000019.steps.png)
</figure>
Put simply: starting from a frame of fuzz/static, SD finds details in each frame
that it thinks look like "fire" and brings them a little bit more into focus,
@ -109,23 +109,25 @@ into the sequence at the appropriate point, with just the right amount of noise.
### A concrete example
!!! example "I want SD to draw a fire based on this hand-drawn image"
I want SD to draw a fire based on this hand-drawn image:
![drawing of a fireplace](../assets/img2img/fire-drawing.png){ align=left }
<figure markdown>
![drawing of a fireplace](../assets/img2img/fire-drawing.png)
</figure>
Let's only do 10 steps, to make it easier to see what's happening. If strength
is `0.7`, this is what the internal steps the algorithm has to take will look
like:
Let's only do 10 steps, to make it easier to see what's happening. If strength
is `0.7`, this is what the internal steps the algorithm has to take will look
like:
<figure markdown>
![gravity32](../assets/img2img/000032.steps.gravity.png)
</figure>
<figure markdown>
![gravity32](../assets/img2img/000032.steps.gravity.png)
</figure>
With strength `0.4`, the steps look more like this:
With strength `0.4`, the steps look more like this:
<figure markdown>
![gravity30](../assets/img2img/000030.steps.gravity.png)
</figure>
<figure markdown>
![gravity30](../assets/img2img/000030.steps.gravity.png)
</figure>
Notice how much more fuzzy the starting image is for strength `0.7` compared to
`0.4`, and notice also how much longer the sequence is with `0.7`:

View File

@ -120,7 +120,7 @@ A number of caveats:
(`--iterations`) argument.
3. Your results will be _much_ better if you use the `inpaint-1.5` model
released by runwayML and installed by default by `scripts/configure_invokeai.py`.
released by runwayML and installed by default by `scripts/preload_models.py`.
This model was trained specifically to harmoniously fill in image gaps. The
standard model will work as well, but you may notice color discontinuities at
the border.

View File

@ -28,17 +28,21 @@ should "just work" without further intervention. Simply pass the `--upscale`
the popup in the Web GUI.
**GFPGAN** requires a series of downloadable model files to work. These are
loaded when you run `scripts/configure_invokeai.py`. If GFPAN is failing with an
loaded when you run `scripts/preload_models.py`. If GFPAN is failing with an
error, please run the following from the InvokeAI directory:
```bash
python scripts/configure_invokeai.py
python scripts/preload_models.py
```
If you do not run this script in advance, the GFPGAN module will attempt to
download the models files the first time you try to perform facial
reconstruction.
## Usage
You will now have access to two new prompt arguments.
### Upscaling
`-U : <upscaling_factor> <upscaling_strength>`
@ -106,7 +110,7 @@ This repo also allows you to perform face restoration using
[CodeFormer](https://github.com/sczhou/CodeFormer).
In order to setup CodeFormer to work, you need to download the models like with
GFPGAN. You can do this either by running `configure_invokeai.py` or by manually
GFPGAN. You can do this either by running `preload_models.py` or by manually
downloading the
[model file](https://github.com/sczhou/CodeFormer/releases/download/v0.1.0/codeformer.pth)
and saving it to `ldm/invoke/restoration/codeformer/weights` folder.
@ -115,7 +119,7 @@ You can use `-ft` prompt argument to swap between CodeFormer and the default
GFPGAN. The above mentioned `-G` prompt argument will allow you to control the
strength of the restoration effect.
### CodeFormer Usage
### Usage
The following command will perform face restoration with CodeFormer instead of
the default gfpgan.
@ -156,7 +160,7 @@ A new file named `000044.2945021133.fixed.png` will be created in the output
directory. Note that the `!fix` command does not replace the original file,
unlike the behavior at generate time.
## How to disable
### Disabling
If, for some reason, you do not wish to load the GFPGAN and/or ESRGAN libraries,
you can disable them on the invoke.py command line with the `--no_restore` and

View File

@ -1,5 +0,0 @@
---
title: Overview
---
Here you can find the documentation for different features.

View File

@ -86,10 +86,6 @@ AMD card (using the ROCm driver). For full installation and upgrade
instructions, please see:
[InvokeAI Installation Overview](https://invoke-ai.github.io/InvokeAI/installation/)
Linux users who wish to make use of the PyPatchMatch inpainting
functions will need to perform a bit of extra work to enable this
module. Instructions can be found at [Installing PyPatchMatch](installation/INSTALL_PATCHMATCH.md).
## :fontawesome-solid-computer: Hardware Requirements
### :octicons-cpu-24: System
@ -127,8 +123,7 @@ You wil need one of the following:
- [The InvokeAI Web Interface](features/WEB.md)
- [WebGUI hotkey reference guide](features/WEBUIHOTKEYS.md)
- [WebGUI Unified Canvas for Img2Img, inpainting and outpainting](features/UNIFIED_CANVAS.md)
<!-- seperator -->
<!-- this link does not exist - [WebGUI Unified Canvas for Img2Img, inpainting and outpainting](features/UNIFIED_CANVAS.md) -->
- [The Command Line Interace](features/CLI.md)
- [Image2Image](features/IMG2IMG.md)
- [Inpainting](features/INPAINTING.md)
@ -141,7 +136,6 @@ You wil need one of the following:
- [Prompt Engineering](features/PROMPTS.md)
<!-- seperator -->
- Miscellaneous
- [NSFW Checker](features/NSFW.md)
- [Embiggen upscaling](features/EMBIGGEN.md)
- [Other](features/OTHER.md)
@ -166,7 +160,7 @@ You wil need one of the following:
- You can now load
[multiple models and switch among them quickly](https://docs.google.com/presentation/d/1WywGA1rny7bpFh7CLSdTr4nNpVKdlUeT0Bj0jCsILyU/edit?usp=sharing)
without leaving the CLI.
- The installation process (via `scripts/configure_invokeai.py`) now lets you select
- The installation process (via `scripts/preload_models.py`) now lets you select
among several popular
[Stable Diffusion models](https://invoke-ai.github.io/InvokeAI/installation/INSTALLING_MODELS/)
and downloads and installs them on your behalf. Among other models, this

View File

@ -1,89 +0,0 @@
---
title: build binary installers
---
# :simple-buildkite: How to build "binary" installers (InvokeAI-mac/windows/linux_on_*.zip)
## 1. Ensure `installers/requirements.in` is correct
and up to date on the branch to be installed.
## <a name="step-2"></a> 2. Run `pip-compile` on each platform.
On each target platform, in the branch that is to be installed, and
inside the InvokeAI git root folder, run the following commands:
```commandline
conda activate invokeai # or however you activate python
pip install pip-tools
pip-compile --allow-unsafe --generate-hashes --output-file=binary_installer/<reqsfile>.txt binary_installer/requirements.in
```
where `<reqsfile>.txt` is whichever of
```commandline
py3.10-darwin-arm64-mps-reqs.txt
py3.10-darwin-x86_64-reqs.txt
py3.10-linux-x86_64-cuda-reqs.txt
py3.10-windows-x86_64-cuda-reqs.txt
```
matches the current OS and architecture.
> There is no way to cross-compile these. They must be done on a system matching the target OS and arch.
## <a name="step-3"></a> 3. Set github repository and branch
Once all reqs files have been collected and committed **to the branch
to be installed**, edit `binary_installer/install.sh.in` and `binary_installer/install.bat.in` so that `RELEASE_URL`
and `RELEASE_SOURCEBALL` point to the github repo and branch that is
to be installed.
For example, to install `main` branch of `InvokeAI`, they should be
set as follows:
`install.sh.in`:
```commandline
RELEASE_URL=https://github.com/invoke-ai/InvokeAI
RELEASE_SOURCEBALL=/archive/refs/heads/main.tar.gz
```
`install.bat.in`:
```commandline
set RELEASE_URL=https://github.com/invoke-ai/InvokeAI
set RELEASE_SOURCEBALL=/archive/refs/heads/main.tar.gz
```
Or, to install `damians-cool-feature` branch of `damian0815`, set them
as follows:
`install.sh.in`:
```commandline
RELEASE_URL=https://github.com/damian0815/InvokeAI
RELEASE_SOURCEBALL=/archive/refs/heads/damians-cool-feature.tar.gz
```
`install.bat.in`:
```commandline
set RELEASE_URL=https://github.com/damian0815/InvokeAI
set RELEASE_SOURCEBALL=/archive/refs/heads/damians-cool-feature.tar.gz
```
The branch and repo specified here **must** contain the correct reqs
files. The installer zip files **do not** contain requirements files,
they are pulled from the specified branch during the installation
process.
## 4. Create zip files.
cd into the `installers/` folder and run
`./create_installers.sh`. This will create
`InvokeAI-mac_on_<branch>.zip`,
`InvokeAI-windows_on_<branch>.zip` and
`InvokeAI-linux_on_<branch>.zip`. These files can be distributed to end users.
These zips will continue to function as installers for all future
pushes to those branches, as long as necessary changes to
`requirements.in` are propagated in a timely manner to the
`py3.10-*-reqs.txt` files using pip-compile as outlined in [step
2](#step-2).
To actually install, users should unzip the appropriate zip file into an empty
folder and run `install.sh` on macOS/Linux or `install.bat` on
Windows.

View File

@ -56,7 +56,7 @@ unofficial Stable Diffusion models and where they can be obtained.
There are three ways to install weights files:
1. During InvokeAI installation, the `configure_invokeai.py` script can download
1. During InvokeAI installation, the `preload_models.py` script can download
them for you.
2. You can use the command-line interface (CLI) to import, configure and modify
@ -65,13 +65,13 @@ There are three ways to install weights files:
3. You can download the files manually and add the appropriate entries to
`models.yaml`.
### Installation via `configure_invokeai.py`
### Installation via `preload_models.py`
This is the most automatic way. Run `scripts/configure_invokeai.py` from the
This is the most automatic way. Run `scripts/preload_models.py` from the
console. It will ask you to select which models to download and lead you through
the steps of setting up a Hugging Face account if you haven't done so already.
To start, run `python scripts/configure_invokeai.py` from within the InvokeAI:
To start, run `python scripts/preload_models.py` from within the InvokeAI:
directory
!!! example ""
@ -162,12 +162,6 @@ the command-line client's `!import_model` command.
Type a bit of the path name and hit ++tab++ in order to get a choice of
possible completions.
!!! tip "on Windows, you can drag model files onto the command-line"
Once you have typed in `!import_model `, you can drag the model `.ckpt` file
onto the command-line to insert the model path. This way, you don't need to
type it or copy/paste.
4. Follow the wizard's instructions to complete installation as shown in the
example here:
@ -244,7 +238,7 @@ arabian-nights-1.0:
| arabian-nights-1.0 | This is the name of the model that you will refer to from within the CLI and the WebGUI when you need to load and use the model. |
| description | Any description that you want to add to the model to remind you what it is. |
| weights | Relative path to the .ckpt weights file for this model. |
| config | This is the confusingly-named configuration file for the model itself. Use `./configs/stable-diffusion/v1-inference.yaml` unless the model happens to need a custom configuration, in which case the place you downloaded it from will tell you what to use instead. For example, the runwayML custom inpainting model requires the file `configs/stable-diffusion/v1-inpainting-inference.yaml`. This is already inclued in the InvokeAI distribution and is configured automatically for you by the `configure_invokeai.py` script. |
| config | This is the confusingly-named configuration file for the model itself. Use `./configs/stable-diffusion/v1-inference.yaml` unless the model happens to need a custom configuration, in which case the place you downloaded it from will tell you what to use instead. For example, the runwayML custom inpainting model requires the file `configs/stable-diffusion/v1-inpainting-inference.yaml`. This is already inclued in the InvokeAI distribution and is configured automatically for you by the `preload_models.py` script. |
| vae | If you want to add a VAE file to the model, then enter its path here. |
| width, height | This is the width and height of the images used to train the model. Currently they are always 512 and 512. |

View File

@ -1,8 +1,8 @@
---
title: InvokeAI Binary Installer
title: InvokeAI Installer
---
The InvokeAI binary installer is a shell script that will install InvokeAI onto a stock
The InvokeAI installer is a shell script that will install InvokeAI onto a stock
computer running recent versions of Linux, MacOSX or Windows. It will leave you
with a version that runs a stable version of InvokeAI. When a new version of
InvokeAI is released, you will download and reinstall the new version.
@ -36,7 +36,7 @@ recommended model weights files.
1. Download the
[latest release](https://github.com/invoke-ai/InvokeAI/releases/latest) of
InvokeAI's installer for your platform. Look for a file named `InvokeAI-binary-<your platform>.zip`
InvokeAI's installer for your platform
2. Place the downloaded package someplace where you have plenty of HDD space,
and have full permissions (i.e. `~/` on Lin/Mac; your home folder on Windows)

View File

@ -2,7 +2,7 @@
title: Running InvokeAI on Google Colab using a Jupyter Notebook
---
# THIS DOCUMENTATION IS UNFINISHED - VOLUNTEERS GRATEFULLY ACCEPTED
# THIS NEEDS TO BE FLESHED OUT
## Introduction
@ -22,4 +22,6 @@ start running the cells one-by-one.
### Updating the stable version
### Updating to the development version
## Troubleshooting

View File

@ -155,10 +155,10 @@ command-line completion.
process for this is described in [here](INSTALLING_MODELS.md).
```bash
python scripts/configure_invokeai.py
python scripts/preload_models.py
```
The script `configure_invokeai.py` will interactively guide you through the
The script `preload_models.py` will interactively guide you through the
process of downloading and installing the weights files needed for InvokeAI.
Note that the main Stable Diffusion weights file is protected by a license
agreement that you have to agree to. The script will list the steps you need
@ -220,7 +220,7 @@ greatest version, launch the Anaconda window, enter `InvokeAI` and type:
```bash
git pull
conda env update
python scripts/configure_invokeai.py --no-interactive #optional
python scripts/preload_models.py --no-interactive #optional
```
This will bring your local copy into sync with the remote one. The last step may
@ -359,7 +359,7 @@ brew install llvm
If brew config has Clang installed, update to the latest llvm and try creating the environment again.
#### `configure_invokeai.py` or `invoke.py` crashes at an early stage
#### `preload_models.py` or `invoke.py` crashes at an early stage
This is usually due to an incomplete or corrupted Conda install. Make sure you
have linked to the correct environment file and run `conda update` again.

View File

@ -1,86 +0,0 @@
---
title: Installing PyPatchMatch
---
# :octicons-paintbrush-16: Installing PyPatchMatch
pypatchmatch is a Python module for inpainting images. It is not
needed to run InvokeAI, but it greatly improves the quality of
inpainting and outpainting and is recommended.
Unfortunately, it is a C++ optimized module and installation
can be somewhat challenging. This guide leads you through the steps.
## Windows
You're in luck! On Windows platforms PyPatchMatch will install
automatically on Windows systems with no extra intervention.
## Macintosh
PyPatchMatch is not currently supported, but the team is working on
it.
## Linux
Prior to installing PyPatchMatch, you need to take the following
steps:
1. Install the `build-essential` tools:
```
sudo apt update
sudo apt install build-essential
```
2. Install `opencv`:
```
sudo apt install python3-opencv libopencv-dev
```
3. Fix the naming of the `opencv` package configuration file:
```
cd /usr/lib/x86_64-linux-gnu/pkgconfig/
ln -sf opencv4.pc opencv.pc
4. Activate the environment you use for invokeai, either with
`conda` or with a virtual environment.
5. Do a "develop" install of pypatchmatch:
```
pip install -e git+https://github.com/invoke-ai/PyPatchMatch@0.1.3#egg=pypatchmatch
```
6. Confirm that pypatchmatch is installed.
At the command-line prompt enter `python`, and
then at the `>>>` line type `from patchmatch import patch_match`:
It should look like the follwing:
```
Python 3.9.5 (default, Nov 23 2021, 15:27:38)
[GCC 9.3.0] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> from patchmatch import patch_match
Compiling and loading c extensions from "/home/lstein/Projects/InvokeAI/.invokeai-env/src/pypatchmatch/patchmatch".
rm -rf build/obj libpatchmatch.so
mkdir: created directory 'build/obj'
mkdir: created directory 'build/obj/csrc/'
[dep] csrc/masked_image.cpp ...
[dep] csrc/nnf.cpp ...
[dep] csrc/inpaint.cpp ...
[dep] csrc/pyinterface.cpp ...
[CC] csrc/pyinterface.cpp ...
[CC] csrc/inpaint.cpp ...
[CC] csrc/nnf.cpp ...
[CC] csrc/masked_image.cpp ...
[link] libpatchmatch.so ...
```
If you see no errors, then you're ready to go!

View File

@ -27,7 +27,7 @@ Though there are multiple steps, there really is only one click involved to kick
off the process.
1. The source installer is distributed in ZIP files. Go to the
[latest release](https://github.com/invoke-ai/InvokeAI/releases/tag/2.2.0-rc4), and
[latest release](https://github.com/invoke-ai/InvokeAI/releases/latest), and
look for a series of files named:
- invokeAI-src-installer-mac.zip
@ -55,7 +55,7 @@ off the process.
named `install.bat` on Windows systems and `install.sh` on Linux and
Macintosh systems.
4. Alternatively, from the command line, run the shell script or .bat file:
4. Alternatively, form the command line, run the shell script or .bat file:
```cmd
C:\Documents\Linco> cd invokeAI
@ -66,17 +66,8 @@ off the process.
requirements including Conda, Git and Python, then download the current
InvokeAI code and install it along with its dependencies.
Be aware that some of the library download and install steps take a long time.
In particular, the `pytorch` package is quite large and often appears to get
"stuck" at 99.9%. Similarly, the `pip installing requirements` step may
appear to hang. Have patience and the installation step will eventually
resume. However, there are occasions when the library install does
legitimately get stuck. If you have been waiting for more than ten minutes
and nothing is happening, you can interrupt the script with ^C. You may restart
it and it will pick up where it left off.
6. After installation completes, the installer will launch a script called
`configure_invokeai.py`, which will guide you through the first-time process of
`preload_models.py`, which will guide you through the first-time process of
selecting one or more Stable Diffusion model weights files, downloading and
configuring them.
@ -119,71 +110,6 @@ python scripts/invoke.py --web --max_load_models=3 \
These options are described in detail in the
[Command-Line Interface](../features/CLI.md) documentation.
## Troubleshooting
_Package dependency conflicts_ If you have previously installed
InvokeAI or another Stable Diffusion package, the installer may
occasionally pick up outdated libraries and either the installer or
`invoke` will fail with complaints out library conflicts. There are
two steps you can take to clear this problem. Both of these are done
from within the "developer's console", which you can get to by
launching `invoke.sh` (or `invoke.bat`) and selecting launch option
#3:
1. Remove the previous `invokeai` environment completely. From within
the developer's console, give the command `conda env remove -n
invokeai`. This will delete previous files installed by `invoke`.
Then exit from the developer's console and launch the script
`update.sh` (or `update.bat`). This will download the most recent
InvokeAI (including bug fixes) and reinstall the environment.
You should then be able to run `invoke.sh`/`invoke.bat`.
2. If this doesn't work, you can try cleaning your system's conda
cache. This is slightly more extreme, but won't interfere with
any other python-based programs installed on your computer.
From the developer's console, run the command `conda clean -a`
and answer "yes" to all prompts.
After this is done, run `update.sh` and try again as before.
_"Corrupted configuration file."__ Everything seems to install ok, but
`invoke` complains of a corrupted configuration file and goes calls
`configure_invokeai.py` to fix, but this doesn't fix the problem.
This issue is often caused by a misconfigured configuration directive
in the `.invokeai` initialization file that contains startup settings.
This can be corrected by fixing the offending line.
First find `.invokeai`. It is a small text file located in your home
directory, `~/.invokeai` on Mac and Linux systems, and `C:\Users\*your
name*\.invokeai` on Windows systems. Open it with a text editor
(e.g. Notepad on Windows, TextEdit on Macs, or `nano` on Linux)
and look for the lines starting with `--root` and `--outdir`.
An example is here:
```cmd
--root="/home/lstein/invokeai"
--outdir="/home/lstein/invokeai/outputs"
```
There should not be whitespace before or after the directory paths,
and the paths should not end with slashes:
```cmd
--root="/home/lstein/invokeai " # wrong! no whitespace here
--root="/home\lstein\invokeai\" # wrong! shouldn't end in a slash
```
Fix the problem with your text editor and save as a **plain text**
file. This should clear the issue.
_If none of these maneuvers fixes the problem_ then please report the
problem to the [InvokeAI
Issues](https://github.com/invoke-ai/InvokeAI/issues) section, or
visit our [Discord Server](https://discord.gg/ZmtBAhwWhy) for interactive assistance.
## Updating to newer versions
This section describes how to update InvokeAI to new versions of the software.
@ -193,15 +119,31 @@ This section describes how to update InvokeAI to new versions of the software.
This distribution is changing rapidly, and we add new features on a daily basis.
To update to the latest released version (recommended), run the `update.sh`
(Linux/Mac) or `update.bat` (Windows) scripts. This will fetch the latest
release and re-run the `configure_invokeai` script to download any updated models
release and re-run the `preload_models` script to download any updated models
files that may be needed. You can also use this to add additional models that
you did not select at installation time.
### Updating to the development version
There may be times that there is a feature in the `development` branch of
InvokeAI that you'd like to take advantage of. Or perhaps there is a branch that
corrects an annoying bug. To do this, you will use the developer's console.
From within the invokeAI directory, run the command `invoke.sh` (Linux/Mac) or
`invoke.bat` (Windows) and selection option (3) to open the developers console.
Then run the following command to get the `development branch`:
```bash
git checkout development
git pull
conda env update
```
You can now close the developer console and run `invoke` as before. If you get
complaints about missing models, then you may need to do the additional step of
running `configure_invokeai.py`. This happens relatively infrequently. To do this,
running `preload_models.py`. This happens relatively infrequently. To do this,
simply open up the developer's console again and type
`python scripts/configure_invokeai.py`.
`python scripts/preload_models.py`.
## Troubleshooting

View File

@ -5,26 +5,37 @@ title: Overview
We offer several ways to install InvokeAI, each one suited to your
experience and preferences.
1. [InvokeAI source code installer](INSTALL_SOURCE.md)
1. [InvokeAI installer](INSTALL_INVOKE.md)
This is a script that will install Python, the Anaconda ("conda")
package manager, all of InvokeAI's its essential third party
libraries and InvokeAI itself. It includes access to a "developer
console" which will help us debug problems with you and give you
to access experimental features.
This is a installer script that installs InvokeAI and all the
third party libraries it depends on. When a new version of
InvokeAI is released, you will download and reinstall the new
version.
When a new InvokeAI feature is available, even between releases,
you will be able to upgrade and try it out by running an `update`
script. This method is recommended for individuals who wish to
stay on the cutting edge of InvokeAI development and are not
afraid of occasional breakage.
This installer is designed for people who want the system to "just
work", don't have an interest in tinkering with it, and do not
care about upgrading to unreleased experimental features.
**Important Caveats**
- This script is a bit cranky and occasionally hangs or times out,
forcing you to cancel and restart the script (it will pick up where
it left off).
- This script does not support AMD GPUs. For Linux AMD support,
please use the manual or source code installer methods.
- This script has difficulty on some Macintosh machines
that have previously been used for Python development due to
conflicting development tools versions. Mac developers may wish
to try the source code installer or one of the manual methods instead.
2. [Manual Installation](INSTALL_MANUAL.md)
2. [Source code installer](INSTALL_SOURCE.md)
This is a script that will install InvokeAI and all its essential
third party libraries. In contrast to the previous installer, it
includes access to a "developer console" which will allow you to
access experimental features on the development branch.
This method is recommended for individuals who are wish to stay
on the cutting edge of InvokeAI development and are not afraid
of occasional breakage.
3. [Manual Installation](INSTALL_MANUAL.md)
In this method you will manually run the commands needed to install
InvokeAI and its dependencies. We offer two recipes: one suited to
@ -36,14 +47,14 @@ experience and preferences.
the cutting edge of future InvokeAI development and is willing to put
up with occasional glitches and breakage.
3. [Docker Installation](INSTALL_DOCKER.md)
4. [Docker Installation](INSTALL_DOCKER.md)
We also offer a method for creating Docker containers containing
InvokeAI and its dependencies. This method is recommended for
individuals with experience with Docker containers and understand
the pluses and minuses of a container-based install.
4. [Jupyter Notebooks Installation](INSTALL_JUPYTER.md)
5. [Jupyter Notebooks Installation](INSTALL_JUPYTER.md)
This method is suitable for running InvokeAI on a Google Colab
account. It is recommended for individuals who have previously

View File

@ -69,7 +69,7 @@ title: Manual Installation, Linux
machine-learning models:
```bash
(invokeai) ~/InvokeAI$ python3 scripts/configure_invokeai.py
(invokeai) ~/InvokeAI$ python3 scripts/preload_models.py
```
!!! note
@ -79,7 +79,7 @@ title: Manual Installation, Linux
and obtaining an access token for downloading. It will then download and
install the weights files for you.
Please look [here](../INSTALL_MANUAL.md) for a manual process for doing
Please look [here](INSTALLING_MODELS.md) for a manual process for doing
the same thing.
7. Start generating images!
@ -112,7 +112,7 @@ title: Manual Installation, Linux
To use an alternative model you may invoke the `!switch` command in
the CLI, or pass `--model <model_name>` during `invoke.py` launch for
either the CLI or the Web UI. See [Command Line
Client](../../features/CLI.md#model-selection-and-importation). The
Client](../features/CLI.md#model-selection-and-importation). The
model names are defined in `configs/models.yaml`.
8. Subsequently, to relaunch the script, be sure to run "conda activate

View File

@ -111,7 +111,7 @@ will do our best to help.
!!! todo "Download the model weight files"
The `configure_invokeai.py` script downloads and installs the model weight
The `preload_models.py` script downloads and installs the model weight
files for you. It will lead you through the process of getting a Hugging Face
account, accepting the Stable Diffusion model weight license agreement, and
creating a download token:
@ -119,7 +119,7 @@ will do our best to help.
```bash
# This will take some time, depending on the speed of your internet connection
# and will consume about 10GB of space
python scripts/configure_invokeai.py
python scripts/preload_models.py
```
!!! todo "Run InvokeAI!"
@ -150,7 +150,7 @@ will do our best to help.
To use an alternative model you may invoke the `!switch` command in
the CLI, or pass `--model <model_name>` during `invoke.py` launch for
either the CLI or the Web UI. See [Command Line
Client](../../features/CLI.md#model-selection-and-importation). The
Client](../features/CLI.md#model-selection-and-importation). The
model names are defined in `configs/models.yaml`.
---
@ -220,8 +220,8 @@ There are several causes of these errors:
with "(invokeai)" then you activated it. If it begins with "(base)" or
something else you haven't.
2. You might've run `./scripts/configure_invokeai.py` or `./scripts/invoke.py`
instead of `python ./scripts/configure_invokeai.py` or
2. You might've run `./scripts/preload_models.py` or `./scripts/invoke.py`
instead of `python ./scripts/preload_models.py` or
`python ./scripts/invoke.py`. The cause of this error is long so it's below.
<!-- I could not find out where the error is, otherwise would have marked it as a footnote -->
@ -359,7 +359,7 @@ python ./scripts/txt2img.py \
### OSError: Can't load tokenizer for 'openai/clip-vit-large-patch14'
```bash
python scripts/configure_invokeai.py
python scripts/preload_models.py
```
---

View File

@ -65,7 +65,7 @@ Note that you will need NVIDIA drivers, Python 3.10, and Git installed beforehan
7. Load the big stable diffusion weights files and a couple of smaller machine-learning models:
```bash
python scripts/configure_invokeai.py
python scripts/preload_models.py
```
!!! note
@ -75,7 +75,7 @@ Note that you will need NVIDIA drivers, Python 3.10, and Git installed beforehan
obtaining an access token for downloading. It will then download and install the
weights files for you.
Please look [here](../INSTALL_MANUAL.md) for a manual process for doing the
Please look [here](INSTALLING_MODELS.md) for a manual process for doing the
same thing.
8. Start generating images!
@ -108,7 +108,7 @@ Note that you will need NVIDIA drivers, Python 3.10, and Git installed beforehan
To use an alternative model you may invoke the `!switch` command in
the CLI, or pass `--model <model_name>` during `invoke.py` launch for
either the CLI or the Web UI. See [Command Line
Client](../../features/CLI.md#model-selection-and-importation). The
Client](../features/CLI.md#model-selection-and-importation). The
model names are defined in `configs/models.yaml`.
9. Subsequently, to relaunch the script, first activate the Anaconda

View File

@ -15,16 +15,16 @@ We thank them for all of their time and hard work.
## **Current core team**
* @lstein (Lincoln Stein) - Co-maintainer
* @blessedcoolant - Co-maintainer
* @hipsterusername (Kent Keirsey) - Product Manager
* @psychedelicious - Web Team Leader
* @Kyle0654 (Kyle Schouviller) - Node Architect and General Backend Wizard
* @damian0815 - Attention Systems and Gameplay Engineer
* @mauwii (Matthias Wild) - Continuous integration and product maintenance engineer
* @Netsvetaev (Artur Netsvetaev) - UI/UX Developer
* @tildebyte - general gadfly and resident (self-appointed) know-it-all
* @keturn - Lead for Diffusers port
* lstein (Lincoln Stein) - Co-maintainer
* blessedcoolant - Co-maintainer
* hipsterusername (Kent Keirsey) - Product Manager
* psychedelicious - Web Team Leader
* Kyle0654 (Kyle Schouviller) - Node Architect and General Backend Wizard
* damian0815 - Attention Systems and Gameplay Engineer
* mauwii (Matthias Wild) - Continuous integration and product maintenance engineer
* Netsvetaev (Artur Netsvetaev) - UI/UX Developer
* tildebyte - general gadfly and resident (self-appointed) know-it-all
* keturn - Lead for Diffusers port
## **Contributions by**

File diff suppressed because one or more lines are too long

View File

@ -6,7 +6,7 @@
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>InvokeAI - A Stable Diffusion Toolkit</title>
<link rel="shortcut icon" type="icon" href="./assets/favicon.0d253ced.ico" />
<script type="module" crossorigin src="./assets/index.637f12bd.js"></script>
<script type="module" crossorigin src="./assets/index.faf4c870.js"></script>
<link rel="stylesheet" href="./assets/index.c609c0c8.css">
</head>

View File

@ -42,6 +42,7 @@ const makeSocketIOEmitters = (
options: optionsState,
system: systemState,
canvas: canvasState,
gallery: galleryState,
} = state;
const frontendToBackendParametersConfig: FrontendToBackendParametersConfig =
@ -54,6 +55,13 @@ const makeSocketIOEmitters = (
dispatch(generationRequested());
if (!['txt2img', 'img2img'].includes(generationMode)) {
if (!galleryState.currentImage?.url) return;
frontendToBackendParametersConfig.imageToProcessUrl =
galleryState.currentImage.url;
}
const { generationParameters, esrganParameters, facetoolParameters } =
frontendToBackendParameters(frontendToBackendParametersConfig);

View File

@ -30,7 +30,13 @@ export const frontendToBackendParameters = (
): { [key: string]: any } => {
const canvasBaseLayer = getCanvasBaseLayer();
const { generationMode, optionsState, canvasState, systemState } = config;
const {
generationMode,
optionsState,
canvasState,
systemState,
imageToProcessUrl,
} = config;
const {
cfgScale,
@ -158,6 +164,7 @@ export const frontendToBackendParameters = (
generationParameters.fit = false;
generationParameters.init_img = imageToProcessUrl;
generationParameters.strength = img2imgStrength;
generationParameters.invert_mask = shouldPreserveMaskedArea;

View File

@ -6,26 +6,23 @@ IFS=$'\n\t'
echo "Be certain that you're in the 'installer' directory before continuing."
read -p "Press any key to continue, or CTRL-C to exit..."
VERSION='2.2.3'
# make the installer zip for linux and mac
rm -rf InvokeAI
mkdir -p InvokeAI
cp install.sh.in InvokeAI/install.sh
chmod a+x InvokeAI/install.sh
cp install.sh InvokeAI
cp readme.txt InvokeAI
zip -r InvokeAI-binary-$VERSION-linux.zip InvokeAI
zip -r InvokeAI-binary-$VERSION-mac.zip InvokeAI
zip -r InvokeAI-linux.zip InvokeAI
zip -r InvokeAI-mac.zip InvokeAI
# make the installer zip for windows
rm -rf InvokeAI
mkdir -p InvokeAI
cp install.bat.in InvokeAI/install.bat
cp install.bat InvokeAI
cp readme.txt InvokeAI
cp WinLongPathsEnabled.reg InvokeAI
zip -r InvokeAI-binary-$VERSION-windows.zip InvokeAI
zip -r InvokeAI-windows.zip InvokeAI
rm -rf InvokeAI

View File

@ -10,9 +10,6 @@
@rem This enables a user to install this project without manually installing git or Python
@rem change to the script's directory
PUSHD "%~dp0"
set "no_cache_dir=--no-cache-dir"
if "%1" == "use-cache" (
set "no_cache_dir="
@ -25,7 +22,9 @@ set INSTALL_ENV_DIR=%cd%\installer_files\env
@rem https://mamba.readthedocs.io/en/latest/installation.html
set MICROMAMBA_DOWNLOAD_URL=https://github.com/cmdr2/stable-diffusion-ui/releases/download/v1.1/micromamba.exe
set RELEASE_URL=https://github.com/invoke-ai/InvokeAI
set RELEASE_SOURCEBALL=/archive/refs/heads/main.tar.gz
#set RELEASE_SOURCEBALL=/archive/refs/heads/main.tar.gz
# RELEASE_SOURCEBALL=/archive/refs/heads/test-installer.tar.gz
RELEASE_SOURCEBALL=/archive/refs/heads/development.tar.gz
set PYTHON_BUILD_STANDALONE_URL=https://github.com/indygreg/python-build-standalone/releases/download
set PYTHON_BUILD_STANDALONE=20221002/cpython-3.10.7+20221002-x86_64-pc-windows-msvc-shared-install_only.tar.gz
@ -128,7 +127,7 @@ if %errorlevel% neq 0 goto err_exit
echo ***** Updated pip and wheel *****
set err_msg=----- requirements file copy failed -----
copy binary_installer\py3.10-windows-x86_64-cuda-reqs.txt requirements.txt
copy installer\py3.10-windows-x86_64-cuda-reqs.txt requirements.txt
if %errorlevel% neq 0 goto err_exit
set err_msg=----- main pip install failed -----
@ -141,11 +140,11 @@ set err_msg=----- InvokeAI setup failed -----
.venv\Scripts\python -m pip install %no_cache_dir% --no-warn-script-location -e .
if %errorlevel% neq 0 goto err_exit
copy binary_installer\invoke.bat.in .\invoke.bat
copy installer\invoke.bat .\invoke.bat
echo ***** Installed invoke launcher script ******
@rem more cleanup
rd /s /q binary_installer installer_files
rd /s /q installer installer_files
@rem preload the models
call .venv\Scripts\python scripts\configure_invokeai.py

View File

@ -1,9 +1,5 @@
#!/usr/bin/env bash
# ensure we're in the correct folder in case user's CWD is somewhere else
scriptdir=$(dirname "$0")
cd "$scriptdir"
set -euo pipefail
IFS=$'\n\t'
@ -26,8 +22,6 @@ function _err_exit {
# This enables a user to install this project without manually installing git or Python
echo -e "\n***** Installing InvokeAI into $(pwd)... *****\n"
export no_cache_dir="--no-cache-dir"
if [ $# -ge 1 ]; then
if [ "$1" = "use-cache" ]; then
@ -35,6 +29,10 @@ if [ $# -ge 1 ]; then
fi
fi
echo "$no_cache_dir"
echo -e "\n***** Installing InvokeAI... *****\n"
OS_NAME=$(uname -s)
case "${OS_NAME}" in
@ -82,17 +80,19 @@ if [ "$OS_NAME" == "darwin" ] && [ "$OS_ARCH" == "arm64" ]; then
fi
# config
echo "USING development BRANCH. REMEMBER TO CHANGE TO main BEFORE RELEASE"
INSTALL_ENV_DIR="$(pwd)/installer_files/env"
MICROMAMBA_DOWNLOAD_URL="https://micro.mamba.pm/api/micromamba/${MAMBA_OS_NAME}-${MAMBA_ARCH}/latest"
RELEASE_URL=https://github.com/invoke-ai/InvokeAI
RELEASE_SOURCEBALL=/archive/refs/heads/main.tar.gz
# RELEASE_SOURCEBALL=/archive/refs/heads/main.tar.gz
# RELEASE_SOURCEBALL=/archive/refs/heads/test-installer.tar.gz
RELEASE_SOURCEBALL=/archive/refs/heads/development.tar.gz
PYTHON_BUILD_STANDALONE_URL=https://github.com/indygreg/python-build-standalone/releases/download
if [ "$OS_NAME" == "darwin" ]; then
PYTHON_BUILD_STANDALONE=20221002/cpython-3.10.7+20221002-${PY_ARCH}-apple-darwin-install_only.tar.gz
elif [ "$OS_NAME" == "linux" ]; then
PYTHON_BUILD_STANDALONE=20221002/cpython-3.10.7+20221002-${PY_ARCH}-unknown-linux-gnu-install_only.tar.gz
fi
echo "INSTALLING $RELEASE_SOURCEBALL FROM $RELEASE_URL"
PACKAGES_TO_INSTALL=""
@ -192,33 +192,32 @@ echo -e "We're running under"
_err_exit $? _err_msg
_err_msg="\n----- pip update failed -----\n"
.venv/bin/python3 -m pip install $no_cache_dir --no-warn-script-location --upgrade pip
.venv/bin/python3 -m pip install "$no_cache_dir" --no-warn-script-location --upgrade pip wheel
_err_exit $? _err_msg
echo -e "\n***** Updated pip *****\n"
echo -e "\n***** Updated pip and wheel *****\n"
_err_msg="\n----- requirements file copy failed -----\n"
cp binary_installer/py3.10-${OS_NAME}-"${OS_ARCH}"-${CD}-reqs.txt requirements.txt
cp installer/py3.10-${OS_NAME}-"${OS_ARCH}"-${CD}-reqs.txt requirements.txt
_err_exit $? _err_msg
_err_msg="\n----- main pip install failed -----\n"
.venv/bin/python3 -m pip install $no_cache_dir --no-warn-script-location -r requirements.txt
.venv/bin/python3 -m pip install "$no_cache_dir" --no-warn-script-location -r requirements.txt
_err_exit $? _err_msg
echo -e "\n***** Installed Python dependencies *****\n"
_err_msg="\n----- InvokeAI setup failed -----\n"
.venv/bin/python3 -m pip install $no_cache_dir --no-warn-script-location -e .
.venv/bin/python3 -m pip install "$no_cache_dir" --no-warn-script-location -e .
_err_exit $? _err_msg
echo -e "\n***** Installed InvokeAI *****\n"
cp binary_installer/invoke.sh.in ./invoke.sh
chmod a+rx ./invoke.sh
cp installer/invoke.sh .
echo -e "\n***** Installed invoke launcher script ******\n"
# more cleanup
rm -rf binary_installer/ installer_files/
rm -rf installer/ installer_files/
# preload the models
.venv/bin/python3 scripts/configure_invokeai.py
@ -228,8 +227,6 @@ deactivate
echo -e "\n***** Finished downloading models *****\n"
echo "All done! Run the command"
echo " $scriptdir/invoke.sh"
echo "to start InvokeAI."
echo "All done! Run the command './invoke.sh' to start InvokeAI."
read -p "Press any key to exit..."
exit

5
binary_installer/invoke.sh.in → installer/invoke.sh Normal file → Executable file
View File

@ -4,11 +4,6 @@ set -eu
. .venv/bin/activate
# set required env var for torch on mac MPS
if [ "$(uname -s)" == "Darwin" ]; then
export PYTORCH_ENABLE_MPS_FALLBACK=1
fi
echo "Do you want to generate images using the"
echo "1. command-line"
echo "2. browser-based UI"

View File

@ -2,10 +2,9 @@
# This file is autogenerated by pip-compile with python 3.10
# To update, run:
#
# pip-compile --allow-unsafe --generate-hashes --output-file=installer/py3.10-darwin-arm64-mps-reqs.txt installer/requirements.in
# pip-compile --allow-unsafe --generate-hashes --output-file=installer/py3.10-darwin-x86_64-cpu-reqs.txt installer/requirements.in
#
--extra-index-url https://download.pytorch.org/whl/torch_stable.html
--extra-index-url https://download.pytorch.org/whl/cu116
--trusted-host https
absl-py==1.3.0 \
@ -151,10 +150,6 @@ blinker==1.5 \
--hash=sha256:1eb563df6fdbc39eeddc177d953203f99f097e9bf0e2b8f9f3cf18b6ca425e36 \
--hash=sha256:923e5e2f69c155f2cc42dafbbd70e16e3fde24d2d4aa2ab72fbe386238892462
# via streamlit
boltons==21.0.0 \
--hash=sha256:65e70a79a731a7fe6e98592ecfb5ccf2115873d01dbc576079874629e5c90f13 \
--hash=sha256:b9bb7b58b2b420bbe11a6025fdef6d3e5edc9f76a42fb467afe7ca212ef9948b
# via torchsde
cachetools==5.2.0 \
--hash=sha256:6a94c6402995a99c3970cc7e4884bb60b4a8639938157eeed436098bf9831757 \
--hash=sha256:f9f17d2aec496a9aa6b76f53e3b614c965223c061982d434d160f930c698a9db
@ -613,8 +608,8 @@ jsonschema==4.17.0 \
# via
# altair
# jsonmerge
k-diffusion @ https://github.com/Birch-san/k-diffusion/archive/363386981fee88620709cf8f6f2eea167bd6cd74.zip \
--hash=sha256:8eac5cdc08736e6d61908a1b2948f2b2f62691b01dc1aab978bddb3451af0d66
k-diffusion @ https://github.com/invoke-ai/k-diffusion/archive/7f16b2c33411f26b3eae78d10648d625cb0c1095.zip \
--hash=sha256:c3f2c84036aa98c3abf4552fafab04df5ca472aa639982795e05bb1db43ce5e4
# via -r installer/requirements.in
kiwisolver==1.4.4 \
--hash=sha256:02f79693ec433cb4b5f51694e8477ae83b3205768a6fb48ffba60549080e295b \
@ -1008,7 +1003,6 @@ numpy==1.23.4 \
# tifffile
# torch-fidelity
# torchmetrics
# torchsde
# torchvision
# transformers
oauthlib==3.2.2 \
@ -1660,7 +1654,6 @@ scipy==1.9.3 \
# scikit-learn
# torch-fidelity
# torchdiffeq
# torchsde
semver==2.13.0 \
--hash=sha256:ced8b23dceb22134307c1b8abfa523da14198793d9787ac838e70e29e77458d4 \
--hash=sha256:fa0fe2722ee1c3f57eac478820c3a5ae2f624af8264cbdf9000c980ff7f75e3f
@ -1876,7 +1869,6 @@ torch==1.12.1 ; platform_system == "Darwin" \
# torch-fidelity
# torchdiffeq
# torchmetrics
# torchsde
# torchvision
torch-fidelity==0.3.0 \
--hash=sha256:3d3e33db98919759cc4f3f24cb27e1e74bdc7c905d90a780630e4e1c18492b66 \
@ -1890,10 +1882,6 @@ torchmetrics==0.10.2 \
--hash=sha256:43757d82266969906fc74b6e80766fcb2a0d52d6c3d09e3b7c98cf3b733fd20c \
--hash=sha256:daa29d96bff5cff04d80eec5b9f5076993d6ac9c2d2163e88b6b31f8d38f7c25
# via pytorch-lightning
torchsde==0.2.5 \
--hash=sha256:222be9e15610d37a4b5a71cfa0c442178f9fd9ca02f6522a3e11c370b3d0906b \
--hash=sha256:4c34373a94a357bdf60bbfee00c850f3563d634491555820b900c9a4f7eff300
# via k-diffusion
torchvision==0.13.1 ; platform_system == "Darwin" \
--hash=sha256:0298bae3b09ac361866088434008d82b99d6458fe8888c8df90720ef4b347d44 \
--hash=sha256:08f592ea61836ebeceb5c97f4d7a813b9d7dc651bbf7ce4401563ccfae6a21fc \
@ -1954,9 +1942,6 @@ tqdm==4.64.1 \
# taming-transformers-rom1504
# torch-fidelity
# transformers
trampoline==0.1.2 \
--hash=sha256:36cc9a4ff9811843d177fc0e0740efbd7da39eadfe6e50c9e2937cbc06d899d9
# via torchsde
transformers==4.24.0 \
--hash=sha256:486f353a8e594002e48be0e2aba723d96eda839e63bfe274702a4b5eda85559b \
--hash=sha256:b7ab50039ef9bf817eff14ab974f306fd20a72350bdc9df3a858fd009419322e

View File

@ -1,10 +1,9 @@
#
# This file is autogenerated by pip-compile with Python 3.9
# by the following command:
# This file is autogenerated by pip-compile with python 3.9
# To update, run:
#
# pip-compile --allow-unsafe --generate-hashes --output-file=binary_installer/py3.10-linux-x86_64-cuda-reqs.txt binary_installer/requirements.in
# pip-compile --allow-unsafe --generate-hashes --output-file=installer/py3.10-linux-x86_64-cuda-reqs.txt installer/requirements.in
#
--extra-index-url https://download.pytorch.org/whl/torch_stable.html
--extra-index-url https://download.pytorch.org/whl/cu116
--trusted-host https
@ -18,7 +17,7 @@ accelerate==0.14.0 \
--hash=sha256:31c5bcc40564ef849b5bc1c4424a43ccaf9e26413b7df89c2e36bf81f070fd44 \
--hash=sha256:b15d562c0889d0cf441b01faa025dfc29b163d061b6cc7d489c2c83b0a55ffab
# via
# -r binary_installer/requirements.in
# -r installer/requirements.in
# k-diffusion
addict==2.4.0 \
--hash=sha256:249bb56bbfd3cdc2a004ea0ff4c2b6ddc84d53bc2194761636eb314d5cfa5dfc \
@ -120,7 +119,7 @@ aiosignal==1.2.0 \
albumentations==1.3.0 \
--hash=sha256:294165d87d03bc8323e484927f0a5c1a3c64b0e7b9c32a979582a6c93c363bdf \
--hash=sha256:be1af36832c8893314f2a5550e8ac19801e04770734c1b70fa3c996b41f37bed
# via -r binary_installer/requirements.in
# via -r installer/requirements.in
altair==4.2.0 \
--hash=sha256:0c724848ae53410c13fa28be2b3b9a9dcb7b5caa1a70f7f217bd663bb419935a \
--hash=sha256:d87d9372e63b48cd96b2a6415f0cf9457f50162ab79dc7a31cd7e024dd840026
@ -151,10 +150,6 @@ blinker==1.5 \
--hash=sha256:1eb563df6fdbc39eeddc177d953203f99f097e9bf0e2b8f9f3cf18b6ca425e36 \
--hash=sha256:923e5e2f69c155f2cc42dafbbd70e16e3fde24d2d4aa2ab72fbe386238892462
# via streamlit
boltons==21.0.0 \
--hash=sha256:65e70a79a731a7fe6e98592ecfb5ccf2115873d01dbc576079874629e5c90f13 \
--hash=sha256:b9bb7b58b2b420bbe11a6025fdef6d3e5edc9f76a42fb467afe7ca212ef9948b
# via torchsde
cachetools==5.2.0 \
--hash=sha256:6a94c6402995a99c3970cc7e4884bb60b4a8639938157eeed436098bf9831757 \
--hash=sha256:f9f17d2aec496a9aa6b76f53e3b614c965223c061982d434d160f930c698a9db
@ -188,11 +183,11 @@ click==8.1.3 \
clip @ https://github.com/openai/CLIP/archive/d50d76daa670286dd6cacf3bcd80b5e4823fc8e1.zip \
--hash=sha256:b5842c25da441d6c581b53a5c60e0c2127ebafe0f746f8e15561a006c6c3be6a
# via
# -r binary_installer/requirements.in
# -r installer/requirements.in
# clipseg
clipseg @ https://github.com/invoke-ai/clipseg/archive/1f754751c85d7d4255fa681f4491ff5711c1c288.zip \
--hash=sha256:14f43ed42f90be3fe57f06de483cb8be0f67f87a6f62a011339d45a39f4b4189
# via -r binary_installer/requirements.in
# via -r installer/requirements.in
commonmark==0.9.1 \
--hash=sha256:452f9dc859be7f06631ddcb328b6919c67984aca654e5fefb3914d54691aed60 \
--hash=sha256:da2f38c92590f83de410ba1a3cbceafbc74fee9def35f9251ba9a971d6d66fd9
@ -279,7 +274,7 @@ decorator==5.1.1 \
diffusers==0.7.2 \
--hash=sha256:4a5f8b3a5fbd936bba7d459611cb35ec62875030367be32b232f9e19543e25a9 \
--hash=sha256:fb814ffd150cc6f470380b8c6a521181a77beb2f44134d2aad2e4cd8aa2ced0e
# via -r binary_installer/requirements.in
# via -r installer/requirements.in
dnspython==2.2.1 \
--hash=sha256:0f7569a4a6ff151958b64304071d370daa3243d15941a7beedf0c9fe5105603e \
--hash=sha256:a851e51367fb93e9e1361732c1d60dab63eff98712e503ea7d92e6eccb109b4f
@ -299,7 +294,7 @@ entrypoints==0.4 \
eventlet==0.33.1 \
--hash=sha256:a085922698e5029f820cf311a648ac324d73cec0e4792877609d978a4b5bbf31 \
--hash=sha256:afbe17f06a58491e9aebd7a4a03e70b0b63fd4cf76d8307bae07f280479b1515
# via -r binary_installer/requirements.in
# via -r installer/requirements.in
facexlib==0.2.5 \
--hash=sha256:31e20cc4ed5d63562d380e4564bae14ac0d5d1899a079bad87621e13564567e4 \
--hash=sha256:cc7ceb56c5424319c47223cf75eef6828c34c66082707c6eb35b95d39779f02d
@ -325,15 +320,15 @@ flask==2.2.2 \
flask-cors==3.0.10 \
--hash=sha256:74efc975af1194fc7891ff5cd85b0f7478be4f7f59fe158102e91abb72bb4438 \
--hash=sha256:b60839393f3b84a0f3746f6cdca56c1ad7426aa738b70d6c61375857823181de
# via -r binary_installer/requirements.in
# via -r installer/requirements.in
flask-socketio==5.3.1 \
--hash=sha256:fd0ed0fc1341671d92d5f5b2f5503916deb7aa7e2940e6636cfa2c087c828bf9 \
--hash=sha256:ff0c721f20bff1e2cfba77948727a8db48f187e89a72fe50c34478ce6efb3353
# via -r binary_installer/requirements.in
# via -r installer/requirements.in
flaskwebgui==0.3.7 \
--hash=sha256:4a69955308eaa8bb256ba04a994dc8f58a48dcd6f9599694ab1bcd9f43d88a5d \
--hash=sha256:535974ce2672dcc74787c254de24cceed4101be75d96952dae82014dd57f061e
# via -r binary_installer/requirements.in
# via -r installer/requirements.in
fonttools==4.38.0 \
--hash=sha256:2bb244009f9bf3fa100fc3ead6aeb99febe5985fa20afbfbaa2f8946c2fbdaf1 \
--hash=sha256:820466f43c8be8c3009aef8b87e785014133508f0de64ec469e4efb643ae54fb
@ -417,11 +412,11 @@ future==0.18.2 \
getpass-asterisk==1.0.1 \
--hash=sha256:20d45cafda0066d761961e0919728526baf7bb5151fbf48a7d5ea4034127d857 \
--hash=sha256:7cc357a924cf62fa4e15b73cb4e5e30685c9084e464ffdc3fd9000a2b54ea9e9
# via -r binary_installer/requirements.in
gfpgan @ https://github.com/invoke-ai/GFPGAN/archive/c796277a1cf77954e5fc0b288d7062d162894248.zip ; platform_system == "Linux" or platform_system == "Darwin" \
--hash=sha256:4155907b8b7db3686324554df7007eedd245cdf8656c21da9d9a3f44bef2fcaa
# via -r installer/requirements.in
gfpgan @ https://github.com/TencentARC/GFPGAN/archive/2eac2033893ca7f427f4035d80fe95b92649ac56.zip \
--hash=sha256:79e6d71c8f1df7c7ccb0ac6b9a2ccb615ad5cde818c8b6f285a8711c05aebf85
# via
# -r binary_installer/requirements.in
# -r installer/requirements.in
# realesrgan
gitdb==4.0.9 \
--hash=sha256:8033ad4e853066ba6ca92050b9df2f89301b8fc8bf7e9324d412a63f8bf1a8fd \
@ -582,7 +577,7 @@ imageio-ffmpeg==0.4.7 \
--hash=sha256:7a08838f97f363e37ca41821b864fd3fdc99ab1fe2421040c78eb5f56a9e723e \
--hash=sha256:8e724d12dfe83e2a6eb39619e820243ca96c81c47c2648e66e05f7ee24e14312 \
--hash=sha256:fc60686ef03c2d0f842901b206223c30051a6a120384458761390104470846fd
# via -r binary_installer/requirements.in
# via -r installer/requirements.in
importlib-metadata==5.0.0 \
--hash=sha256:da31db32b304314d044d3c12c79bd59e307889b287ad12ff387b3500835fc2ab \
--hash=sha256:ddb0e35065e8938f867ed4928d0ae5bf2a53b7773871bfe6bcc7e4fcdc7dea43
@ -615,9 +610,9 @@ jsonschema==4.17.0 \
# via
# altair
# jsonmerge
k-diffusion @ https://github.com/Birch-san/k-diffusion/archive/363386981fee88620709cf8f6f2eea167bd6cd74.zip \
--hash=sha256:8eac5cdc08736e6d61908a1b2948f2b2f62691b01dc1aab978bddb3451af0d66
# via -r binary_installer/requirements.in
k-diffusion @ https://github.com/invoke-ai/k-diffusion/archive/7f16b2c33411f26b3eae78d10648d625cb0c1095.zip \
--hash=sha256:c3f2c84036aa98c3abf4552fafab04df5ca472aa639982795e05bb1db43ce5e4
# via -r installer/requirements.in
kiwisolver==1.4.4 \
--hash=sha256:02f79693ec433cb4b5f51694e8477ae83b3205768a6fb48ffba60549080e295b \
--hash=sha256:03baab2d6b4a54ddbb43bba1a3a2d1627e82d205c5cf8f4c924dc49284b87166 \
@ -1010,7 +1005,6 @@ numpy==1.23.4 \
# tifffile
# torch-fidelity
# torchmetrics
# torchsde
# torchvision
# transformers
oauthlib==3.2.2 \
@ -1097,7 +1091,7 @@ pathtools==0.1.2 \
picklescan==0.0.5 \
--hash=sha256:368cf1b9a075bc1b6460ad82b694f260532b836c82f99d13846cd36e1bbe7f9a \
--hash=sha256:57153eca04d5df5009f2cdd595aef261b8a6f27e03046a1c84f672aa6869c592
# via -r binary_installer/requirements.in
# via -r installer/requirements.in
pillow==9.3.0 \
--hash=sha256:03150abd92771742d4a8cd6f2fa6246d847dcd2e332a18d0c15cc75bf6703040 \
--hash=sha256:073adb2ae23431d3b9bcbcff3fe698b62ed47211d0716b067385538a1b0f28b8 \
@ -1306,11 +1300,11 @@ pyparsing==3.0.9 \
# packaging
pypatchmatch @ https://github.com/invoke-ai/PyPatchMatch/archive/129863937a8ab37f6bbcec327c994c0f932abdbc.zip \
--hash=sha256:4ad6ec95379e7d122d494ff76633cc7cf9b71330d5efda147fceba81e3dc6cd2
# via -r binary_installer/requirements.in
# via -r installer/requirements.in
pyreadline3==3.4.1 \
--hash=sha256:6f3d1f7b8a31ba32b73917cefc1f28cc660562f39aea8646d30bd6eff21f7bae \
--hash=sha256:b0efb6516fd4fb07b45949053826a62fa4cb353db5be2bbb4a7aa1fdd1e345fb
# via -r binary_installer/requirements.in
# via -r installer/requirements.in
pyrsistent==0.19.2 \
--hash=sha256:055ab45d5911d7cae397dc418808d8802fb95262751872c841c170b0dbf51eed \
--hash=sha256:111156137b2e71f3a9936baf27cb322e8024dac3dc54ec7fb9f0bcf3249e68bb \
@ -1447,7 +1441,7 @@ qudida==0.0.4 \
realesrgan==0.3.0 \
--hash=sha256:0d36da96ab9f447071606e91f502ccdfb08f80cc82ee4f8caf720c7745ccec7e \
--hash=sha256:59336c16c30dd5130eff350dd27424acb9b7281d18a6810130e265606c9a6088
# via -r binary_installer/requirements.in
# via -r installer/requirements.in
regex==2022.10.31 \
--hash=sha256:052b670fafbe30966bbe5d025e90b2a491f85dfe5b2583a163b5e60a85a321ad \
--hash=sha256:0653d012b3bf45f194e5e6a41df9258811ac8fc395579fa82958a8b76286bea4 \
@ -1662,7 +1656,6 @@ scipy==1.9.3 \
# scikit-learn
# torch-fidelity
# torchdiffeq
# torchsde
semver==2.13.0 \
--hash=sha256:ced8b23dceb22134307c1b8abfa523da14198793d9787ac838e70e29e77458d4 \
--hash=sha256:fa0fe2722ee1c3f57eac478820c3a5ae2f624af8264cbdf9000c980ff7f75e3f
@ -1670,7 +1663,7 @@ semver==2.13.0 \
send2trash==1.8.0 \
--hash=sha256:d2c24762fd3759860a0aff155e45871447ea58d2be6bdd39b5c8f966a0c99c2d \
--hash=sha256:f20eaadfdb517eaca5ce077640cb261c7d2698385a6a0f072a4a5447fd49fa08
# via -r binary_installer/requirements.in
# via -r installer/requirements.in
sentry-sdk==1.10.1 \
--hash=sha256:06c0fa9ccfdc80d7e3b5d2021978d6eb9351fa49db9b5847cf4d1f2a473414ad \
--hash=sha256:105faf7bd7b7fa25653404619ee261527266b14103fe1389e0ce077bd23a9691
@ -1761,11 +1754,11 @@ smmap==5.0.0 \
streamlit==1.14.0 \
--hash=sha256:62556d873567e1b3427bcd118a57ee6946619f363bd6bba38df2d1f8225ecba0 \
--hash=sha256:e078b8143d150ba721bdb9194218e311c5fe1d6d4156473a2dea6cc848a6c9fc
# via -r binary_installer/requirements.in
# via -r installer/requirements.in
taming-transformers-rom1504==0.0.6 \
--hash=sha256:051b5804c58caa247bcd51d17ddb525b4d5f892a29d42dc460f40e3e9e34e5d8 \
--hash=sha256:73fe5fc1108accee4236ee6976e0987ab236afad0af06cb9f037641a908d2c32
# via -r binary_installer/requirements.in
# via -r installer/requirements.in
tb-nightly==2.11.0a20221106 \
--hash=sha256:8940457ee42db92f01da8bcdbbea1a476735eda559dde5976f5728919960af4a
# via
@ -1790,7 +1783,7 @@ tensorboard-plugin-wit==1.8.1 \
# tensorboard
test-tube==0.7.5 \
--hash=sha256:1379c33eb8cde3e9b36610f87da0f16c2e06496b1cfebac473df4e7be2faa124
# via -r binary_installer/requirements.in
# via -r installer/requirements.in
threadpoolctl==3.1.0 \
--hash=sha256:8b99adda265feb6773280df41eece7b2e6561b772d21ffd52e372f999024907b \
--hash=sha256:a335baacfaa4400ae1f0d8e3a58d6674d2f8828e3716bb2802c44955ad391380
@ -1850,7 +1843,7 @@ torch==1.12.0+cu116 ; platform_system == "Linux" or platform_system == "Windows"
--hash=sha256:aa43d7b54b86f723f17c5c44df1078c59a6149fc4d42fbef08aafab9d61451c9 \
--hash=sha256:f772be831447dd01ebd26cbedf619e668d1b269d69bf6b4ff46b1378362bff26
# via
# -r binary_installer/requirements.in
# -r installer/requirements.in
# accelerate
# basicsr
# clean-fid
@ -1866,12 +1859,11 @@ torch==1.12.0+cu116 ; platform_system == "Linux" or platform_system == "Windows"
# torch-fidelity
# torchdiffeq
# torchmetrics
# torchsde
# torchvision
torch-fidelity==0.3.0 \
--hash=sha256:3d3e33db98919759cc4f3f24cb27e1e74bdc7c905d90a780630e4e1c18492b66 \
--hash=sha256:d01284825595feb7dc3eae3dc9a0d8ced02be764813a3483f109bc142b52a1d3
# via -r binary_installer/requirements.in
# via -r installer/requirements.in
torchdiffeq==0.2.3 \
--hash=sha256:b5b01ec1294a2d8d5f77e567bf17c5de1237c0573cb94deefa88326f0e18c338 \
--hash=sha256:fe75f434b9090ac0c27702e02bed21472b0f87035be6581f51edc5d4013ea31a
@ -1880,10 +1872,6 @@ torchmetrics==0.10.2 \
--hash=sha256:43757d82266969906fc74b6e80766fcb2a0d52d6c3d09e3b7c98cf3b733fd20c \
--hash=sha256:daa29d96bff5cff04d80eec5b9f5076993d6ac9c2d2163e88b6b31f8d38f7c25
# via pytorch-lightning
torchsde==0.2.5 \
--hash=sha256:222be9e15610d37a4b5a71cfa0c442178f9fd9ca02f6522a3e11c370b3d0906b \
--hash=sha256:4c34373a94a357bdf60bbfee00c850f3563d634491555820b900c9a4f7eff300
# via k-diffusion
torchvision==0.13.0+cu116 ; platform_system == "Linux" or platform_system == "Windows" \
--hash=sha256:1696feadf1921c8fa1549bad774221293298288ebedaa14e44bc3e57e964a369 \
--hash=sha256:572544b108eaf12638f3dca0f496a453c4b8d8256bcc8333d5355df641c0380c \
@ -1894,7 +1882,7 @@ torchvision==0.13.0+cu116 ; platform_system == "Linux" or platform_system == "Wi
--hash=sha256:cb6bf0117b8f4b601baeae54e8a6bb5c4942b054835ba997f438ddcb7adcfb90 \
--hash=sha256:d1a3c124645e3460b3e50b54eb89a2575a5036bfa618f15dc4f5d635c716069d
# via
# -r binary_installer/requirements.in
# -r installer/requirements.in
# basicsr
# clean-fid
# clip
@ -1933,13 +1921,10 @@ tqdm==4.64.1 \
# taming-transformers-rom1504
# torch-fidelity
# transformers
trampoline==0.1.2 \
--hash=sha256:36cc9a4ff9811843d177fc0e0740efbd7da39eadfe6e50c9e2937cbc06d899d9
# via torchsde
transformers==4.24.0 \
--hash=sha256:486f353a8e594002e48be0e2aba723d96eda839e63bfe274702a4b5eda85559b \
--hash=sha256:b7ab50039ef9bf817eff14ab974f306fd20a72350bdc9df3a858fd009419322e
# via -r binary_installer/requirements.in
# via -r installer/requirements.in
typing-extensions==4.4.0 \
--hash=sha256:1511434bb92bf8dd198c12b1cc812e800d4181cfcb867674e0f8279cc93087aa \
--hash=sha256:16fa4864408f655d35ec496218b85f79b3437c829e93320c7c9215ccfd92489e

View File

@ -4,7 +4,6 @@
#
# pip-compile --allow-unsafe --generate-hashes --output-file=installer/py3.10-windows-x86_64-cuda-reqs.txt installer/requirements.in
#
--extra-index-url https://download.pytorch.org/whl/torch_stable.html
--extra-index-url https://download.pytorch.org/whl/cu116
--trusted-host https
@ -151,10 +150,6 @@ blinker==1.5 \
--hash=sha256:1eb563df6fdbc39eeddc177d953203f99f097e9bf0e2b8f9f3cf18b6ca425e36 \
--hash=sha256:923e5e2f69c155f2cc42dafbbd70e16e3fde24d2d4aa2ab72fbe386238892462
# via streamlit
boltons==21.0.0 \
--hash=sha256:65e70a79a731a7fe6e98592ecfb5ccf2115873d01dbc576079874629e5c90f13 \
--hash=sha256:b9bb7b58b2b420bbe11a6025fdef6d3e5edc9f76a42fb467afe7ca212ef9948b
# via torchsde
cachetools==5.2.0 \
--hash=sha256:6a94c6402995a99c3970cc7e4884bb60b4a8639938157eeed436098bf9831757 \
--hash=sha256:f9f17d2aec496a9aa6b76f53e3b614c965223c061982d434d160f930c698a9db
@ -619,8 +614,8 @@ jsonschema==4.17.0 \
# via
# altair
# jsonmerge
k-diffusion @ https://github.com/Birch-san/k-diffusion/archive/363386981fee88620709cf8f6f2eea167bd6cd74.zip \
--hash=sha256:8eac5cdc08736e6d61908a1b2948f2b2f62691b01dc1aab978bddb3451af0d66
k-diffusion @ https://github.com/invoke-ai/k-diffusion/archive/7f16b2c33411f26b3eae78d10648d625cb0c1095.zip \
--hash=sha256:c3f2c84036aa98c3abf4552fafab04df5ca472aa639982795e05bb1db43ce5e4
# via -r installer/requirements.in
kiwisolver==1.4.4 \
--hash=sha256:02f79693ec433cb4b5f51694e8477ae83b3205768a6fb48ffba60549080e295b \
@ -1014,7 +1009,6 @@ numpy==1.23.4 \
# tifffile
# torch-fidelity
# torchmetrics
# torchsde
# torchvision
# transformers
oauthlib==3.2.2 \
@ -1666,7 +1660,6 @@ scipy==1.9.3 \
# scikit-learn
# torch-fidelity
# torchdiffeq
# torchsde
semver==2.13.0 \
--hash=sha256:ced8b23dceb22134307c1b8abfa523da14198793d9787ac838e70e29e77458d4 \
--hash=sha256:fa0fe2722ee1c3f57eac478820c3a5ae2f624af8264cbdf9000c980ff7f75e3f
@ -1870,7 +1863,6 @@ torch==1.12.0+cu116 ; platform_system == "Linux" or platform_system == "Windows"
# torch-fidelity
# torchdiffeq
# torchmetrics
# torchsde
# torchvision
torch-fidelity==0.3.0 \
--hash=sha256:3d3e33db98919759cc4f3f24cb27e1e74bdc7c905d90a780630e4e1c18492b66 \
@ -1884,10 +1876,6 @@ torchmetrics==0.10.2 \
--hash=sha256:43757d82266969906fc74b6e80766fcb2a0d52d6c3d09e3b7c98cf3b733fd20c \
--hash=sha256:daa29d96bff5cff04d80eec5b9f5076993d6ac9c2d2163e88b6b31f8d38f7c25
# via pytorch-lightning
torchsde==0.2.5 \
--hash=sha256:222be9e15610d37a4b5a71cfa0c442178f9fd9ca02f6522a3e11c370b3d0906b \
--hash=sha256:4c34373a94a357bdf60bbfee00c850f3563d634491555820b900c9a4f7eff300
# via k-diffusion
torchvision==0.13.0+cu116 ; platform_system == "Linux" or platform_system == "Windows" \
--hash=sha256:1696feadf1921c8fa1549bad774221293298288ebedaa14e44bc3e57e964a369 \
--hash=sha256:572544b108eaf12638f3dca0f496a453c4b8d8256bcc8333d5355df641c0380c \
@ -1937,9 +1925,6 @@ tqdm==4.64.1 \
# taming-transformers-rom1504
# torch-fidelity
# transformers
trampoline==0.1.2 \
--hash=sha256:36cc9a4ff9811843d177fc0e0740efbd7da39eadfe6e50c9e2937cbc06d899d9
# via torchsde
transformers==4.24.0 \
--hash=sha256:486f353a8e594002e48be0e2aba723d96eda839e63bfe274702a4b5eda85559b \
--hash=sha256:b7ab50039ef9bf817eff14ab974f306fd20a72350bdc9df3a858fd009419322e

View File

@ -1,6 +1,5 @@
--prefer-binary
--extra-index-url https://download.pytorch.org/whl/torch_stable.html
--extra-index-url https://download.pytorch.org/whl/cu116
--trusted-host https://download.pytorch.org
accelerate~=0.14
albumentations
@ -26,7 +25,6 @@ transformers
picklescan
https://github.com/openai/CLIP/archive/d50d76daa670286dd6cacf3bcd80b5e4823fc8e1.zip
https://github.com/invoke-ai/clipseg/archive/1f754751c85d7d4255fa681f4491ff5711c1c288.zip
https://github.com/invoke-ai/GFPGAN/archive/3f5d2397361199bc4a91c08bb7d80f04d7805615.zip ; platform_system=='Windows'
https://github.com/invoke-ai/GFPGAN/archive/c796277a1cf77954e5fc0b288d7062d162894248.zip ; platform_system=='Linux' or platform_system=='Darwin'
https://github.com/Birch-san/k-diffusion/archive/363386981fee88620709cf8f6f2eea167bd6cd74.zip
https://github.com/TencentARC/GFPGAN/archive/2eac2033893ca7f427f4035d80fe95b92649ac56.zip
https://github.com/invoke-ai/k-diffusion/archive/7f16b2c33411f26b3eae78d10648d625cb0c1095.zip
https://github.com/invoke-ai/PyPatchMatch/archive/129863937a8ab37f6bbcec327c994c0f932abdbc.zip

View File

@ -36,7 +36,7 @@ class Concepts(object):
models = self.hf_api.list_models(filter=ModelFilter(model_name='sd-concepts-library/'))
self.concept_list = [a.id.split('/')[1] for a in models]
except Exception as e:
print(f' ** WARNING: Hugging Face textual inversion concepts libraries could not be loaded. The error was {str(e)}.')
print(' ** WARNING: Hugging Face textual inversion concepts libraries could not be loaded. The error was {str(e)}.')
print(' ** You may load .bin and .pt file(s) manually using the --embedding_directory argument.')
return self.concept_list

View File

@ -27,7 +27,7 @@ if Globals.try_patchmatch:
print('>> Patchmatch initialized')
infill_methods.append('patchmatch')
else:
print('>> Patchmatch not loaded (nonfatal)')
print('>> Patchmatch not loaded, please see https://github.com/invoke-ai/InvokeAI/blob/patchmatch-install-docs/docs/installation/INSTALL_PATCHMATCH.md')
else:
print('>> Patchmatch loading disabled')

View File

@ -101,8 +101,7 @@ class Completer(object):
self.linebuffer = None
self.auto_history_active = True
self.extensions = None
self.concepts = None
self.embedding_terms = set()
self.concepts = Concepts().list_concepts()
return
def complete(self, text, state):
@ -271,21 +270,16 @@ class Completer(object):
return matches
def add_embedding_terms(self, terms:list[str]):
self.embedding_terms = set(terms)
if self.concepts:
self.embedding_terms.update(self.concepts)
self.concepts = Concepts().list_concepts()
self.concepts.extend(terms)
def _concept_completions(self, text, state):
if self.concepts is None:
self.concepts = set(Concepts().list_concepts())
self.embedding_terms.update(self.concepts)
partial = text[1:] # this removes the leading '<'
if len(partial) == 0:
return list(self.embedding_terms) # whole dump - think if user wants this!
return self.concepts # whole dump - think if user wants this!
matches = list()
for concept in self.embedding_terms:
for concept in self.concepts:
if concept.startswith(partial):
matches.append(f'<{concept}>')
matches.sort()
@ -422,11 +416,7 @@ def get_completer(opt:Args, models=[])->Completer:
readline.parse_and_bind('set skip-completed-text on')
readline.parse_and_bind('set show-all-if-ambiguous on')
outdir = os.path.expanduser(opt.outdir)
if os.path.isabs(outdir):
histfile = os.path.join(outdir,'.invoke_history')
else:
histfile = os.path.join(Globals.root, outdir, '.invoke_history')
histfile = os.path.join(os.path.expanduser(opt.outdir), '.invoke_history')
try:
readline.read_history_file(histfile)
readline.set_history_length(1000)

View File

@ -193,7 +193,7 @@ def mkdir_and_rename(path):
if os.path.exists(path):
new_name = path + '_archived_' + get_timestamp()
print('Path already exists. Rename it to [{:s}]'.format(new_name))
os.replace(path, new_name)
os.rename(path, new_name)
os.makedirs(path)

View File

@ -74,8 +74,8 @@
"#@title 3. Install dependencies\n",
"import gc\n",
"\n",
"!wget https://raw.githubusercontent.com/invoke-ai/InvokeAI/development/environments-and-requirements/requirements-base.txt\n",
"!wget https://raw.githubusercontent.com/invoke-ai/InvokeAI/development/environments-and-requirements/requirements-win-colab-cuda.txt\n",
"!wget https://raw.githubusercontent.com/invoke-ai/InvokeAI/development/environments-and-requirements/requirements.txt\n",
"!wget https://raw.githubusercontent.com/invoke-ai/InvokeAI/development/environments-and-requirements/requirements-lin-win-colab-CUDA.txt\n",
"!pip install colab-xterm\n",
"!pip install -r requirements-lin-win-colab-CUDA.txt\n",
"!pip install clean-fid torchtext\n",
@ -262,17 +262,17 @@
},
"gpuClass": "standard",
"kernelspec": {
"display_name": "Python 3.9.12 64-bit",
"display_name": "Python 3.10.4 64-bit",
"language": "python",
"name": "python3"
},
"language_info": {
"name": "python",
"version": "3.9.12"
"version": "3.10.4"
},
"vscode": {
"interpreter": {
"hash": "4e870c5c5fe42db7e2c5647ae5af656ff3391bf8c2b729cbf7fa0e16ca8cb5af"
"hash": "3ad933181bd8a04b432d3370b9dc3b0662ad032c4dfaa4e4f1596c548f763858"
}
}
},

25
scripts/configure_invokeai.py Executable file → Normal file
View File

@ -108,13 +108,11 @@ completely skip this step.
completer.complete_extensions(None) # turn off path-completion mode
selection = None
while selection is None:
choice = input('Download <r>ecommended models, <a>ll models, <c>ustomized list, or <s>kip this step? [r]: ')
choice = input('Download <r>ecommended models, <c>ustomize the list, or <s>kip this step? [r]: ')
if choice.startswith(('r','R')) or len(choice)==0:
selection = 'recommended'
elif choice.startswith(('c','C')):
selection = 'customized'
elif choice.startswith(('a','A')):
selection = 'all'
elif choice.startswith(('s','S')):
selection = 'skip'
return selection
@ -168,14 +166,7 @@ def recommended_datasets()->dict:
if Datasets[ds]['recommended']:
datasets[ds]=True
return datasets
#---------------------------------------------
def all_datasets()->dict:
datasets = dict()
for ds in Datasets.keys():
datasets[ds]=True
return datasets
#-------------------------------Authenticate against Hugging Face
def authenticate():
print('''
@ -226,9 +217,7 @@ This involves a few easy steps.
(You can enter anything you like in the token creation field marked "Name".
"Role" should be "read").
Now copy the token to your clipboard and paste it at the prompt. Windows
users can paste with right-click.
Token: '''
Now copy the token to your clipboard and paste it here: '''
)
access_token = getpass_asterisk.getpass_asterisk()
return access_token
@ -537,8 +526,6 @@ def download_weights(opt:dict):
if choice == 'recommended':
models = recommended_datasets()
elif choice == 'all':
models = all_datasets()
elif choice == 'customized':
models = select_datasets(choice)
if models is None and yes_or_no('Quit?',default_yes=False):
@ -584,8 +571,7 @@ def select_root(root:str, yes_to_all:bool=False):
completer.set_default_dir(default)
completer.complete_extensions(())
completer.set_line(default)
directory = input(f"Select a directory in which to install InvokeAI's models and configuration files [{default}]: ").strip(' \\')
return directory or default
return input(f"Select a directory in which to install InvokeAI's models and configuration files [{default}]: ") or default
#-------------------------------------
def select_outputs(root:str,yes_to_all:bool=False):
@ -595,8 +581,7 @@ def select_outputs(root:str,yes_to_all:bool=False):
completer.set_default_dir(os.path.expanduser('~'))
completer.complete_extensions(())
completer.set_line(default)
directory = input(f'Select the default directory for image outputs [{default}]: ').strip(' \\')
return directory or default
return input(f'Select the default directory for image outputs [{default}]: ') or default
#-------------------------------------
def initialize_rootdir(root:str,yes_to_all:bool=False):

View File

@ -2,26 +2,22 @@
cd "$(dirname "${BASH_SOURCE[0]}")"
VERSION='2.2.3'
# make the installer zip for linux and mac
rm -rf invokeAI
mkdir -p invokeAI
cp install.sh.in invokeAI/install.sh
chmod a+x invokeAI/install.sh
cp install.sh invokeAI
cp readme.txt invokeAI
zip -r invokeAI-src-installer-$VERSION-linux.zip invokeAI
zip -r invokeAI-src-installer-$VERSION-mac.zip invokeAI
zip -r invokeAI-src-installer-linux.zip invokeAI
zip -r invokeAI-src-installer-mac.zip invokeAI
# make the installer zip for windows
rm -rf invokeAI
mkdir -p invokeAI
cp install.bat.in invokeAI/install.bat
cp install.bat invokeAI
cp readme.txt invokeAI
cp WinLongPathsEnabled.reg invokeAI
zip -r invokeAI-src-installer-$VERSION-windows.zip invokeAI
zip -r invokeAI-src-installer-windows.zip invokeAI
rm -rf invokeAI
echo "The installer zips are ready to be distributed.."

View File

@ -5,20 +5,12 @@
@rem For users who already have git and conda, this step will be skipped.
@rem Next, it'll checkout the project's git repo, if necessary.
@rem Finally, it'll create the conda environment and configure InvokeAI.
@rem Finally, it'll create the conda environment and preload the models.
@rem This enables a user to install this project without manually installing conda and git.
@rem change to the script's directory
PUSHD "%~dp0"
echo "InvokeAI source installer..."
echo ""
echo "Some of the installation steps take a long time to run. Please be patient."
echo "If the script appears to hang for more than 10 minutes, please interrupt with control-C and retry."
echo "<Press any key to start the install process>"
pause
echo ""
echo "Installing InvokeAI.."
echo.
@rem config
set MAMBA_ROOT_PREFIX=%cd%\installer_files\mamba
@ -92,23 +84,23 @@ copy environments-and-requirements\environment-win-cuda.yml environment.yml
call conda env create
if "%ERRORLEVEL%" NEQ "0" (
echo ""
echo "Something went wrong while installing Python libraries and cannot continue."
echo "See https://invoke-ai.github.io/InvokeAI/INSTALL_SOURCE#troubleshooting for troubleshooting"
echo "tips, or visit https://invoke-ai.github.io/InvokeAI/#installation for alternative"
echo "installation methods"
echo "Something went wrong while installing Python libraries and cannot continue.
echo "Please visit https://invoke-ai.github.io/InvokeAI/#installation for alternative"
echo "installation methods."
echo "Press any key to continue"
pause
exit /b
)
copy source_installer\invoke.bat.in .\invoke.bat
copy source_installer\update.bat.in .\update.bat
copy source_installer\invoke.bat invoke.bat
copy source_installer\update.bat update.bat
call conda activate invokeai
@rem call configure script
call python scripts\configure_invokeai.py
@rem preload the models
call python scripts\preload_models.py
if "%ERRORLEVEL%" NEQ "0" (
echo ""
echo "The configure script crashed or was cancelled."
echo "The preload_models.py script crashed or was cancelled."
echo "InvokeAI is not ready to run. To run preload_models.py again,"
echo "run the command 'update.bat' in this directory."
echo "Press any key to continue"
@ -122,6 +114,5 @@ echo "* InvokeAI installed successfully *"
echo "You can now start generating images by double-clicking the 'invoke.bat' file (inside this folder)
echo "Press any key to continue"
pause
exit /b
exit 0

View File

@ -1,21 +1,17 @@
#!/usr/bin/env bash
#!/bin/bash
# This script will install git and conda (if not found on the PATH variable)
# using micromamba (an 8mb static-linked single-file binary, conda replacement).
# For users who already have git and conda, this step will be skipped.
# Next, it'll checkout the project's git repo, if necessary.
# Finally, it'll create the conda environment and configure InvokeAI.
# Finally, it'll create the conda environment and preload the models.
# This enables a user to install this project without manually installing conda and git.
cd "$(dirname "${BASH_SOURCE[0]}")"
echo "InvokeAI source installer..."
echo ""
echo "Some of the installation steps take a long time to run. Please be patient."
echo "If the script appears to hang for more than 10 minutes, please interrupt with control-C and retry."
read -n 1 -s -r -p "<Press any key to start the install>"
echo "Installing InvokeAI.."
echo ""
OS_NAME=$(uname -s)
@ -116,24 +112,21 @@ status=$?
if test $status -ne 0
then
echo "Something went wrong while installing Python libraries and cannot continue."
echo "See https://invoke-ai.github.io/InvokeAI/INSTALL_SOURCE#troubleshooting for troubleshooting"
echo "tips, or visit https://invoke-ai.github.io/InvokeAI/#installation for alternative"
echo "installation methods"
echo "Something went wrong while installing Python libraries and cannot continue."
echo "Please visit https://invoke-ai.github.io/InvokeAI/#installation for alternative"
echo "installation methods"
else
ln -sf ./source_installer/invoke.sh.in ./invoke.sh
ln -sf ./source_installer/update.sh.in ./update.sh
chmod a+rx ./source_installer/invoke.sh.in
chmod a+rx ./source_installer/update.sh.in
ln -sf ./source_installer/invoke.sh .
ln -sf ./source_installer/update.sh .
conda activate invokeai
# configure
echo "Calling the configure_invokeai script"
python scripts/configure_invokeai.py
# preload the models
echo "Calling the preload_models.py script"
python scripts/preload_models.py
status=$?
if test $status -ne 0
then
echo "The configure_invoke.py script crashed or was cancelled."
echo "The preload_models.py script crashed or was cancelled."
echo "InvokeAI is not ready to run. Try again by running"
echo "update.sh in this directory."
else

View File

@ -10,11 +10,6 @@ source "$CONDA_BASEPATH/etc/profile.d/conda.sh" # otherwise conda complains abou
conda activate invokeai
# set required env var for torch on mac MPS
if [ "$(uname -s)" == "Darwin" ]; then
export PYTORCH_ENABLE_MPS_FALLBACK=1
fi
if [ "$0" != "bash" ]; then
echo "Do you want to generate images using the"
echo "1. command-line"