Commit Graph

556 Commits

Author SHA1 Message Date
Lincoln Stein
b296933ba0 autorotate init images using exif orientation tag 2022-10-07 12:06:40 -04:00
Jakub Kolčář
70bb7f4a61 fixed perlin noise generation for mps (macos) - fix for cpu fallback 2022-10-07 10:36:45 -04:00
Jakub Kolčář
45cc867b0c fixed perlin noise generation for mps (macos) - fix for cpu fallback 2022-10-07 10:35:42 -04:00
Lincoln Stein
333219be35 fix broken image generation on plms and ddim samplers 2022-10-07 08:26:53 -04:00
spezialspezial
c1230da3ab remove duplicated code 2022-10-07 08:13:34 -04:00
spezialspezial
a7515624b2 remove duplicated code 2022-10-07 08:12:55 -04:00
Lincoln Stein
9f34ddfcea fix crash on len(Nonetype) in k_sampler 2022-10-07 08:05:13 -04:00
Lincoln Stein
c6a7be63b8 fix crash in generate._transparency_check_and_warning() 2022-10-06 21:00:27 -04:00
Lincoln Stein
75165957c9 Revert "realesrgan inherits precision setting from main program"
This reverts commit 5f42d08945.

This fix was intended to solve issue #939, in which ESRGAN generates
dark images when upscaling 4X on certain GTX cards. However, the fix
apparently causes conflicts with some versions of the ESRGAN library,
and this fix will have to wait until after release of 2.0.
2022-10-06 20:52:38 -04:00
Lincoln Stein
d60df54f69 fix k_samplers in img2img - probably correct now 2022-10-06 18:53:54 -04:00
Lincoln Stein
7541c7cf5d fix k_samplers in img2img - probably correct now 2022-10-06 18:31:04 -04:00
Lincoln Stein
440065f7f8 revert previous change 2022-10-06 14:57:06 -04:00
Lincoln Stein
2c27e759cd fix #889 - fuzzy k* img2img at low strength 2022-10-06 14:16:56 -04:00
Lincoln Stein
5f42d08945 realesrgan inherits precision setting from main program 2022-10-06 12:23:30 -04:00
Lincoln Stein
2154dd2349 prevent crashes due to uninitialized free_gpu_mem 2022-10-06 10:54:05 -04:00
Lincoln Stein
f3050fefce bug and warning message fixes
- txt2img2img back to using DDIM as img2img sampler; results produced
  by some k* samplers are just not reliable enough for good user
  experience
- img2img progress message clarifies why img2img steps taken != steps requested
- warn of potential problems when user tries to run img2img on a small init image
2022-10-06 10:39:08 -04:00
Arthur Holstvoogd
595d15455a Fix generation of image with s>1000 2022-10-06 15:49:35 +02:00
Lincoln Stein
183b98384f set perlin & threshold to zero on generator initialization 2022-10-06 09:35:04 -04:00
Lincoln Stein
a99aab6309 enable --hires to use k* samplers 2022-10-05 20:10:21 -04:00
ArDiouscuros
5a40f7ad15 Fix for crashes in txt2img hires fix mode 2022-10-05 20:10:06 -04:00
Lincoln Stein
2f29b78a00 enable --hires to use k* samplers 2022-10-05 17:18:32 -04:00
ArDiouscuros
bcb6e2e506 Fix for crashes in txt2img hires fix mode 2022-10-05 17:13:43 -04:00
Lincoln Stein
44e3995425 remove dangling -V from normalized dream command 2022-10-05 00:48:17 -04:00
Lincoln Stein
5dd9e30c2f Merge branch 'development' of github.com:invoke-ai/InvokeAI into development 2022-10-04 22:58:09 -04:00
Lincoln Stein
f368f682e1 remove unecessary import of pyreadline3 2022-10-04 22:53:07 -04:00
Lincoln Stein
d16f0c8a8f add enhancements to CLI command-line completion and history
- Added support for pyreadline3 so that Window users can benefit.
- Added the !search command to search the history for a matching string:
~~~
!search puppies
[20] puppies at the food bowl -Ak_lms
[54] house overrun by hungry puppies -C20 -s100
~~~
- Added the !clear command to clear the in-memory and on-disk
  command history.
2022-10-04 22:53:07 -04:00
Lincoln Stein
18e667f98e fix miscellaneous regressions:
- embiggen needs to use ddim sampler due to low step count
- --hires_fix option needs to be written to log and command string
- fix call signature of _init_image_mask()
2022-10-04 22:48:19 -04:00
Lincoln Stein
a09c64a1fe merge outcropping and postprocessing fixes 2022-10-04 22:47:21 -04:00
Lincoln Stein
4c482fe24a refactor how postprocessors work
- similar call structures for outpainting, outcropping and face restoration modules
- added documentation for outcropping
- post-processing steps now leave a provenance chain (of sorts) in the sd-metadata field:

~~~
scripts/sd-metadata.py outputs/img-samples/curly.942491079.upscale.png
outputs/img-samples/curly.942491079.upscale.png:
 {
    "model": "stable diffusion",
    "model_id": "stable-diffusion-1.4",
    "model_hash": "fe4efff1e174c627256e44ec2991ba279b3816e364b49f9be2abc0b3ff3f8556",
    "app_id": "lstein/stable-diffusion",
    "app_version": "v1.15",
    "image": {
        "height": 512,
        "width": 512,
        "steps": 50,
        "cfg_scale": 7.5,
        "seed": 942491079,
        "prompt": [
            {
                "prompt": "pretty curly-haired redhead woman",
                "weight": 1.0
            }
        ],
        "postprocessing": [
            {
                "tool": "outcrop",
                "dream_command": "!fix \"test-pictures/curly.png\" -s 50 -S 942491079 -W 512 -H 512 -C 7.5 -A k_lms -c top 64 right 64"
            },
            {
                "tool": "gfpgan",
                "dream_command": "!fix \"outputs/img-samples/curly.942491079.outcrop-02.png\" -s 50 -S 942491079 -W 512 -H 512 -C 7.5 -A k_lms -G 0.8"
            },
            {
                "tool": "upscale",
                "dream_command": "!fix \"outputs/img-samples/curly.942491079.gfpgan.png\" -s 50 -S 942491079 -W 512 -H 512 -C 7.5 -A k_lms -U 4.0 0.75"
            }
        ],
        "sampler": "k_lms",
        "variations": [],
        "type": "txt2img"
    }
}
~~~
2022-10-04 22:37:25 -04:00
Lincoln Stein
609983ffa8 add outcrop postprocessor 2022-10-04 22:37:25 -04:00
Lincoln Stein
0f9bff66bc Merge branch 'development' of github.com:pbaylies/stable-diffusion into pbaylies-development 2022-10-04 22:31:11 -04:00
Peter Baylies
5d911b43c0
Merge branch 'development' into development 2022-10-04 18:40:42 -04:00
Lincoln Stein
483097f31c fix off-by-one error 2022-10-05 00:15:47 +02:00
Lincoln Stein
7a3eae4572 revert to original k* noise schedule 2022-10-05 00:15:47 +02:00
Peter Baylies
db349aa3ce * Fix meshgrid warning for perlin noise. 2022-10-04 16:58:22 -04:00
Peter Baylies
b5c114c5b7 * Changes for PR 2022-10-04 14:37:32 -04:00
Lincoln Stein
f34279b3e7 add perlin options to formatted dream cmd 2022-10-04 14:32:18 -04:00
Peter Baylies
f041510659
Merge branch 'development' into development 2022-10-03 23:53:19 -04:00
Lincoln Stein
feb405f19a reorder mask creation and scaling to avoid deleting colors under transparency 2022-10-03 23:29:09 -04:00
blessedcoolant
b8e4c13746 Add New WebUI and Desktop Mode
Co-Authored-By: psychedelicious <4822129+psychedelicious@users.noreply.github.com>
2022-10-03 23:28:53 -04:00
Lincoln Stein
0a217b5f15 Merge branch 'Any-Winter-4079-Textual_Inversion' of github.com:Any-Winter-4079/InvokeAI into development 2022-10-03 19:43:46 -04:00
psychedelicious
88a9f33422 Fixes #875 2022-10-03 19:42:12 -04:00
Lincoln Stein
ea67040ef1 restore behavior of --grid argument 2022-10-03 17:09:48 -04:00
Peter Baylies
e79069a957
Merge branch 'development' into development 2022-10-03 08:33:44 -04:00
Lincoln Stein
1ab09e7a06 use right value for step arg in img_callback in decode() 2022-10-03 05:47:32 -04:00
Lincoln Stein
7c6dbcb14a use right value for step arg in img_callback 2022-10-03 05:46:23 -04:00
Lincoln Stein
8e97bc24a4 restore step argument to step_callback 2022-10-03 05:38:43 -04:00
ArDiouscuros
935a9d3c75 Update !fetch command, add documentation and autocomplete list
-- !fetch takes second optional argument name of the file to save commands to
2022-10-03 10:38:22 +02:00
Lincoln Stein
5a88be3744 fix typo which caused crash in sampler.py 2022-10-02 22:31:11 -04:00
psychedelicious
8ba5e385ec Fixes #877 2022-10-02 16:55:23 -04:00
Lincoln Stein
a0f4af087c restore use of sampler.decode() in img2img 2022-10-02 14:58:21 -04:00
Lincoln Stein
958d7650dd img2img works with all samplers, inpainting working with ddim & plms
- img2img confirmed working with all samplers
- inpainting working on ddim & plms. Changes to k-diffusion
  module seem to be needed for inpainting support.
- switched k-diffuser noise schedule to original karras schedule,
  which reduces the step number needed for good results
2022-10-02 14:58:21 -04:00
Peter Baylies
e246e7c8b9
Merge branch 'development' into development 2022-10-01 19:26:46 -04:00
Lincoln Stein
1a0cf1320b improve behavior and fix bugs in CLI history handling and completion
-if readline.set_auto_history() is not implemented, as in pyreadline3, will fall
back gracefully to automatic history saving. The only issue with this is that
-!history commands will be recorded in the history.
-!fetch on missing file no longer crashes script
-!history is now one of the autocomplete commands
-.dream_history now stored in output directory rather than ~user directory.

An important limitation of the last feature is that the history is
loaded and saved to the .dream_history file in the --outdir directory
specified at script launch time. It is not swapped around when the
--outdir is changed during the session.
2022-10-01 15:24:04 -04:00
Lincoln Stein
fe28c5fbdc add documentation 2022-10-01 15:21:57 -04:00
ArDiouscuros
a626533cd4 Hi res mode fix duplicates with img2img scaling
Add message about interpolation size

Fix crash if sampler not set to DDIM, change parameter name to hires_fix

Hi res mode fix duplicates with img2img scaling
2022-10-01 11:56:59 +02:00
Peter Baylies
22b290daad
Merge branch 'development' into development 2022-09-30 17:14:34 -04:00
Lincoln Stein
6197f81ba0 improve behavior and fix bugs in CLI history handling and completion
-if readline.set_auto_history() is not implemented, as in pyreadline3, will fall
back gracefully to automatic history saving. The only issue with this is that
-!history commands will be recorded in the history.
-!fetch on missing file no longer crashes script
-!history is now one of the autocomplete commands
-.dream_history now stored in output directory rather than ~user directory.

An important limitation of the last feature is that the history is
loaded and saved to the .dream_history file in the --outdir directory
specified at script launch time. It is not swapped around when the
--outdir is changed during the session.
2022-09-30 16:09:38 -04:00
Peter Baylies
b09491ec45
Merge branch 'development' into development 2022-09-29 17:38:26 -04:00
Lincoln Stein
8c9f2ae705 fix duplicate files created during upscaling/facial reconstruction
- When --save_orig *not* provided during image generation with
  upscaling/face fixing, an extra image file was being created. This
  PR fixes the problem.

- Also generalizes the tab autocomplete for image paths such that
  autocomplete searches the output directory for all path-modifying
  options except for --outdir.
2022-09-29 17:29:04 -04:00
Peter Baylies
d3a4311c3d * Counteract recent bit-rot and churn negatively affecting my PR, as per feedback. 2022-09-28 19:47:36 -04:00
Lincoln Stein
b947290801
Merge branch 'development' into development 2022-09-28 17:35:30 -04:00
Lincoln Stein
6b56d45d85 Merge branch 'development' of github.com:invoke-ai/InvokeAI into development 2022-09-28 15:09:10 -04:00
Lincoln Stein
5f4bca0147 make CLI help text shorter to improve readability 2022-09-28 14:56:52 -04:00
Lincoln Stein
98271a0267 fix crash that occurs in write_log when user interrupts generation with ^C 2022-09-28 14:56:52 -04:00
Lincoln Stein
743342816b add documentation and bug fixes
- normalized how filenames are written out when postprocessing invoked
- various fixes of bugs encountered during testing
- updated documentation
- updated help text
2022-09-28 14:56:51 -04:00
Lincoln Stein
fe00a8c05c implement history viewing & replaying in CLI
- Enhance tab completion functionality
- Each of the switches that read a filepath (e.g. --init_img) will trigger file path completion. The
  -S switch will display a list of recently-used seeds.
- Added new !fetch command to retrieve the metadata from a previously-generated image and populate the
  readline linebuffer with the appropriate editable command to regenerate.
- Added new !history command to display previous commands and reload them for modification.
- The !fetch and !fix commands both autocomplete *and* search automatically through the current
  outdir for files.
- The completer maintains a list of recently used seeds and will try to autocomplete them.
2022-09-28 14:56:27 -04:00
blessedcoolant
acc5199f85 Integrate New WebUI with dream.py 2022-09-28 14:55:37 -04:00
Lincoln Stein
6e4dc229e2 remove dangling debug statement 2022-09-28 14:55:37 -04:00
Lincoln Stein
6e54f504e7
Merge branch 'development' into webui-integration 2022-09-28 14:21:00 -04:00
Lincoln Stein
f93963cd6b make CLI help text shorter to improve readability 2022-09-28 14:20:12 -04:00
Lincoln Stein
e49e83e944 fix crash that occurs in write_log when user interrupts generation with ^C 2022-09-28 14:20:12 -04:00
Lincoln Stein
dff4850a82 add documentation and bug fixes
- normalized how filenames are written out when postprocessing invoked
- various fixes of bugs encountered during testing
- updated documentation
- updated help text
2022-09-28 14:20:12 -04:00
Lincoln Stein
800f9615c2 implement history viewing & replaying in CLI
- Enhance tab completion functionality
- Each of the switches that read a filepath (e.g. --init_img) will trigger file path completion. The
  -S switch will display a list of recently-used seeds.
- Added new !fetch command to retrieve the metadata from a previously-generated image and populate the
  readline linebuffer with the appropriate editable command to regenerate.
- Added new !history command to display previous commands and reload them for modification.
- The !fetch and !fix commands both autocomplete *and* search automatically through the current
  outdir for files.
- The completer maintains a list of recently used seeds and will try to autocomplete them.
2022-09-28 14:20:12 -04:00
Peter Baylies
29336387be
Merge branch 'development' into development 2022-09-28 08:16:42 -04:00
blessedcoolant
af8383c770 Integrate New WebUI with dream.py 2022-09-28 16:06:41 +13:00
Lincoln Stein
3491a1688b Merge branch 'development' of github.com:invoke-ai/InvokeAI into development 2022-09-27 18:15:14 -04:00
Lincoln Stein
ac1999929f remove dangling debug statement 2022-09-27 18:13:45 -04:00
Any-Winter-4079
e19aab4a9b Textual Inversion for M1
Update main.py

Update ddpm.py

Update personalized.py

Update personalized_style.py

Update v1-finetune.yaml

Update environment-mac.yaml

Rename v1-finetune.yaml to v1-m1-finetune.yaml

Create v1-finetune.yaml

Update main.py

Update main.py

Update environment-mac.yaml

Update v1-inference.yaml
2022-09-27 01:39:17 +02:00
Peter Baylies
be99d5a4bd
Merge branch 'development' into development 2022-09-26 09:21:15 -04:00
Lincoln Stein
14616f4178 make metadata retrieval more robust to changes in storage format
- args.py will now attempt to return a metadata-containing Args
  object using the following methods:

1. By looking for the 'sd-metadata' tag in the PNG info
2. By looking from the 'Dream' tag
3. As a last resort, fetch the seed from the filename and assume
   defaults for all other options.
2022-09-26 04:18:23 -04:00
blessedcoolant
d80fff70f2 ESRGAN Improvements 2022-09-26 03:28:23 -04:00
Lincoln Stein
d63897fc39 tweaks to get embiggen to work with new development changes PR #553
- swapped out calls to choose_autocast()
- fixed call to retrieve_png_metadata() so as to recover original prompt

Original author: @travco
2022-09-26 03:25:26 -04:00
Lincoln Stein
fdf6a542bf
Merge branch 'development' into main 2022-09-26 02:26:13 -04:00
ArDiouscuros
485fe67c92 Add workaround low memory crash during image saving
Sample model moved to cpu before processing samples to image
2022-09-26 02:15:51 -04:00
Peter Baylies
47408bb568
Merge branch 'development' into development 2022-09-24 22:11:18 -04:00
David Burnett
636c356aaf facexlib and codeformer are broken on mps currently, force CPU device. 2022-09-24 21:22:24 +02:00
Mihail Dumitrescu
66dac1884b Fix Generate.sample_to_image crash.
Build the base generator in same place and way as other generators to reduce the chance of missed arguments in the future.
Fixes crash with display in-progress images, though note the feature still doesn't work for other reasons.
2022-09-24 05:20:28 -04:00
blessedcoolant
b1d1063a25 Fix CodeFormer not working if GFPGAN is enabeld 2022-09-24 05:19:07 -04:00
Lincoln Stein
0678b24ebb
Merge branch 'development' into fix-empty-prompt-exception 2022-09-24 05:12:57 -04:00
blessedcoolant
53b4c3cc60 Upgrade GFPGAN to Version 1.4 2022-09-24 05:09:45 -04:00
Kyle Lacy
d117d23469 Fix exception when inpainting with DDIM sampler 2022-09-24 05:02:02 -04:00
Lincoln Stein
16a06ba66e fix typo 2022-09-24 05:00:57 -04:00
Kyle Lacy
6858c14d94 Allow Generate to take images as readers or Image instances 2022-09-24 05:00:57 -04:00
Lincoln Stein
bf21a0bf02 fix resizing of inpainting mask
- change image resampling method for mask shrinkage to prevent
  artifacts at edge of mask

Addresses #625
2022-09-24 04:37:34 -04:00
Peter Baylies
880142708d
Merge branch 'development' into development 2022-09-23 15:41:06 -04:00
Lincoln Stein
e69aa94800
Merge branch 'development' into fix-empty-prompt-exception 2022-09-23 13:18:02 +02:00
blessedcoolant
cd8be1d0e9 Restoration Modules are now optional 2022-09-23 10:51:41 +02:00
unknown
413064cf45 Web stub for first_seed argument per b93f04e 2022-09-23 09:38:32 +02:00
Lincoln Stein
40b3d07900
Merge branch 'development' into fix-empty-prompt-exception 2022-09-23 09:36:15 +02:00
Kyle Lacy
5f22a72188
Fix division by zero when using an empty prompt 2022-09-22 17:15:28 -07:00
Peter Baylies
88e3b6d310
Merge branch 'development' into development 2022-09-21 17:47:14 -04:00
Lincoln Stein
0ab5f2159d fix img2img incorrectly loading previous prompt 2022-09-21 15:18:59 -04:00
Lincoln Stein
bdbc76fcd4 Merged two different attempts to create __init__.py 2022-09-21 11:34:53 -04:00
Lincoln Stein
110c4f70df fix module loading errors
1. Add ldm/dream/restoration/__init__.py file that was inadvertently not
   committed earlier.
2. Add '.' to sys.path to address weird mac problem reported in #723
2022-09-21 11:31:15 -04:00
Peter Baylies
883b2b6e62 Merge branch 'development' of https://github.com/pbaylies/stable-diffusion into development 2022-09-21 11:05:34 -04:00
Peter Baylies
9903ce60f0
Merge branch 'development' into development 2022-09-21 11:05:20 -04:00
blessedcoolant
069f91f930 Bug Fix Patch 2022-09-21 10:07:43 -04:00
Peter Baylies
6142cf25cc * Bug fixes 2022-09-21 09:12:32 -04:00
Peter Baylies
60f0090786
Merge branch 'development' into development 2022-09-21 03:10:49 -04:00
Lincoln Stein
2cf294e6de Add outpainting functionality.
- Adapted from PR #489, author Dominic Letz [https://github.com/dominicletz]
- Too many upstream changes to merge, so frankensteined it in.
- Added support for !fix syntax
- Added documentation
2022-09-21 02:44:46 -04:00
Lincoln Stein
b93f04ee38 fix normalized prompt when a variation is generated
- The seed printed needs to be the one generated prior to the
  initial noising operation. To do this, I added a new "first_seed"
  argument to the image callback in dream.py.
- Closes #641
2022-09-21 00:32:29 -04:00
Lincoln Stein
0632a3a2ea remove dangling debugging statement 2022-09-21 00:06:16 -04:00
Lincoln Stein
8731b498c0 fix merge conflicts 2022-09-20 23:55:57 -04:00
Lincoln Stein
f408ef2e6c resolved multiple conflicts between PR #683 and subsequent PRs 2022-09-20 23:41:43 -04:00
Lincoln Stein
283a0d72c7 tweaks to make postprocess fixing work better
- modify strength of embiggen to reduce tiling ghosts
- normalize naming of postprocessed files (could improve more to avoid
name collisions)
- move restoration modules under ldm.dream
2022-09-20 23:38:04 -04:00
Lincoln Stein
cd69d258aa combine PRs #690 and #683 2022-09-20 23:38:03 -04:00
blessedcoolant
1b5013ab72 GFPGAN and Real ESRGAN Implementation Refactor 2022-09-20 23:37:19 -04:00
Lincoln Stein
e8bb39370c add ability to post-process images from the CLI
- supports gfpgan, esrgan, codeformer and embiggen
- To use:
   dream> !fix ./outputs/img-samples/000056.292144555.png -ft gfpgan -U2 -G0.8
   dream> !fix ./outputs/img-samples/000056.292144555.png -ft codeformer -G 0.8
   dream> !fix ./outputs/img-samples/000056.29214455.png  -U4
   dream> !fix ./outputs/img-samples/000056.292144555.png -embiggen 1.5

   The first example invokes gfpgan to fix faces and esrgan to upscale.
   The second example invokes codeformer to fix faces, no upscaling
   The third example uses esrgan to upscale 4X
   The four example runs embiggen to enlarge 1.5X

- This is very preliminary work. There are some anomalies to note:
  1. The syntax is non-obvious. I would prefer something like:
     !fix esrgan,gfpgan
     !fix esrgan
     !fix embiggen,codeformer

     However, this will require refactoring the gfpgan and embiggen
     code.

   2. Images generated using gfpgan, esrgan or codeformer all are named
      "xxxxxx.xxxxxx.postprocessed.png" and the original is saved.
      However, the prefix is a new one that is not related to the
      original.

   3. Images generated using embiggen are named "xxxxx.xxxxxxx.png",
      and once again the prefix is new. I'm not sure whether the
      prefix should be aligned with the original file's prefix or not.
      Probably not, but opinions welcome.
2022-09-20 23:33:20 -04:00
Lincoln Stein
fc61ddab3c
Merge branch 'development' into postprocessing-commands 2022-09-20 18:48:42 -04:00
Peter Baylies
d5209965bc
Merge branch 'development' into development 2022-09-20 17:40:21 -04:00
Mihail Dumitrescu
d176fb07cd Replace --full_precision with --precision that works even if not specified
Allowed values are 'auto', 'float32', 'autocast', 'float16'. If not specified or 'auto' a working precision is automatically selected based on the torch device.
Context: #526
Deprecated --full_precision / -F

Tested on both cuda and cpu by calling scripts/dream.py without arguments and checked the auto configuration worked. With --precision=auto/float32/autocast/float16 it performs as expected, either working or failing with a reasonable error. Also checked Img2Img.
2022-09-20 17:08:00 -04:00
冯不游
e02bfd00a8 create ldm.dream.log 2022-09-20 16:54:50 -04:00
Peter Baylies
90d8f0af73 Merge branch 'development' of https://github.com/lstein/stable-diffusion into development 2022-09-20 16:32:00 -04:00
psychedelicious
5f8f2e63eb Merge remote-tracking branch 'upstream/development' into development 2022-09-20 07:27:32 +10:00
Peter Baylies
8c72da3643 Merge remote-tracking branch 'upstream/development' into development 2022-09-19 15:48:22 -04:00
Lincoln Stein
23af057e5c tweaks to make postprocess fixing work better
- modify strength of embiggen to reduce tiling ghosts
- normalize naming of postprocessed files (could improve more to avoid
name collisions)
- move restoration modules under ldm.dream
2022-09-19 14:54:52 -04:00
Lincoln Stein
c14bdcb8fd combine PRs #690 and #683 2022-09-19 13:59:43 -04:00
Lincoln Stein
f816526d0d add ability to post-process images from the CLI
- supports gfpgan, esrgan, codeformer and embiggen
- To use:
   dream> !fix ./outputs/img-samples/000056.292144555.png -ft gfpgan -U2 -G0.8
   dream> !fix ./outputs/img-samples/000056.292144555.png -ft codeformer -G 0.8
   dream> !fix ./outputs/img-samples/000056.29214455.png  -U4
   dream> !fix ./outputs/img-samples/000056.292144555.png -embiggen 1.5

   The first example invokes gfpgan to fix faces and esrgan to upscale.
   The second example invokes codeformer to fix faces, no upscaling
   The third example uses esrgan to upscale 4X
   The four example runs embiggen to enlarge 1.5X

- This is very preliminary work. There are some anomalies to note:
  1. The syntax is non-obvious. I would prefer something like:
     !fix esrgan,gfpgan
     !fix esrgan
     !fix embiggen,codeformer

     However, this will require refactoring the gfpgan and embiggen
     code.

   2. Images generated using gfpgan, esrgan or codeformer all are named
      "xxxxxx.xxxxxx.postprocessed.png" and the original is saved.
      However, the prefix is a new one that is not related to the
      original.

   3. Images generated using embiggen are named "xxxxx.xxxxxxx.png",
      and once again the prefix is new. I'm not sure whether the
      prefix should be aligned with the original file's prefix or not.
      Probably not, but opinions welcome.
2022-09-19 12:38:14 -04:00
psychedelicious
57577401bd Fixes metadata_loads() #686 2022-09-19 12:33:45 -04:00
Lincoln Stein
58c63fe339 Merge branch 'development' of github.com:psychedelicious/stable-diffusion into psychedelicious-development 2022-09-19 12:27:42 -04:00
blessedcoolant
7b0cbb34d6 GFPGAN and Real ESRGAN Implementation Refactor 2022-09-19 23:38:56 +12:00
Peter Baylies
37c44ced1d
Merge branch 'development' into development 2022-09-19 07:22:03 -04:00
psychedelicious
2a6999d500 Fixes various issues with metadata handling 2022-09-19 17:38:56 +10:00
psychedelicious
682d74754c Fixes metadata_loads() #686 2022-09-18 22:41:39 -04:00
Peter Baylies
dc024845cf
Merge branch 'development' into development 2022-09-18 22:34:00 -04:00
psychedelicious
94ca13c494 Fixes metadata_loads() #686 2022-09-19 12:33:37 +10:00
Bernard Maltais
2743e17588 Fix token display when using -t
Add true weight used for subprompt
2022-09-18 21:25:27 -04:00
psychedelicious
f0b500fba8 Fixes metadata implementation #686 2022-09-18 21:24:29 -04:00
blessedcoolant
aaec6baeca Add .gitkeep to the weights folder 2022-09-18 20:35:05 -04:00
Peter Baylies
3692f223e1
Merge branch 'development' into development 2022-09-18 18:58:04 -04:00
Lincoln Stein
1e8e5245eb CLI writes prompt string metadata in same format as web server 2022-09-18 15:08:56 -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
Peter Baylies
c98ade9b25
Merge branch 'development' into development 2022-09-18 12:35:28 -04:00
Danny Beer
045aa7a9a3
Support color correction for img2img and inpainting (#613)
* Support color correction for img2img and inpainting, avoiding the shift to magenta seen when running images through img2img repeatedly.

* Fix docs for color correction

* add --init_color to prompt reconstruction

* For best results, the --init_color option should point to the *very first* image used in the sequence of img2img operations. Otherwise color correction will skew towards cyan.

Co-authored-by: Lincoln Stein <lincoln.stein@gmail.com>
2022-09-18 09:47:57 -04:00
Peter Baylies
d478a241a8
Merge branch 'development' into development 2022-09-18 09:20:13 -04:00
blessedcoolant
0a4397094e
Negative / Unconditioned Prompts (#661)
Co-Authored-By: rabidcopy <8052832+rabidcopy@users.noreply.github.com>

Co-authored-by: rabidcopy <8052832+rabidcopy@users.noreply.github.com>
2022-09-18 09:08:30 -04:00
Peter Baylies
0b786f61cc
Merge branch 'development' into development 2022-09-18 08:54:22 -04:00
Lincoln Stein
b68cb521ba
restore ability to save files to directories named after prompt (#654) 2022-09-18 08:37:08 -04:00
Peter Baylies
2f93418095
Merge branch 'development' into development 2022-09-17 20:35:48 -04:00