Ryan Dick
f9af32a6d1
Fix the padding behavior when max-pooling regional IP-Adapter masks to mirror the downscaling behavior of SD and SDXL. Prior to this change, denoising with input latent dimensions that were not evenly divisible by 8 would raise an exception.
2024-04-09 16:50:43 -04:00
Ryan Dick
fba40eb1bd
Fix the padding behavior when max-pooling regional prompt masks to mirror the downscaling behavior of SD and SDXL. Prior to this change, denoising with input latent dimensions that were not evenly divisible by 8 would raise an exception.
2024-04-09 16:50:43 -04:00
Jonathan
80d631118d
Fix field ordering
...
Changed fields to go in w/h x/y order.
2024-04-09 14:17:55 -05:00
Ryan Dick
0c6dd32ece
(minor) Fix IP-Adapter conditional logic in CustomAttnProcessor2_0.
2024-04-09 15:06:51 -04:00
Ryan Dick
0bdbfd4d1d
Add support for IP-Adapter masks.
2024-04-09 15:06:51 -04:00
Ryan Dick
2e27ed5f3d
Pass IP-Adapter scales through the cross_attn_kwargs pathway, since they are the same for all attention layers. This change also helps to prepare for adding IP-Adapter region masks.
2024-04-09 15:06:51 -04:00
Ryan Dick
babdc64b17
(minor) Fix typo in IP-Adapter field description.
2024-04-09 15:06:51 -04:00
Ryan Dick
4a828818da
Remove support for Prompt-to-Prompt cross-attention control (aka .swap()). This feature is not widely used. It does not work with SDXL and is incompatible with IP-Adapter and regional prompting. The implementation is also intertwined with both text embedding and the UNet attention layers, resulting in a high maintenance burden. For all of these reasons, we have decided to drop support.
2024-04-09 10:57:02 -04:00
psychedelicious
fe386252f3
Revert "feat(nodes): add prompt region from image nodes"
...
This reverts commit 3a531c5097
.
2024-04-09 08:12:12 -04:00
Ryan Dick
182810337c
Add utility to_standard_float_mask(...) to convert various mask formats to a standardized format.
2024-04-09 08:12:12 -04:00
Ryan Dick
338bf808d6
Rename MaskField to be a generice TensorField.
2024-04-09 08:12:12 -04:00
Ryan Dick
5b5a4204a1
Fix dimensions of mask produced by ExtractMasksAndPromptsInvocation. Also, added a clearer error message in case the same error is introduced in the future.
2024-04-09 08:12:12 -04:00
Ryan Dick
75ef473748
Pull the upstream changes from diffusers' AttnProcessor2_0 into CustomAttnProcessor2_0. This fixes a bug in CustomAttnProcessor2_0 that was being triggered when peft was not installed. The bug was present in a block of code that was previously copied from diffusers. The bug seems to have been introduced during diffusers' migration to PEFT for their LoRA handling. The upstream bug was fixed in 531e719163
.
2024-04-09 08:12:12 -04:00
psychedelicious
926b8d0efe
feat(nodes): add prompt region from image nodes
2024-04-09 08:12:12 -04:00
Ryan Dick
9d9d1761f3
(minor) The latest ruff version has _slightly_ different formatting preferences.
2024-04-09 08:12:12 -04:00
Ryan Dick
a78df8123f
Update the diffusion logic to use the new regional prompting feature.
2024-04-09 08:12:12 -04:00
Ryan Dick
7ca677578e
Create a UNetAttentionPatcher for patching UNet models with CustomAttnProcessor2_0 modules.
2024-04-09 08:12:12 -04:00
Ryan Dick
31c456c1e6
Update CustomAttention to support both IP-Adapters and regional prompting.
2024-04-09 08:12:12 -04:00
Ryan Dick
2ce79b61f5
Initialize a RegionalPromptAttnProcessor2_0 class by copying AttnProcessor2_0 from diffusers.
2024-04-09 08:12:12 -04:00
Ryan Dick
109e3f0e7f
Add RegionalPromptData class for managing prompt region masks.
2024-04-09 08:12:12 -04:00
Ryan Dick
dc64fec771
Add support for lists of prompt embeddings to be passed to the DenoiseLatents invocation, and add handling of the conditioning region masks in DenoiseLatents.
2024-04-09 08:12:12 -04:00
Ryan Dick
d1e45585d0
Add TextConditioningRegions to the TextConditioningData data structure.
2024-04-09 08:12:12 -04:00
Ryan Dick
aba023e0c5
Improve documentation of conditioning_data.py.
2024-04-09 08:12:12 -04:00
Ryan Dick
e354c29b52
Rename ConditioningData -> TextConditioningData.
2024-04-09 08:12:12 -04:00
Ryan Dick
a7f363e654
Split ip_adapter_conditioning out from ConditioningData.
2024-04-09 08:12:12 -04:00
Ryan Dick
9b2162e564
Remove scheduler_args from ConditioningData structure.
2024-04-09 08:12:12 -04:00
Ryan Dick
4e64b26702
Update compel nodes to accept an optional prompt mask.
2024-04-09 08:12:12 -04:00
Ryan Dick
c22d772062
Add RectangleMaskInvocation.
2024-04-09 08:12:12 -04:00
Ryan Dick
d6be7662c9
Add a MaskField primitive, and add a mask to the ConditioningField primitive type.
2024-04-09 08:12:12 -04:00
blessedcoolant
95050088d1
chore: lint fixes
2024-04-09 14:13:10 +10:00
blessedcoolant
94b5084cd5
fix: one man's max is another man's min
2024-04-09 14:13:10 +10:00
blessedcoolant
ca0d60bee6
fix: set coherence denoise to 0.2 min for refiner models
2024-04-09 14:13:10 +10:00
blessedcoolant
fd1f240853
fix: SDXL Refiner not working properly with Inpainting
2024-04-09 14:13:10 +10:00
blessedcoolant
381b41a56e
fix: Update SDXL Refiner graphs to use Gradient Mask
2024-04-09 14:13:10 +10:00
psychedelicious
b58494c420
feat(ui): add graph-to-workflow debug helper
...
This is intended for debug usage, so it's hidden away in the workflow library `...` menu. Hold shift to see the button for it.
- Paste a graph (from a network request, for example) and then click the convert button to convert it to a workflow.
- Disable auto layout to stack the nodes with an offset (try it out). If you change this, you must re-convert to get the changes.
- Edit the workflow JSON if you need to tweak something before loading it.
2024-04-08 20:38:04 -04:00
fieldOfView
dca30d5462
(feat) add a method to get the path of an image from the invocation context
...
Fixes #6175
2024-04-08 18:42:55 +10:00
psychedelicious
9ab6655491
feat(backend): clean up choose_precision
...
- Allow user-defined precision on MPS.
- Use more explicit logic to handle all possible cases.
- Add comments.
- Remove the app_config args (they were effectively unused, just get the config using the singleton getter util)
2024-04-07 09:41:05 -04:00
psychedelicious
29cfe5a274
fix(ui): handle multipleOf on number fields
...
This data is already in the template but it wasn't ever used.
One big place where this improves UX is the noise node. Previously, the UI let you change width and height in increments of 1, despite the template requiring a multiple of 8. It now works in multiples of 8.
2024-04-06 13:15:20 -04:00
Hosted Weblate
2c45697f3d
translationBot(ui): update translation files
...
Updated by "Cleanup translation files" hook in Weblate.
Co-authored-by: Hosted Weblate <hosted@weblate.org>
Translate-URL: https://hosted.weblate.org/projects/invokeai/web-ui/
Translation: InvokeAI/Web UI
2024-04-06 15:19:20 +11:00
psychedelicious
9a0a90e2a2
chore: v4.0.4
2024-04-06 15:15:16 +11:00
psychedelicious
69f17da1a2
fix(nodes): add WithBoard to public API
2024-04-06 15:02:28 +11:00
psychedelicious
4d0a49298c
tidy(ui): remove extraneous zod schema
2024-04-06 14:54:12 +11:00
psychedelicious
55f7a7737a
feat(ui): shift around init image recall logic
...
Retrieving the DTO happens as part of the metadata parsing, not recall. This way, we don't show the option to recall a nonexistent image.
This matches the flow for other metadata entities like models - we don't show the model recall button if the model isn't available.
2024-04-06 14:54:12 +11:00
Jennifer Player
adc30045a6
addressed pr feedback
2024-04-06 14:54:12 +11:00
Jennifer Player
fdd0e57976
actually use the schema
2024-04-06 14:54:12 +11:00
Jennifer Player
9ba5ec4b67
fix typo Params set set
2024-04-06 14:54:12 +11:00
Jennifer Player
8a17616bf4
recall initial image from metadata and set to image2image
2024-04-06 14:54:12 +11:00
Jennifer Player
f56b9537cd
added initial image to metadata viewer
2024-04-06 14:54:12 +11:00
psychedelicious
4068e817d6
fix(mm): typing issues in model cache
2024-04-06 14:35:36 +11:00
psychedelicious
a09d705e4c
fix(mm): remove vram check
...
This check prematurely reports insufficient VRAM on Windows. See #6106 for details.
2024-04-06 14:35:36 +11:00
blessedcoolant
540d506ec9
fix: Incorrect default clip vision opt in the node
2024-04-05 15:06:33 -04:00
psychedelicious
e330966020
chore: v4.0.3
2024-04-05 15:32:30 +11:00
symant233
b783679b9f
fix: typo, change shouldFitImageSize default value
2024-04-05 15:23:58 +11:00
symant233
d32e557e50
fix: add roundDownToMultiple
2024-04-05 15:23:58 +11:00
symant233
90686c7f9c
feat: Unified Canvas Fit Image Size on Drop
2024-04-05 15:23:58 +11:00
Lincoln Stein
4571986c63
fix misplaced lock call
2024-04-05 14:32:18 +11:00
Jennifer Player
fec989f015
navigate to workflow tab when clicking load workflow
2024-04-05 14:16:33 +11:00
Riccardo Giovanetti
b5c048d8bf
translationBot(ui): update translation (Italian)
...
Currently translated at 98.4% (1108 of 1126 strings)
Co-authored-by: Riccardo Giovanetti <riccardo.giovanetti@gmail.com>
Translate-URL: https://hosted.weblate.org/projects/invokeai/web-ui/it/
Translation: InvokeAI/Web UI
2024-04-05 13:53:42 +11:00
Alexander Eichhorn
577469be55
translationBot(ui): update translation (German)
...
Currently translated at 73.3% (826 of 1126 strings)
Co-authored-by: Alexander Eichhorn <pfannkuchensack@einfach-doof.de>
Translate-URL: https://hosted.weblate.org/projects/invokeai/web-ui/de/
Translation: InvokeAI/Web UI
2024-04-05 13:53:42 +11:00
Lincoln Stein
812f10730f
adjust free vram calculation for models that will be removed by lazy offloading ( #6150 )
...
Co-authored-by: Lincoln Stein <lstein@gmail.com>
2024-04-04 22:51:12 -04:00
psychedelicious
3006285d13
fix(ui): display refiner models in mm
2024-04-05 09:46:03 +11:00
psychedelicious
5d4a571778
feat(ui): disable mosaic infill in graph builders
2024-04-05 08:49:13 +11:00
psychedelicious
90bdd74f30
chore(ui): typegen
2024-04-05 08:49:13 +11:00
psychedelicious
d6ccd5bc81
feat(nodes): disable mosaic fill
...
Needs a bit of tweaking, leaving the code in just disabled/commented it out.
2024-04-05 08:49:13 +11:00
psychedelicious
f0b1bb0327
feat(nodes): redo tile infill
...
The previous algorithm errored if the image wasn't divisible by the tile size. I've reimplemented it from scratch to mitigate this issue.
The new algorithm is simpler. We create a pool of tiles, then use them to create an image composed completely of tiles. If there is any awkwardly sized space on the edge of the image, the tiles are cropped to fit.
Finally, paste the original image over the tile image.
I've added a jupyter notebook to do a smoke test of infilling methods, and 10 test images.
The other infill algorithms can be easily tested with the notebook on the same images, though I didn't set that up yet.
Tested and confirmed this gives results just as good as the earlier infill, though of course they aren't the same due to the change in the algorithm.
2024-04-05 08:49:13 +11:00
psychedelicious
b061db414f
tidy(nodes): abstractmethod is noop
2024-04-05 08:49:13 +11:00
blessedcoolant
e55ab5b3a1
ui: Color Infill UI
2024-04-05 08:49:13 +11:00
blessedcoolant
adb7966bb3
ui: intial mosaic infill ui
...
Need to change color picking.
2024-04-05 08:49:13 +11:00
blessedcoolant
3c195d74a5
fix: bypass edge pixels which cannot transform to tile size
...
Still need to fix this somehow
2024-04-05 08:49:13 +11:00
blessedcoolant
32a6b758cd
wip: Initial Infill Methods Refactor
2024-04-05 08:49:13 +11:00
Jonathan
3659219f46
Fix IdealSizeInvocation ( #6145 )
2024-04-05 08:38:40 +11:00
blessedcoolant
d284e0567a
fix: ip adapter clip selection being broken
2024-04-05 07:49:04 +11:00
psychedelicious
13027891d9
fix(ui): discarding last single canvas image breaks canvas
...
We need to reset the staging area if we are discarding the last image.
2024-04-04 08:00:08 -04:00
psychedelicious
8a32baf2dc
chore: v4.0.2
2024-04-04 15:46:51 +11:00
psychedelicious
8c15d14099
fix: use locale encoding
...
We have had a few bugs with v4 related to file encodings, especially on Windows.
Windows uses its own character encodings instead of `utf-8`, often `cp1252`. Some characters cannot be decoded using `utf-8`, causing `UnicodeDecodeError`.
There are a couple places where this can cause problems:
- In the installer bootstrap, we install or upgrade `pip` and decode the result, using `subprocess`.
The input to this includes the user's home dir. In #6105 , the user had one of the problematic characters in their username. `subprocess` attempts and fails to decode the username, which crashes the installer.
To fix this, we need to use `locale.getpreferredencoding()` when executing the command.
- Similarly, in the model install service and config class, we attempt to load a yaml config file. If a problematic character is in the path to the file (which often includes the user's home dir), we can get the same error.
One example is #6129 in which the models.yaml migration fails.
To fix this, we need to open the file with `locale.getpreferredencoding()`.
2024-04-04 15:30:47 +11:00
psychedelicious
9c51abb46e
fix(config): get root from venv
...
This logic was a bit wonky. It only selected the `venv` parent if there was already an `invokeai.yaml` file in it. Removed this constraint.
2024-04-04 10:54:23 +11:00
psychedelicious
9fdfd4267c
fix(ui): fix model name overflow
...
Closes #3897
2024-04-04 08:03:30 +11:00
psychedelicious
25bbaa73b9
feat(ui): add inplace
option to scan folder install ui
2024-04-04 07:58:11 +11:00
psychedelicious
2383fb93c7
fix(ui): show model install progress as 100 if finished
2024-04-04 07:58:11 +11:00
psychedelicious
63c60e6d63
feat(ui): refresh model scan results on completed model install
2024-04-04 07:58:11 +11:00
psychedelicious
3a10062b53
feat(mm): more reliable mm scan folder
...
Compare the installed paths to determine if the model is already installed. Fixes an issue where installed models showed up as uninstalled or vice-versa. Related to relative vs absolute path handling.
2024-04-04 07:58:11 +11:00
brandonrising
51ca59c088
Update probe to always use cpu for loading models
2024-04-04 07:34:43 +11:00
psychedelicious
7ff2371c07
fix(mm): do not rename model file if model record is renamed
...
Renaming the model file to the model name introduces unnecessary contraints on model names.
For example, a model name can technically be any length, but a model _filename_ cannot be too long.
There are also constraints on valid characters for filenames which shouldn't be applied to model record names.
I believe the old behaviour is a holdover from the old system.
2024-04-04 07:17:38 +11:00
Mary Hipp
4927d1b7c9
add some test IDs for accordion targeting
2024-04-04 06:35:11 +11:00
psychedelicious
85f53f94f8
feat(mm): include needed vs free in OOM
...
Gives us a bit more visibility into these errors, which seem to be popping up more frequently with the new MM.
2024-04-04 06:26:15 +11:00
blessedcoolant
be574cb764
fix: incorrect suffix check in ip adapter checkpoint file
2024-04-03 22:38:28 +05:30
blessedcoolant
5f01de1993
chore: ruff and lint fixes
2024-04-03 20:41:51 +05:30
blessedcoolant
cf88bd3294
Merge branch 'main' into checkpoint-ip-adapter
2024-04-03 20:30:02 +05:30
blessedcoolant
e574815413
chore: clean up merge conflicts
2024-04-03 20:28:00 +05:30
blessedcoolant
fb293dcd84
Merge branch 'checkpoint-ip-adapter' of https://github.com/blessedcoolant/InvokeAI into checkpoint-ip-adapter
2024-04-03 20:23:07 +05:30
blessedcoolant
414851f2f0
fix: raise and present the runtime error from the exception
2024-04-03 20:21:50 +05:30
blessedcoolant
2dcbb7223b
fix: use Path for ip_adapter_ckpt_path instead of str
2024-04-03 20:21:03 +05:30
psychedelicious
132aadca15
fix(ui): cancel batch status button greyed out
...
Closes #6110
2024-04-03 08:23:31 -04:00
blessedcoolant
14a9f74b17
cleanup: use load_file of safetensors directly for loading ip adapters
2024-04-03 12:40:13 +05:30
blessedcoolant
1372ef15b3
fix: Fail when unexpected keys are found in IP Adapter models
2024-04-03 12:40:11 +05:30
blessedcoolant
dc1681a0de
fix: clip vision model auto param
...
Setting to 'auto' works only for InvokeAI config and auto detects the SD model but will override if user explicitly sets it. If auto used with checkpoint models, we raise an error. Checkpoints will always need to set to non-auto.
2024-04-03 12:40:11 +05:30
blessedcoolant
be1212de9a
fix: Raise a better error when incorrect CLIP Vision model is used
2024-04-03 12:40:10 +05:30
blessedcoolant
a14ce0edab
chore: rename IPAdapterDiffusersConfig to IPAdapterInvokeAIConfig
2024-04-03 12:40:10 +05:30
blessedcoolant
4a0dfc3b2d
ui: improve the clip vision model picker layout
2024-04-03 12:40:08 +05:30
blessedcoolant
91a70c8d07
feat: Let users pick CLIP Vision model for Checkpoint IP Adapters
2024-04-03 12:40:05 +05:30