Commit Graph

98 Commits

Author SHA1 Message Date
a3a50bb886 Update generate.py
Fixed spelling mistake (open source king)
2022-10-15 16:02:14 -04:00
8ea07f3bb0 reintroduce fix for m1 from PR#579 missing after merge
Make results reproducible (so runs with the same seed produce the same result).
Implements fix by @wbowling referenced in https://github.com/invoke-ai/InvokeAI/issues/397#issuecomment-1240679294
2022-10-11 21:50:59 +02:00
8faa06fb15 Merge branch 'main' into development
- this syncs documentation and code
2022-10-09 14:47:27 -04:00
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
3d7bc074cf autorotate init images using exif orientation tag 2022-10-07 12:06:50 -04:00
b296933ba0 autorotate init images using exif orientation tag 2022-10-07 12:06:40 -04:00
c1230da3ab remove duplicated code 2022-10-07 08:13:34 -04:00
a7515624b2 remove duplicated code 2022-10-07 08:12:55 -04:00
c6a7be63b8 fix crash in generate._transparency_check_and_warning() 2022-10-06 21:00:27 -04:00
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
5f42d08945 realesrgan inherits precision setting from main program 2022-10-06 12:23:30 -04:00
2154dd2349 prevent crashes due to uninitialized free_gpu_mem 2022-10-06 10:54:05 -04:00
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
a09c64a1fe merge outcropping and postprocessing fixes 2022-10-04 22:47:21 -04:00
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
609983ffa8 add outcrop postprocessor 2022-10-04 22:37:25 -04:00
f041510659 Merge branch 'development' into development 2022-10-03 23:53:19 -04:00
feb405f19a reorder mask creation and scaling to avoid deleting colors under transparency 2022-10-03 23:29:09 -04:00
e79069a957 Merge branch 'development' into development 2022-10-03 08:33:44 -04:00
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
e246e7c8b9 Merge branch 'development' into development 2022-10-01 19:26:46 -04:00
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
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
22b290daad Merge branch 'development' into development 2022-09-30 17:14:34 -04:00
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
d3a4311c3d * Counteract recent bit-rot and churn negatively affecting my PR, as per feedback. 2022-09-28 19:47:36 -04:00
b947290801 Merge branch 'development' into development 2022-09-28 17:35:30 -04:00
6b56d45d85 Merge branch 'development' of github.com:invoke-ai/InvokeAI into development 2022-09-28 15:09:10 -04:00
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
6e4dc229e2 remove dangling debug statement 2022-09-28 14:55:37 -04:00
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
29336387be Merge branch 'development' into development 2022-09-28 08:16:42 -04:00
3491a1688b Merge branch 'development' of github.com:invoke-ai/InvokeAI into development 2022-09-27 18:15:14 -04:00
ac1999929f remove dangling debug statement 2022-09-27 18:13:45 -04:00
be99d5a4bd Merge branch 'development' into development 2022-09-26 09:21:15 -04:00
d80fff70f2 ESRGAN Improvements 2022-09-26 03:28:23 -04:00
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
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
47408bb568 Merge branch 'development' into development 2022-09-24 22:11:18 -04:00
636c356aaf facexlib and codeformer are broken on mps currently, force CPU device. 2022-09-24 21:22:24 +02:00
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
b1d1063a25 Fix CodeFormer not working if GFPGAN is enabeld 2022-09-24 05:19:07 -04:00
16a06ba66e fix typo 2022-09-24 05:00:57 -04:00
6858c14d94 Allow Generate to take images as readers or Image instances 2022-09-24 05:00:57 -04:00
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
880142708d Merge branch 'development' into development 2022-09-23 15:41:06 -04:00
cd8be1d0e9 Restoration Modules are now optional 2022-09-23 10:51:41 +02:00
88e3b6d310 Merge branch 'development' into development 2022-09-21 17:47:14 -04:00
0ab5f2159d fix img2img incorrectly loading previous prompt 2022-09-21 15:18:59 -04:00
60f0090786 Merge branch 'development' into development 2022-09-21 03:10:49 -04:00