- 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.
- 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.
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.
- 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.
- 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
- ldm.generate.Generator() now takes an argument named `max_load_models`.
This is an integer that limits the model cache size. When the cache
reaches the limit, it will start purging older models from cache.
- CLI takes an argument --max_load_models, default to 2. This will keep
one model in GPU and the other in CPU and switch back and forth
quickly.
- To not cache models at all, pass --max_load_models=1
The Args object would crap out when trying to retrieve metadata from
an image file that did not contain InvokeAI-generated metadata, such
as a JPG. This corrects that and returns dummy values (seed of zero,
prompt of '') to avoid downstream breakage.
This was a difficult merge because both PR #1108 and #1243 made
changes to obscure parts of the diffusion code.
- prompt weighting, merging and cross-attention working
- cross-attention does not work with runwayML inpainting
model, but weighting and merging are tested and working
- CLI command parsing code rewritten in order to get embedded
quotes right
- --hires now works with runwayML inpainting
- --embiggen does not work with runwayML and will give an error
- Added an --invert option to invert masks applied to inpainting
- Updated documentation
- change default model back to 1.4
- remove --fnformat from canonicalized dream prompt arguments
(not needed for image reproducibility)
- add -tm to canonicalized dream prompt arguments
(definitely needed for image reproducibility)
Now you can activate the Hugging Face `diffusers` library safety check
for NSFW and other potentially disturbing imagery.
To turn on the safety check, pass --safety_checker at the command
line. For developers, the flag is `safety_checker=True` passed to
ldm.generate.Generate(). Once the safety checker is turned on, it
cannot be turned off unless you reinitialize a new Generate object.
When the safety checker is active, suspect images will be blurred and
a warning icon is added. There is also a warning message printed in
the CLI, but it can be a little hard to see because of its positioning
in the output stream.
There is a slight but noticeable delay when the safety checker runs.
Note that invisible watermarking is *not* currently implemented. The
watermark code distributed by the CompViz distribution uses a library
that does not seem to be able to retrieve the watermarks it creates,
and it does not appear that Hugging Face `diffusers` or other SD
distributions are doing any watermarking.
- code for committing config changes to models.yaml now in module
rather than in invoke script
- model marked "default" is now loaded if model not specified on
command line
- uncache changed models when edited, so that they reload properly
- removed liaon from models.yaml and added stable-diffusion-1.5
On the command line, the new option is --text_mask or -tm.
Example:
```
invoke> a baseball -I /path/to/still_life.png -tm orange
```
This will find the orange fruit in the still life painting and replace
it with an image of a baseball.
- In CLI: the argument is --png_compression <0..9> (-z<0..9>)
- In API, pass `compress_level` to PngWriter.save_image_and_prompt_to_png()
Compression ranges from 0 (no compression) to 9 (maximum compression).
Default value is 6 (as specified by Pillow package).
This addresses an issue first raised in #652.