Commit Graph

797 Commits

Author SHA1 Message Date
javl
87439feeb2 Add arguments to use SSL to webserver 2022-11-27 03:35:49 +13:00
Kyle Schouviller
98e3bbb3bd Add patchmatch and infill_method parameter to prompt2image (options are 'patchmatch' or 'tile'). 2022-11-27 03:35:49 +13:00
Kyle Schouviller
b049bbc64e Fix iterative outpainting by restoring original images 2022-11-27 03:35:49 +13:00
Kyle Schouviller
34395ff490 Fixes crashes during iterative outpaint. Still doesn't work correctly though. 2022-11-27 03:35:49 +13:00
psychedelicious
6c7191712f Rebases against development 2022-11-27 03:35:49 +13:00
devops117
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
Lincoln Stein
90cb7a6442 fix behavior when models.yaml missing entirely 2022-11-22 16:56:38 +00:00
Lincoln Stein
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
Lincoln Stein
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
Lincoln Stein
ba9c695463 Merge branch 'development' into fix-model-load-error-reporting 2022-11-22 16:24:00 +00:00
Lincoln Stein
8202f34f38 Merge remote-tracking branch 'origin' into fix-model-load-error-reporting 2022-11-22 16:22:29 +00:00
Lincoln Stein
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
Damian Stewart
1260e28d94 fix typo 2022-11-22 14:21:15 +01:00
devops117
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
devops117
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
devops117
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
Lincoln Stein
8e81425e89 fix outcropping crash when png has no InvokeAI metadata
- Closes #1461
2022-11-21 16:35:00 -05:00
Damian Stewart
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
Damian Stewart
e0581a2c37 when doing --log_tokenization/-t also log parsed prompt 2022-11-21 19:27:44 +01:00
Lincoln Stein
32f538bf3a fix another place where rename() should be replace() 2022-11-21 08:44:26 -05:00
Lincoln Stein
0661256b61 Merge branch 'interactive-configuration' into development 2022-11-20 23:32:28 +00:00
David Burnett
602e35db65 Fix issues with '.' not being consisent when run using web gui. 2022-11-20 18:22:13 -05:00
Lincoln Stein
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
Kevin Turner
150c4a5d2d
fix(args): fix INITFILE spelling 2022-11-19 12:01:02 -08:00
Lincoln Stein
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
JPPhoto
8d3b1582a5 Fixed default to None 2022-11-19 11:50:26 +00:00
Lincoln Stein
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
Lincoln Stein
18ae3949ef fix typo in error message 2022-11-18 20:53:49 +00:00
Lincoln Stein
aa95510444
Merge branch 'development' into create-invokeai-run-directory 2022-11-18 15:27:51 -05:00
Lincoln Stein
f33df25830 address all review comments; needs testing 2022-11-18 15:25:23 -05:00
Lincoln Stein
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
Lincoln Stein
303431be89 move CLI into its own module 2022-11-18 19:35:10 +00:00
Lincoln Stein
3ad598761c support for wheel building; webserver broken 2022-11-18 19:34:28 +00:00
Lincoln Stein
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
Lincoln Stein
9200b26f21
Merge branch 'development' into create-invokeai-run-directory 2022-11-16 23:10:46 -05:00
blessedcoolant
ac8a7ff70b Unpin picklescan req and cleanup 2022-11-16 23:02:35 -05:00
blessedcoolant
2d6e0baa87 Add Model Scanning 2022-11-16 23:02:35 -05:00
JPPhoto
70bd61d616 Fixed opt.embiggen_strength again 2022-11-16 11:55:45 -05:00
JPPhoto
f2a6985c78 Added --embiggen_strength option 2022-11-16 11:55:45 -05:00
Lincoln Stein
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
Lincoln Stein
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
Lincoln Stein
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
Lincoln Stein
274b276133 model paths fixed, codeformer needs attention 2022-11-15 18:39:31 +00:00
Lincoln Stein
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
Lincoln Stein
f04d1bab21 Merge branch 'development' into sync-dev-with-main 2022-11-13 21:51:17 +00:00
Lincoln Stein
23348dcd3f sync dev to main 2022-11-13 13:47:26 +00:00
Damian Stewart
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
blessedcoolant
fd67df9447 Remove gfpgan_dir
+ Update GFPGAN Model Path Defaults
>  Update them to match the new file heirarchy
2022-11-13 00:27:56 +00:00
blessedcoolant
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
Kevin Turner
47e6f94111 refactor(cross_attention_control): type hints and other lint 🚮 2022-11-12 11:25:39 -08:00