Commit Graph

37 Commits

Author SHA1 Message Date
Lincoln Stein
f26199d377 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:34:22 -04:00
Lincoln Stein
90cd791e76 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:09:57 -04:00
Lincoln Stein
303a2495c7 fix broken url fetch in preload_models.py 2022-10-30 17:43:48 -04:00
Lincoln Stein
fbfffe028f add --no-interactive mode 2022-10-30 00:33:48 -04:00
Lincoln Stein
19b6c671a6 further improvements to preload_models script
- User can choose to download just recommended models, customize list to download,
  or skip downloading altogether.
- Does direct download to models directory instead of to HuggingFace cache
- Able to resume interrupted downloads
2022-10-30 00:17:05 -04:00
Lincoln Stein
b532e6dd17 wording and formatting tweaks 2022-10-29 11:28:17 -04:00
Lincoln Stein
3caa95ced9 add more step-by-step documentation and links 2022-10-29 09:18:48 -04:00
Lincoln Stein
ef68a419f1 preload_models.py script downloads the weight files
- user can select which weight files to download using huggingface cache
- user must log in to huggingface, generate an access token, and accept
  license terms the very first time this is run. After that, everything
  works automatically.
- added placeholder for docs for installing models
- also got rid of unused config files. hopefully they weren't needed
  for textual inversion, but I don't think so.
2022-10-29 01:02:45 -04:00
Lincoln Stein
b159b2fe42 add support for safety checker (NSFW filter)
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.
2022-10-23 22:26:18 -04:00
psychedelicious
899ba975a6 Improves logic to determine if clipseg weights should be downloaded 2022-10-20 06:56:50 -04:00
psychedelicious
bfa65560eb Fixes torch.load() for MPS/CPU 2022-10-20 06:56:50 -04:00
psychedelicious
ed9307f469 Fix typo 2022-10-20 06:56:50 -04:00
Lincoln Stein
2ca4242f5f fix clipseg loading problems
- The directory "models" in the main InvokeAI directory was conflicting
  with loading "models.clipseg". To fix this issue, I have renamed the
  models.clipseg to clipseg_models.clipseg, and applied this change to
  the 'models-rename' branch of invoke-ai's fork of clipseg.
2022-10-20 06:56:50 -04:00
Lincoln Stein
62dd3b7d7d resolve models.clipseg vs clipseg ambiguity 2022-10-18 23:09:26 -04:00
Lincoln Stein
66f6ef1b35
fix syntax errors in preload 2022-10-18 19:25:18 -04:00
Lincoln Stein
a488b14373 prevent preload warning message 2022-10-18 17:09:17 -04:00
Lincoln Stein
32122e0312 clipseg library and environment in place 2022-10-18 08:27:48 -04:00
Lincoln Stein
2b1aaf4ee7 rename all modules from ldm.dream to ldm.invoke
- scripts and documentation updated to match
- ran preflight checks on both web and CLI and seems to be working
2022-10-08 11:37:23 -04:00
Lincoln Stein
4d5b208601 multiple fixes in response to preflight testing bug reports
- updated environment-mac.yml #932
- use the upstream GFPGAN library now that issues with color-changing fixed
  and facial recognition improved #905
- preload_models fixed to download additional models needed by gfpgan
2022-10-05 12:44:16 -04:00
Lincoln Stein
488890e6bb preload script more robust for downloading gfpgan 2022-10-05 11:29:48 -04:00
blessedcoolant
d80fff70f2 ESRGAN Improvements 2022-09-26 03:28:23 -04:00
blessedcoolant
53b4c3cc60 Upgrade GFPGAN to Version 1.4 2022-09-24 05:09:45 -04:00
Lincoln Stein
cd69d258aa combine PRs #690 and #683 2022-09-20 23:38:03 -04:00
Joseph Dries III
27b238999f Use model_url instead of model_path for gfpgan and CodeFormer. Fixes lstein/stable-diffusion#678 2022-09-20 07:15:54 -04:00
blessedcoolant
f3292a6953
Implement CodeFormer Face Restoration (#669)
* Implement CodeFormer Face Restoration

* fix codeformer model destination path

Co-authored-by: Lincoln Stein <lincoln.stein@gmail.com>
2022-09-18 15:01:05 -04:00
Lincoln Stein
062f3e8f31
Gfpgan download fix (#655)
* restore ability to save files to directories named after prompt

* don't download gfpgan model file if it exists

- Fixes #647
2022-09-18 14:42:43 -04:00
Lincoln Stein
31daf1f0d7 preload_models.py now downloads gfpgan model 2022-09-17 01:32:31 -04:00
blessedcoolant
6e49c070bb Optimize and Improve GFPGAN and Real-ESRGAN Pipeline 2022-08-29 08:14:29 +12:00
Lincoln Stein
4f02b72c9c prettified all the code using "blue" at the urging of @tildebyte 2022-08-26 03:15:42 -04:00
Lincoln Stein
8f89a2456a something is not quite right; when providing -G1 option on one prompt, and then omitting it on the next, I see a "images do not match" error from GFPGAN 2022-08-26 01:20:01 -04:00
Lincoln Stein
3393b8cad1 added assertion checks for out-of-bound arguments; added various copyright and license agreement files 2022-08-24 09:22:27 -04:00
Lincoln Stein
a20827697c adjusted instructions for the released stable-diffusion-v1 weights 2022-08-22 15:33:27 -04:00
Lincoln Stein
63989ce6ff tidied up scripts directory by moving the original CompViz scripts into a subfolder 2022-08-22 10:11:54 -04:00
Lincoln Stein
78aba5b770 preparing for merge into main 2022-08-21 19:57:48 -04:00
Lincoln Stein
0cea751476 remove shebang line from scripts; suspected culprit in Windows "module ldm.simplet2i not found" error 2022-08-19 06:33:42 -04:00
Lincoln Stein
831bbd7a54 improved error reporting when a missing online dependency can't be downloaded 2022-08-17 18:06:30 -04:00
Lincoln Stein
a7532b386a simplified instructions to preload Bert and kornia prerequisites; fixed --grid and --batch handling; added timing information after image generation 2022-08-17 12:00:00 -04:00