Commit Graph

1162 Commits

Author SHA1 Message Date
psychedelicious
1b70bd1380 fix(stats): fix InvocationStatsService types
- move docstrings to ABC
- `start_time: int` -> `start_time: float`
- remove class attribute assignments in `StatsContext`
- add `update_mem_stats()` to ABC
- add class attributes to ABC, because they are referenced in instances of the class. if they should not be on the ABC, then maybe there needs to be some restructuring
2023-08-18 21:35:03 +10:00
psychedelicious
d1d2d5a47d fix(stats): fix fail case when previous graph is invalid
When retrieving a graph, it is parsed through pydantic. It is possible that this graph is invalid, and an error is thrown.

Handle this by deleting the failed graph from the stats if this occurs.
2023-08-18 21:34:55 +10:00
Millun Atluri
3798c8bdb0
Merge branch 'main' into feat_compel_and 2023-08-18 17:04:03 +10:00
psychedelicious
c49851e027 chore: minor cleanup after merge & flake8 2023-08-18 16:05:39 +10:00
psychedelicious
3c43594c26 Merge branch 'main' into fix/inpaint_gen 2023-08-18 15:57:48 +10:00
Martin Kristiansen
537ae2f901 Resolving merge conflicts for flake8 2023-08-18 15:52:04 +10:00
Kevin Turner
8611ffe32d feat(TAESD): support TAESD — Tiny Autoencoder for Stable Diffusion 2023-08-17 20:08:53 -07:00
Kevin Turner
654dcd453f feat(dev_reload): use jurigged to hot reload changes to Python source 2023-08-17 19:02:44 -07:00
Sergey Borisov
cfd827cfad Added node for creating mask inpaint 2023-08-18 04:07:40 +03:00
Lincoln Stein
4570702dd0 hotfix for crashing api 2023-08-17 20:17:10 -04:00
Lincoln Stein
1d107f30e5 remove getLogger() completely 2023-08-17 19:17:38 -04:00
Lincoln Stein
e9a294f733
Merge branch 'main' into fix/inpaint_gen 2023-08-17 16:13:33 -04:00
Lincoln Stein
b69f26c85c add support for "balanced" attention slice size 2023-08-17 16:11:09 -04:00
Lincoln Stein
23b4e1cea0
Merge branch 'main' into refactor/rename-performance-options 2023-08-17 14:43:00 -04:00
Lincoln Stein
635a814dfb fix up documentation 2023-08-17 14:32:05 -04:00
Lincoln Stein
c19835c2d0 wired attention configuration into backend 2023-08-17 14:20:45 -04:00
Lincoln Stein
ed38eaa10c refactor InvokeAIAppConfig 2023-08-17 13:47:26 -04:00
blessedcoolant
b213335316 feat: Add InpaintMask Field type 2023-08-18 04:54:23 +12:00
Sergey Borisov
ff5c725586 Update mask field type 2023-08-17 19:35:03 +03:00
Sergey Borisov
bf0dfcac2f Add inapint mask field class 2023-08-17 19:19:07 +03:00
Lincoln Stein
503e3bca54 revise config but need to migrate old format to new 2023-08-16 23:30:00 -04:00
Lincoln Stein
daf75a1361 blackify 2023-08-16 21:47:29 -04:00
Lincoln Stein
c39f8b478b fix misplaced ram_used and ram_changed attributes 2023-08-16 21:39:18 -04:00
Lincoln Stein
2ca8611723 add +/- sign in front of RAM delta 2023-08-16 15:53:01 -04:00
Lincoln Stein
b12cf315a8
Merge branch 'main' into feat/collect-more-stats 2023-08-16 09:19:33 -04:00
psychedelicious
43b30355e4 feat: make primitive node titles consistent 2023-08-16 23:04:36 +10:00
Lincoln Stein
a93bd01353 fix bad merge 2023-08-16 08:53:07 -04:00
Lincoln Stein
be8edaf3fd
Merge branch 'main' into feat/collect-more-stats 2023-08-16 08:48:14 -04:00
Lincoln Stein
21e1c0a5f0 tweaked formatting 2023-08-15 22:25:30 -04:00
psychedelicious
8b1ec2685f chore: black 2023-08-16 12:07:34 +10:00
psychedelicious
60c2c877d7 fix: add response model for star/unstar routes
- also implement pessimistic updates for starring, only changing the images that were successfully updated by backend
- some autoformat changes crept in
2023-08-16 12:07:34 +10:00
maryhipp
80b0c5eab4 change from pin to star 2023-08-16 12:07:34 +10:00
maryhipp
ee6a26a97d update list images endpoint to sort by pinnedness and then created_at 2023-08-16 12:07:34 +10:00
maryhipp
04a9894e77 (api) add ability to pin and unpin images 2023-08-16 12:07:34 +10:00
Lincoln Stein
f9958de6be added memory used to load models 2023-08-15 21:56:19 -04:00
Lincoln Stein
ec10aca91e report RAM and RAM cache statistics 2023-08-15 21:00:30 -04:00
psychedelicious
2b7dd3e236 feat: add missing primitive collections
- add missing primitive collections
- remove `Seed` and `LoRAField` (they don't exist)
2023-08-16 09:54:38 +10:00
psychedelicious
fa884134d9 feat: rename ui_type_hint to ui_type
Just a bit more succinct while not losing any clarity.
2023-08-16 09:54:38 +10:00
psychedelicious
c48fd9c083 feat(nodes): refactor parameter/primitive nodes
Refine concept of "parameter" nodes to "primitives":
- integer
- float
- string
- boolean
- image
- latents
- conditioning
- color

Each primitive has:
- A field definition, if it is not already python primitive value. The field is how this primitive value is passed between nodes. Collections are lists of the field in node definitions. ex: `ImageField` & `list[ImageField]`
- A single output class. ex: `ImageOutput`
- A collection output class. ex: `ImageCollectionOutput`
- A node, which functions to load or pass on the primitive value. ex: `ImageInvocation` (in this case, `ImageInvocation` replaces `LoadImage`)

Plus a number of related changes:
- Reorganize these into `primitives.py`
- Update all nodes and logic to use primitives
- Consolidate "prompt" outputs into "string" & "mask" into "image" (there's no reason for these to be different, the function identically)
- Update default graphs & tests
- Regen frontend types & minor frontend tidy related to changes
2023-08-16 09:54:38 +10:00
psychedelicious
f49fc7fb55 feat: node editor
squashed rebase on main after backendd refactor
2023-08-16 09:54:38 +10:00
Lincoln Stein
a4b029d03c write RAM usage and change after each generation 2023-08-15 18:21:31 -04:00
psychedelicious
9d3cd85bdd chore: black 2023-08-14 13:02:33 +10:00
Sergey Borisov
409e5d01ba Fix cpu_only schedulers(unipc) 2023-08-14 05:14:05 +03:00
Sergey Borisov
d63bb39475 Make dpmpp_sde(_k) use not random seed 2023-08-14 00:24:38 +03:00
Sergey Borisov
59ba9fc0f6 Flip bits in seed for sde/ancestral schedulers to have different noise from initial 2023-08-13 19:50:16 +03:00
Sergey Borisov
6e0beb1ed4 Fixes for second order scheduler timesteps 2023-08-13 19:31:47 +03:00
Sergey Borisov
94636ddb03 Fix empty prompt handling 2023-08-13 19:31:14 +03:00
blessedcoolant
499e89d6f6 feat: Add SDXL Negative Aesthetic Score 2023-08-14 04:02:36 +12:00
blessedcoolant
561951ad98 chore: Black linting 2023-08-13 21:28:39 +12:00
blessedcoolant
f296e5c41e wip: Remove MaskBlur / Adjust color correction 2023-08-12 20:54:30 +12:00
blessedcoolant
6034fa12de feat: Add Mask Blur node 2023-08-12 16:20:58 +12:00
Sergey Borisov
ce3675fc14 Apply denoising_start/end according on timestep value 2023-08-12 03:19:49 +03:00
blessedcoolant
f343ab0302 wip: Port Outpainting to new backend 2023-08-12 06:15:59 +12:00
Sergey Borisov
f3ae52ff97 Fix error at high denoising_start, fix unipc(cpu_only) 2023-08-11 15:46:16 +03:00
blessedcoolant
87ce4ab27c fix: Update default_graph to use new DenoiseLatents 2023-08-11 22:21:13 +12:00
blessedcoolant
7c0023ad9e feat: Remove TextToLatents / Rename Latents To Latents -> DenoiseLatents 2023-08-11 22:20:37 +12:00
blessedcoolant
231e665675 Merge branch 'main' into feat/refactor_generation_backend 2023-08-11 20:53:38 +12:00
Sergey Borisov
2ef6a8995b Temporary force set vae to same precision as unet 2023-08-10 18:01:58 -04:00
Lincoln Stein
a969707e45 prevent vae: '' from crashing model 2023-08-10 17:33:04 -04:00
psychedelicious
49cce1eec6 feat: add app_version to image metadata 2023-08-10 14:22:39 +10:00
Sergey Borisov
e9ec5ab85c Apply requested changes
Co-Authored-By: psychedelicious <4822129+psychedelicious@users.noreply.github.com>
2023-08-10 06:19:22 +03:00
Sergey Borisov
17fed1c870 Fix merge conflict errors 2023-08-10 05:03:33 +03:00
Sergey Borisov
ade78b9591 Merge branch 'main' into feat/refactor_generation_backend 2023-08-10 04:32:16 +03:00
Martin Kristiansen
c8fbaf54b6 Add self.min, not self.max 2023-08-10 09:59:22 +10:00
Lincoln Stein
cd2c688562
Merge branch 'main' into refactor/remove_unused_pipeline_methods 2023-08-09 17:26:09 -04:00
Sergey Borisov
e98f7eda2e Fix total_steps in generation event, order field added 2023-08-09 03:34:25 +03:00
Sergey Borisov
b4a74f6523 Add MaskEdge and ColorCorrect nodes
Co-Authored-By: Kent Keirsey <31807370+hipsterusername@users.noreply.github.com>
2023-08-08 23:57:02 +03:00
Sergey Borisov
f7aec3b934 Move conditioning class to backend 2023-08-08 23:33:52 +03:00
Lincoln Stein
4d5169e16d
Merge branch 'main' into feat/select-vram-in-config 2023-08-08 13:50:02 -04:00
Sergey Borisov
a7e44678fb Remove legacy/unused code 2023-08-08 20:49:01 +03:00
Sergey Borisov
da0184a786 Invert mask, fix l2l on no mask conntected, remove zeroing latents on zero start 2023-08-08 20:01:49 +03:00
Sergey Borisov
96b7248051 Add mask to l2l 2023-08-08 18:50:36 +03:00
Lincoln Stein
e77400ab62 remove deprecated options from config 2023-08-08 08:33:30 -07:00
Lincoln Stein
a9bf387e5e turned on Pydantic validate_assignment 2023-08-08 08:33:30 -07:00
Sergey Borisov
5f29526a8e Add seed to latents field 2023-08-08 04:00:33 +03:00
Sergey Borisov
492bfe002a Remove sdxl t2l/l2l nodes 2023-08-08 03:38:42 +03:00
Kevin Turner
809705c30d api(images): allow HEAD request on image/full 2023-08-07 15:11:47 -07:00
Kevin Turner
25c669b1d6 Merge remote-tracking branch 'origin/main' into refactor/remove_unused_pipeline_methods 2023-08-07 13:03:10 -07:00
Lincoln Stein
0fd13d3604
Merge branch 'main' into feat/select-vram-in-config 2023-08-07 15:51:59 -04:00
Sergey Borisov
1db2c93f75 Fix preview, inpaint 2023-08-07 21:27:32 +03:00
Sergey Borisov
2539e26c18 Apply denoising_start/end, add torch-sdp to memory effictiend attention func 2023-08-07 19:57:11 +03:00
Sergey Borisov
b0738b7f70 Fixes, zero tensor for empty negative prompt, remove raw prompt node 2023-08-07 18:37:06 +03:00
Jonathan
ae17d01e1d
Fix hue adjustment (#4182)
* Fix hue adjustment

Hue adjustment wasn't working correctly because color channels got swapped. This has now been fixed and we're using PIL rather than cv2 to do the RGBA->HSV->RGBA conversion. The range of hue adjustment is also the more typical 0..360 degrees.
2023-08-06 23:23:51 +00:00
Kevin Turner
6487e7d906 refactor(diffusers_pipeline): remove unused ModelGroup 🚮
orphaned since #3550 removed the LazilyLoadedModelGroup code, probably unused since ModelCache took over responsibility for sequential offload somewhere around #3335.
2023-08-05 21:50:52 -07:00
Kevin Turner
77033eabd3 refactor(diffusers_pipeline): remove unused precision 🚮 2023-08-05 21:50:52 -07:00
psychedelicious
d09dfc3e9b fix(api): use db_location instead of db_path_string
This may just be the SQLite memory sentinel value.
2023-08-06 14:09:04 +10:00
psychedelicious
66f524cae7 fix(mm): fix a lot of typing issues
Most fixes are just things being typed as `str` but having default values of `None`, but there are some minor logic changes.
2023-08-06 14:09:04 +10:00
psychedelicious
9ba50130a1 fix(api): fix db location types
The services all want strings instead of `Path`s; create variable for the string representation of the path provided by the config services.
2023-08-06 14:09:04 +10:00
psychedelicious
d4cf2d2666 fix(api): fix ApiDependencies.invoker types
ApiDependencies.invoker` provides typing for the API's services layer. Marking it `Optional` results in all the routes seeing it as optional, which is not good.

Instead of marking it optional to satisfy the initial assignment to `None`, we can just skip the initial assignment. This preserves the IDE hinting in API layer and is types-legal.
2023-08-06 14:09:04 +10:00
Sergey Borisov
9aaf67c5b4 wip 2023-08-06 05:05:25 +03:00
psychedelicious
b8b589c150 fix(nodes): fix hsl nodes rebase conflict 2023-08-06 09:57:49 +10:00
Kent Keirsey
d93900a8de Added HSL Nodes 2023-08-06 09:57:49 +10:00
Jonathan
dc96a3e79d Fix random number generator
Passing in seed=0 is not equivalent to seed=None. The latter will get a new seed from entropy in the OS, and that's what we should be using.
2023-08-06 00:29:08 +10:00
psychedelicious
da96a41103
Merge branch 'main' into feat/select-vram-in-config 2023-08-05 12:11:50 +10:00
Damian Stewart
23497bf759 add --ignore_missing_core_models CLI flag to bypass checking for missing core models 2023-08-05 12:05:24 +10:00
Lincoln Stein
6ad565d84c folded in changes from 4099 2023-08-04 18:24:47 -04:00
Sergey Borisov
04229082d6 Provide ti name from model manager, not from ti itself 2023-08-04 18:24:47 -04:00
StAlKeR7779
0d3c27f46c Fix typo
Co-authored-by: Ryan Dick <ryanjdick3@gmail.com>
2023-08-04 11:44:56 -04:00
Sergey Borisov
cff91f06d3 Add lora apply in sdxl l2l node 2023-08-04 11:44:56 -04:00
Lincoln Stein
1d5d187ba1 model probe detects sdxl lora models 2023-08-04 11:44:56 -04:00
Sergey Borisov
1ac14a1e43 add sdxl lora support 2023-08-04 11:44:56 -04:00
Lincoln Stein
0a0b7141af
Merge branch 'main' into feat/execution-stats 2023-08-03 19:49:00 -04:00
Lincoln Stein
1deca89fde
Merge branch 'main' into feat/select-vram-in-config 2023-08-03 19:27:58 -04:00
Lincoln Stein
06742faca7 Merge branch 'feat/execution-stats' of github.com:invoke-ai/InvokeAI into feat/execution-stats 2023-08-03 08:48:05 -04:00
Lincoln Stein
d2bddf7f91 tweak formatting to accommodate longer runtimes 2023-08-03 08:47:56 -04:00
psychedelicious
bf94412d14 feat: add multi-select to gallery
multi-select actions include:
- drag to board to move all to that board
- right click to add all to board or delete all

backend changes:
- add routes for changing board for list of image names, deleting list of images
- change image-specific routes to `images/i/{image_name}` to not clobber other routes (like `images/upload`, `images/delete`)
- subclass pydantic `BaseModel` as `BaseModelExcludeNull`, which excludes null values when calling `dict()` on the model. this fixes inconsistent types related to JSON parsing null values into `null` instead of `undefined`
- remove `board_id` from `remove_image_from_board`

frontend changes:
- multi-selection stuff uses `ImageDTO[]` as payloads, for dnd and other mutations. this gives us access to image `board_id`s when hitting routes, and enables efficient cache updates.
- consolidate change board and delete image modals to handle single and multiples
- board totals are now re-fetched on mutation and not kept in sync manually - was way too tedious to do this
- fixed warning about nested `<p>` elements
- closes #4088 , need to handle case when `autoAddBoardId` is `"none"`
- add option to show gallery image delete button on every gallery image

frontend refactors/organisation:
- make typegen script js instead of ts
- enable `noUncheckedIndexedAccess` to help avoid bugs when indexing into arrays, many small changes needed to satisfy TS after this
- move all image-related endpoints into `endpoints/images.ts`, its a big file now, but this fixes a number of circular dependency issues that were otherwise felt impossible to resolve
2023-08-03 11:46:59 +10:00
psychedelicious
cf72eba15c
Merge branch 'main' into feat/execution-stats 2023-08-03 10:53:25 +10:00
psychedelicious
a6f9396a30 fix(db): retrieve metadata even when no session_id
this was unnecessarily skipped if there was no `session_id`.
2023-08-03 10:43:44 +10:00
Lincoln Stein
921ccad04d added stats service to the cli_app startup 2023-08-02 18:41:43 -04:00
Lincoln Stein
008362918e
Merge branch 'main' into feat/execution-stats 2023-08-02 18:15:51 -04:00
Lincoln Stein
8fc75a71ee integrate correctly into app API and add features
- Create abstract base class InvocationStatsServiceBase
- Store InvocationStatsService in the InvocationServices object
- Collect and report stats on simultaneous graph execution
  independently for each graph id
- Track VRAM usage for each node
- Handle cancellations and other exceptions gracefully
2023-08-02 18:10:52 -04:00
Lincoln Stein
ec48779080 blackify 2023-08-02 14:28:19 -04:00
Lincoln Stein
bc20fe4cb5 Merge branch 'main' into feat/select-vram-in-config 2023-08-02 14:27:17 -04:00
Lincoln Stein
5de42be4a6 reduce VRAM cache default; take max RAM from system 2023-08-02 14:27:13 -04:00
Lincoln Stein
29ac252501 blackify 2023-08-02 09:44:06 -04:00
Lincoln Stein
880727436c fix default vram cache size calculation 2023-08-02 09:43:52 -04:00
Lincoln Stein
8a4e5f73aa reset stats on exception 2023-08-01 19:39:42 -04:00
Lincoln Stein
fd7b842419 add execution stat reporting after each invocation 2023-08-01 17:44:09 -04:00
Lincoln Stein
e7d9e552a7
Merge branch 'main' into feat_compel_and 2023-08-01 07:20:25 -04:00
Lincoln Stein
55d3f04476 additional refactoring 2023-07-31 22:36:11 -04:00
Lincoln Stein
72ebe2ce68 refactor root directory detection to be cleaner 2023-07-31 22:30:06 -04:00
Lincoln Stein
7cd8b2f207 Refactor root detection code 2023-07-31 21:15:44 -04:00
Kent Keirsey
746afcd235
Merge branch 'main' into feat/onnx 2023-07-31 16:56:34 -04:00
Brandon Rising
f5ac73b091 Merge branch 'main' into feat/onnx 2023-07-31 10:58:40 -04:00
psychedelicious
2c07f54b6e
Merge branch 'main' into fix-optional 2023-07-31 16:31:01 +10:00
Lincoln Stein
2164da8592 blackify 2023-07-30 16:25:06 -04:00
Lincoln Stein
4121c261a0 fix missing models when INVOKEAI_ROOT="." 2023-07-30 13:37:18 -04:00
Alexandre Macabies
50e00feceb Add missing Optional on a few nullable fields. 2023-07-30 16:25:12 +02:00
Damian Stewart
d2c55dc011 enable .and() syntax and long prompts 2023-07-30 14:20:59 +02:00
Lincoln Stein
982a568349 blackify pr 2023-07-29 10:47:55 -04:00
Lincoln Stein
9968ff2893 fix relative model paths to be against config.models_path, not root 2023-07-29 10:30:27 -04:00
blessedcoolant
bee678fdd1 fix: Prompt Node using incorrect output type 2023-07-29 17:12:25 +12:00
blessedcoolant
aae1670080 fix: Incorrect Prompt Node output type 2023-07-29 16:04:19 +12:00
blessedcoolant
8a0e1b6cfc feat: Create Prompt Input Node 2023-07-29 15:52:37 +12:00
Brandon Rising
6ca0c38ee3 Merge branch 'main' into feat/onnx 2023-07-28 22:06:28 -04:00
ZachNagengast
2164674b01 Black format 2023-07-28 07:49:29 -07:00
Lincoln Stein
e342ca872f fix to work on non-MPS systems 2023-07-28 10:27:49 -04:00
Brandon Rising
da751da3dd Merge branch 'main' into feat/onnx 2023-07-28 09:59:35 -04:00
Brandon Rising
2b7b3dd4ba Run python black 2023-07-28 09:46:44 -04:00
ZachNagengast
ddaf753f7b Merge branch 'set-timestep-mps-fix' of ssh://github.com/ZachNagengast/InvokeAI into set-timestep-mps-fix 2023-07-27 23:40:44 -07:00
ZachNagengast
e6d14c708c Fix variable name 2023-07-27 23:40:23 -07:00
Millun Atluri
7f81a95b20
Merge branch 'main' into set-timestep-mps-fix 2023-07-28 16:12:07 +10:00
psychedelicious
9affdbbaad chore: black 2023-07-28 11:38:52 +10:00
ZachNagengast
aa1f827271 Fix unet_info location, can have no device prop 2023-07-27 14:47:09 -07:00
ZachNagengast
6edeb4e072 Pass device to set_timestep to avoid float64 error 2023-07-27 12:52:18 -07:00
Lincoln Stein
4a30773d09 Merge branch 'main' into feat/unify-logging 2023-07-27 15:25:56 -04:00
Brandon Rising
1ea9ba84f5 Release session if applying ti or lora 2023-07-27 15:20:38 -04:00
Lincoln Stein
64bd11541a Merge branch 'main' into feat/unify-logging 2023-07-27 15:20:07 -04:00
Lincoln Stein
0d8f9cbe55 resolved conflicts with main 2023-07-27 15:11:25 -04:00
Lincoln Stein
fd75a1dd10 reformat with black 2023-07-27 15:01:00 -04:00
Lincoln Stein
8023a23cec beat uvicorn access log into submission 2023-07-27 12:05:17 -04:00
Lincoln Stein
e4c0102b3c unified uvicorn access log entries too 2023-07-27 11:59:29 -04:00
Lincoln Stein
c4a2808a4b use same logging infrastructure for uvicorn and backend 2023-07-27 11:24:07 -04:00
Brandon Rising
59716938bf Remove TensorRT support at the current time until we validate it works, remove time step recorder 2023-07-27 11:18:50 -04:00
Martin Kristiansen
218b6d0546 Apply black 2023-07-27 10:54:01 -04:00
Brandon Rising
f7bb4c3f05 Remove more files no longer needed in main 2023-07-27 10:49:43 -04:00
Brandon Rising
c16da75ac7 Merge branch 'main' into feat/onnx 2023-07-26 10:42:31 -04:00
Lincoln Stein
4bea846199
Merge branch 'main' into feat/safety-checker-node 2023-07-26 10:04:23 -04:00
Lincoln Stein
b8f43f444a implemented startup sanity checks on core models 2023-07-26 08:26:29 -04:00
Lincoln Stein
3e206d4d6a removed nsfw/watermark from invokeai.yaml 2023-07-26 06:53:35 -04:00
Lincoln Stein
2c5b539d3a esrgan and its models are now nested in app config route 2023-07-26 15:27:04 +10:00
Lincoln Stein
85ad5ef204 refactored code; added watermark and nsfw facilities to app config route 2023-07-26 15:27:04 +10:00
Lincoln Stein
5beb11f4e2 tweaks in response to psychedelicious review of PR 2023-07-26 15:27:04 +10:00
Lincoln Stein
bd43751323 update linear graphs to perform safety checking and watermarking 2023-07-26 15:27:04 +10:00
Lincoln Stein
e32cd794f7 add safetychecker and watermark nodes 2023-07-26 15:26:45 +10:00
psychedelicious
75b0507434 feat(nodes): change denoising start/end min/max to 0/1 2023-07-26 14:46:38 +10:00
psychedelicious
61291ea105 feat: sdxl metadata
- update `CoreMetadata` class & `MetadataAccumulator` with fields for SDXL-specific metadata
- update the linear UI graphs to populate this metadata
2023-07-26 14:46:38 +10:00
psychedelicious
840205496a feat(nodes): fix model load events on sdxl nodes
they need the `context` to be provided to emit socket events
2023-07-26 14:46:38 +10:00
psychedelicious
8e90f9024d feat(ui): remove isRefinerAvailable state, update refiner node
We can derive `isRefinerAvailable` from the query result (eg are there any refiner models installed). This is a piece of server state, so by using the list models response directly, we can avoid needing to manually keep the client in sync with the server.

Created a `useIsRefinerAvailable()` hook to return this boolean wherever it is needed.

Also updated the main models & refiner models endpoints to only return the appropriate models. Now we don't need to filter the data on these endpoints.
2023-07-26 14:46:38 +10:00
Lincoln Stein
2aefa921fe fix "unknown model type" error when rebasing a model with API
- Add command-line model probing script for dev use
- Minor documentation tweak
2023-07-25 08:36:57 -04:00
Lincoln Stein
fc4e104c61 tested on 3.11 and 3.10 2023-07-24 17:13:32 -04:00
blessedcoolant
1969afd038
Merge branch 'main' into feat/fix-soft-locks 2023-07-24 20:12:10 +12:00
blessedcoolant
d6bf6513ef
Merge branch 'main' into fix-types-2 2023-07-24 20:01:48 +12:00
blessedcoolant
e766ddbcf4 fix: Generate random seed using the generator instead of RandomState 2023-07-24 19:38:21 +12:00
psychedelicious
66cdeba8a1 fix(nodes): fix seed modulus operation
This was incorect and resulted in the max seed being one less than intended.
2023-07-24 16:44:32 +10:00
psychedelicious
d5a75eb833 feat: increase seed from int32 to uint32
At some point I typo'd this and set the max seed to signed int32 max. It should be *un*signed int32 max.

This restored the seed range to what it was in v2.3.
2023-07-24 16:34:50 +10:00
Alexandre Macabies
07a90c0198 Fix incorrect use of a singleton list.
This was found through pylance type errors. Go types!
2023-07-23 15:28:05 +02:00
psychedelicious
4b334be7d0 feat(nodes,ui): fix soft locks on session/invocation retrieval
When a queue item is popped for processing, we need to retrieve its session from the DB. Pydantic serializes the graph at this stage.

It's possible for a graph to have been made invalid during the graph preparation stage (e.g. an ancestor node executes, and its output is not valid for its successor node's input field).

When this occurs, the session in the DB will fail validation, but we don't have a chance to find out until it is retrieved and parsed by pydantic.

This logic was previously not wrapped in any exception handling.

Just after retrieving a session, we retrieve the specific invocation to execute from the session. It's possible that this could also have some sort of error, though it should be impossible for it to be a pydantic validation error (that would have been caught during session validation). There was also no exception handling here.

When either of these processes fail, the processor gets soft-locked because the processor's cleanup logic is never run. (I didn't dig deeper into exactly what cleanup is not happening, because the fix is to just handle the exceptions.)

This PR adds exception handling to both the session retrieval and node retrieval and events for each: `session_retrieval_error` and `invocation_retrieval_error`.

These events are caught and displayed in the UI as toasts, along with the type of the python exception (e.g. `Validation Error`). The events are also logged to the browser console.
2023-07-23 21:41:01 +10:00
Brandon Rising
78750042f5 Pass in dim overrides 2023-07-21 12:16:24 -04:00
psychedelicious
594bf6fef1 fix(api,ui): fix canvas saved images have extra transparent regions
- add `crop_visible` param to upload image & set to true only for canvas saves
2023-07-21 07:26:12 -04:00
psychedelicious
896b77cf56 feat(api,db): allow creating an image with a board_id 2023-07-21 07:26:12 -04:00
Lincoln Stein
9370572169 prettify startup messages 2023-07-20 22:45:35 -04:00
Brandon Rising
ce08aa350c Allow controlnet passthrough for now 2023-07-20 14:14:04 -04:00
Brandon Rising
4e90376d11 Allow passing in of precision, use available providers if none provided 2023-07-20 13:15:45 -04:00
Lincoln Stein
c013fe5b5d Merge branch 'main' into release/invokeai-3-0-rc 2023-07-20 12:22:27 -04:00
Sergey Borisov
4a0774b260 Use scale from vae 2023-07-20 18:54:51 +03:00
Sergey Borisov
29a590cced Add sdxl generation preview 2023-07-20 18:45:54 +03:00
Lincoln Stein
7deafa838b merge with main 2023-07-20 11:45:54 -04:00
Lincoln Stein
5134de7cfa
Merge branch 'main' into lstein/logger-route 2023-07-20 11:29:48 -04:00
Lincoln Stein
89a15f78dd collapse all autoimport directories into a single folder 2023-07-20 09:01:49 -04:00
Lincoln Stein
603989dc0d added get_log_level and set_log_level operations to the app route 2023-07-20 08:33:01 -04:00
blessedcoolant
267940a77e Merge branch 'main' into feat/controlnet-resize-mode 2023-07-20 22:24:11 +12:00
blessedcoolant
0795d8764f
Merge branch 'main' into fix/post-model-sync 2023-07-20 20:16:14 +12:00
user1
70fec9ddab Added pixel_perfect_resolution() method to controlnet_utils.py, but not using yet. To be usable this will likely require modification of ControlNet preprocessors 2023-07-20 00:41:49 -07:00
user1
909f538fb5 Switching over to controlnet_utils prepare_control_image(), with added resize_mode. 2023-07-20 00:41:49 -07:00
user1
f2f49bd8d0 Added resize_mode param to ControlNet node 2023-07-20 00:41:49 -07:00
user1
b8e0810ed1 Added revised prepare_control_image() that leverages lvmin high quality resizing 2023-07-20 00:41:49 -07:00
user1
6cb9167a1b Added controlnet_utils.py with code from lvmin for high quality resize, crop+resize, fill+resize 2023-07-20 00:41:49 -07:00
psychedelicious
187cf906fa
ui: enhance intermediates clear, enhance board auto-add (#3851)
* feat(ui): enhance clear intermediates feature

- retrieve the # of intermediates using a new query (just uses list images endpoint w/ limit of 0)
- display the count in the UI
- add types for clearIntermediates mutation
- minor styling and verbiage changes

* feat(ui): remove unused settings option for guides

* feat(ui): use solid badge variant

consistent with the rest of the usage of badges

* feat(ui): update board ctx menu, add board auto-add

- add context menu to system boards - only open is select board. did this so that you dont think its broken when you click it
- add auto-add board. you can right click a user board to enable it for auto-add, or use the gallery settings popover to select it. the invoke button has a tooltip on a short delay to remind you that you have auto-add enabled
- made useBoardName hook, provide it a board id and it gets your the board name
- removed `boardIdToAdTo` state & logic, updated workflows to auto-switch and auto-add on image generation

* fix(ui): clear controlnet when clearing intermediates

* feat: Make Add Board icon a button

* feat(db, api): clear intermediates now clears all of them

* feat(ui): make reset webui text subtext style

* feat(ui): board name change submits on blur

---------

Co-authored-by: blessedcoolant <54517381+blessedcoolant@users.noreply.github.com>
2023-07-20 17:44:22 +12:00
Lincoln Stein
d76bf4444c
Update invokeai/app/api/routers/models.py
Co-authored-by: psychedelicious <4822129+psychedelicious@users.noreply.github.com>
2023-07-19 22:46:49 -04:00
Lincoln Stein
170bbd7da3 change GET to POST method for model synchronization route 2023-07-19 22:16:56 -04:00
Lincoln Stein
f2515d9480
fix v1-finetune.yaml is not in the subpath of "" (#3848)
Co-authored-by: Lincoln Stein <lstein@gmail.com>
2023-07-20 14:13:56 +12:00
Lincoln Stein
4d8f17c69d fix v1-finetune.yaml is not in the subpath of "" 2023-07-19 22:06:55 -04:00
Lincoln Stein
77d9657980 don't write root into invokeai.yaml 2023-07-19 21:12:52 -04:00
Lincoln Stein
5f940bf3b3 default precision to "auto" 2023-07-19 18:23:00 -04:00
psychedelicious
509514f11d feat(api): display warning when port is in use 2023-07-19 13:29:31 -04:00
psychedelicious
c557402dbb feat(api): use next available port
Resolves #3515

@ebr @brandonrising can't imagine this would cause issues but just FYI
2023-07-19 13:29:31 -04:00
Lincoln Stein
2fbc6dc315
Merge branch 'main' into bugfix/ImageToLatentsInvocation_fp32_precision 2023-07-19 12:08:04 -04:00
psychedelicious
0724eb9e0a
feat(ui): another go at gallery (#3791)
* feat(ui): migrate listImages to RTK query using createEntityAdapter

- see comments in `endpoints/images.ts` for explanation of the caching
- so far, only manually updating `all` images when new image is generated. no other manual cache updates are implemented, but will be needed.
- fixed some weirdness with loading state components (like the spinners in gallery)
- added `useThumbnailFallback` for `IAIDndImage`, this displays the tiny webp thumbnail while the full-size images load
- comment out some old thunk related stuff in gallerySlice, which is no longer needed

* feat(ui): add manual cache updates for board changes (wip)

- update RTK Query caches when adding/removing single image to/from board
- work more on migrating all image-related operations to RTK Query

* update AddImagesToBoardContext so that it works when user uses context menu + modal

* handle case where no image is selected

* get assets working for main list and boards - dnd only

* feat(ui): migrate image uploads to RTK Query

- minor refactor of `ImageUploader` and `useImageUploadButton` hooks, simplify some logic
- style filesystem upload overlay to match existing UI
- replace all old `imageUploaded` thunks with `uploadImage` RTK Query calls, update associated logic including canvas related uploads
- simplify `PostUploadAction`s that only need to display user input

* feat(ui): remove `receivedPageOfImages` thunks

* feat(ui): remove `receivedImageUrls` thunk

* feat(ui): finish removing all images thunks

stuff now broken:
- image usage
- delete board images
- on first load, no image selected

* feat(ui): simplify `updateImage` cache manipulation

- we don't actually ever change categories, so we can remove a lot of logic

* feat(ui): simplify canvas autosave

- instead of using a network request to set the canvas generation as not intermediate, we can just do that in the graph

* feat(ui): simplify & handle edge cases in cache updates

* feat(db, api): support `board_id='none'` for `get_many` images queries

This allows us to get all images that are not on a board.

* chore(ui): regen types

* feat(ui): add `All Assets`, `No Board` boards

Restructure boards:
- `all images` is all images
- `all assets` is all assets
- `no board` is all images/assets without a board set
- user boards may have images and assets

Update caching logic
- much simpler without every board having sub-views of images and assets
- update drag and drop operations for all possible interactions

* chore(ui): regen types

* feat(ui): move download to top of context menu

* feat(ui): improve drop overlay styles

* fix(ui): fix image not selected on first load

- listen for first load of all images board, then select the first image

* feat(ui): refactor board deletion

api changes:
- add route to list all image names for a board. this is required to handle board + image deletion. we need to know every image in the board to determine the image usage across the app. this is fetched only when the delete board and images modal is opened so it's as efficient as it can be.
- update the delete board route to respond with a list of deleted `board_images` and `images`, as image names. this is needed to perform accurate clientside state & cache updates after deleting.

db changes:
- remove unused `board_images` service method to get paginated images dtos for a board. this is now done thru the list images endpoint & images service. needs a small logic change on `images.delete_images_on_board`

ui changes:
- simplify the delete board modal - no context, just minor prop drilling. this is feasible for boards only because the components that need to trigger and manipulate the modal are very close together in the tree
- add cache updates for `deleteBoard` & `deleteBoardAndImages` mutations
- the only thing we cannot do directly is on `deleteBoardAndImages`, update the `No Board` board. we'd need to insert image dtos that we may not have loaded. instead, i am just invalidating the tags for that `listImages` cache. so when you `deleteBoardAndImages`, the `No Board` will re-fetch the initial image limit. i think this is more efficient than e.g. fetching all image dtos to insert then inserting them.
- handle image usage for `deleteBoardAndImages`
- update all (i think/hope) the little bits and pieces in the UI to accomodate these changes

* fix(ui): fix board selection logic

* feat(ui): add delete board modal loading state

* fix(ui): use thumbnails for board cover images

* fix(ui): fix race condition with board selection

when selecting a board that doesn't have any images loaded, we need to wait until the images haveloaded before selecting the first image.

this logic is debounced to ~1000ms.

* feat(ui): name 'No Board' correctly, change icon

* fix(ui): do not cache listAllImageNames query

if we cache it, we can end up with stale image usage during deletion.

we could of course manually update the cache as we are doing elsewhere. but because this is a relatively infrequent network request, i'd like to trade increased cache mgmt complexity here for increased resource usage.

* feat(ui): reduce drag preview opacity, remove border

* fix(ui): fix incorrect queryArg used in `deleteImage` and `updateImage` cache updates

* fix(ui): fix doubled open in new tab

* fix(ui): fix new generations not getting added to 'No Board'

* fix(ui): fix board id not changing on new image when autosave enabled

* fix(ui): context menu when selection is 0

need to revise how context menu is triggered later, when we approach multi select

* fix(ui): fix deleting does not update counts for all images and all assets

* fix(ui): fix all assets board name in boards list collapse button

* fix(ui): ensure we never go under 0 for total board count

* fix(ui): fix text overflow on board names

---------

Co-authored-by: Mary Hipp <maryhipp@Marys-MacBook-Air.local>
2023-07-19 12:06:38 -04:00
Martin Kristiansen
07c48b2fd1 Moving detected precision to DEFAULT_PRECISION constant 2023-07-19 11:55:37 -04:00
Martin Kristiansen
fface339ae Same fix for ImageToLatentsInvocation 2023-07-19 11:38:13 -04:00
Martin Kristiansen
2ec9dab595 Changing ImageToLatentsInvocation node to default to detected precision instead of fp16 2023-07-19 11:16:00 -04:00
Mary Hipp Rogers
9f00e055ac
Maryhipp/clear intermediates (#3820)
* new route to clear intermediates

* UI to clear intermediates from settings modal

* cleanup

* PR feedback

---------

Co-authored-by: Mary Hipp <maryhipp@Marys-MacBook-Air.local>
2023-07-19 10:55:29 -04:00
Lincoln Stein
9c3a556813
Merge branch 'main' into fix/transformers_4_31_0 2023-07-19 09:35:52 -04:00
mickr777
d8db618de0
import choose_torch_device from ...backend.util.devices 2023-07-19 16:43:02 +10:00
mickr777
19d67b29e7
Remove not needed text 2023-07-19 15:20:40 +10:00
mickr777
52e7e0b31b
Missing def choose_torch_device 2023-07-19 15:15:55 +10:00
Brandon Rising
ee7b36cea5 Merge branch 'main' into onnx-testing 2023-07-18 22:56:41 -04:00
Brandon Rising
487455ef2e Add model_type to the model state object 2023-07-18 22:40:27 -04:00
Lincoln Stein
f29bafd6ec fix Object of type PosixPath is not JSON serializable error 2023-07-18 22:10:12 -04:00
Lincoln Stein
893e199677
Merge branch 'main' into feat/ui/upscale 2023-07-18 19:18:55 -04:00
Brandon Rising
869f418b03 Setup onnx on linear text2image 2023-07-18 14:27:54 -04:00
Brandon Rising
35d5ef9118 Emit step completions 2023-07-18 12:35:07 -04:00
Sergey Borisov
3240f98f4e Rename clip1 to clip 2023-07-18 18:58:17 +03:00
blessedcoolant
7fde1f93ea fix: Missing context on string param node 2023-07-19 02:49:09 +12:00
blessedcoolant
3f1d5000c0 Merge branch 'main' into nodes-stuff 2023-07-19 02:37:50 +12:00
blessedcoolant
0c18c5d603 feat: Add titles and tags to all Nodes 2023-07-19 02:26:45 +12:00
blessedcoolant
7d49c727a0 feat: Add String Param & types to other params 2023-07-19 02:26:33 +12:00
StAlKeR7779
889b77d3d6
Merge branch 'main' into save_vram 2023-07-18 16:55:48 +03:00
Sergey Borisov
fbbc4b3f69 Fixes 2023-07-18 16:51:16 +03:00
Sergey Borisov
bc11296a5e Disable lazy offloading on disabled vram cache, move resulted tensors to cpu(to not stack vram tensors in cache), fix - text encoder not freed(detach) 2023-07-18 16:20:25 +03:00
psychedelicious
c19d48abd0 fix(nodes): fix inpaint cond logic for new compel version
thanks @StAlKeR7779
2023-07-18 22:39:34 +10:00
psychedelicious
42c440c73f
Merge branch 'main' into feat/ui/upscale 2023-07-18 22:08:02 +10:00
Lincoln Stein
9c3c393b84 merge with main 2023-07-18 07:00:55 -04:00
psychedelicious
56098f370c feat(nodes): add RealESRGAN_x2plus.pth, update upscale nodes
- add `RealESRGAN_x2plus.pth` model to installer
- add `RealESRGAN_x2plus.pth` to `realesrgan` node
- rename `RealESRGAN` to `ESRGAN` in nodes
- make `scale_factor` optional in `img_scale` node
2023-07-18 14:55:18 +10:00
Lincoln Stein
c955c13b6f Merge branch 'sdxl-support' of github.com:invoke-ai/InvokeAI into sdxl-support 2023-07-17 23:49:48 -04:00
Lincoln Stein
ef31837167 fix caption on sdxl raw prompt 2023-07-17 23:49:23 -04:00
blessedcoolant
b08ad28daa fix: typo in logger statement (import_model) 2023-07-18 15:17:52 +12:00
Lincoln Stein
1353bf98b3 add specific exception for model probe failures 2023-07-17 23:08:39 -04:00
Lincoln Stein
af1c1ab51f importing an unrecognized model now gives "Unsupported Media Type" error 2023-07-17 22:33:05 -04:00
blessedcoolant
13da881953 Merge branch 'main' into sdxl-support 2023-07-18 13:34:07 +12:00
blessedcoolant
ec3c15ead0 Merge branch 'main' into mm-ui 2023-07-18 12:58:57 +12:00
Sergey Borisov
ada9b06e48 Implement compel prompt nodes for sdxl 2023-07-18 01:49:45 +03:00
Lincoln Stein
6ae10798b0
Merge branch 'main' into feat/model-events 2023-07-17 17:15:12 -04:00
Brandon Rising
bcce70fca6 Testing different session opts, added timings for testing 2023-07-17 16:27:33 -04:00
Lincoln Stein
08854b6d68 keep model path consistent with model manager key in model update api 2023-07-17 10:00:28 -04:00
skunkworxdark
f767bf2330 use FileNotFoundError insted of "File path not found" 2023-07-17 05:49:09 -04:00
skunkworxdark
b1008af696 apply changes as suggested @psychedelicious in PR comments.
- filename -> file_path
- pre and post prompt changed to optional
- clearer pre and post prompt descriptions
- handle pre and post prompt passed as None
- max_prompts defaults to 1 isted of 0 to avoid accidentally processing large prompt files with it set to 0 when adding a new node.
2023-07-17 05:49:09 -04:00
skunkworxdark
956011066d Added class PromptsFromFileInvocation to prompt.py. A new PromptFromFile Custom node that reads prompts from a file one line per prompt and outputs them as a prompt collection. With inputs for filename, pre_prompt, post_prompt, start line number, and max_prompts 2023-07-17 05:49:09 -04:00
blessedcoolant
e039771d07 fix: Incorrect type on SDXL Model Loader 2023-07-17 21:47:41 +12:00
psychedelicious
3e2a948007
Merge branch 'main' into feat/model-events 2023-07-17 17:36:20 +10:00
psychedelicious
ba12849685 fix(nodes): fix some model load events not emitting
Missed adding the `context` arg to them initially
2023-07-17 17:16:55 +10:00
Sergey Borisov
6aefd8600a Fix error with long prompts when controlnet used 2023-07-16 21:06:40 -04:00
Kent Keirsey
675a92401c
Merge branch 'main' into lstein/default-model-install 2023-07-16 19:32:59 -04:00
Lincoln Stein
6fbb5ce780 add renaming capabilities to model update API route 2023-07-16 14:17:05 -04:00
Lincoln Stein
cad3f96831 add model input to refiner 2023-07-16 12:38:04 -04:00
Lincoln Stein
6534288b75 refiner only has clip2 not clip 2023-07-16 12:36:38 -04:00
Lincoln Stein
0a2964d8c0 add differentiated sdxl and sdxl_refiner model loaders 2023-07-16 12:17:56 -04:00
Brandon Rising
91112167b1 Fix syntax err 2023-07-15 23:56:48 -04:00
Lincoln Stein
5206ddf9b2 truncate long prompts to avoid a crash with controlnet 2023-07-15 23:49:25 -04:00
Sergey Borisov
fe78a08e37 Fix sd1/2 models conditionings 2023-07-16 06:24:24 +03:00
Sergey Borisov
c9c2229917 Separate prompt to sdxl and sdxl-refiner, add denoising start-end fields, add l2l node(supports both sdxl and sdxl-refiner), add fp32 to vae encode 2023-07-16 06:00:37 +03:00
psychedelicious
5d59dd4b97 feat(nodes): use correctly-typed configuration service in upscale node 2023-07-16 10:54:52 +10:00
psychedelicious
48a031dbaf fix(nodes): fix typing of configuration service 2023-07-16 10:52:18 +10:00
Lincoln Stein
ccbfa5d862 resolve conflicts 2023-07-15 19:47:50 -04:00
Lincoln Stein
373beefd13 remove restoration option from invokeai.yaml 2023-07-15 18:26:19 -04:00
Lincoln Stein
6b0a158ffa Merge branch 'main' into lstein/default-model-install 2023-07-15 18:23:34 -04:00
Lincoln Stein
c90345d6a3 deprecate the face restoration option 2023-07-15 18:23:32 -04:00
Lincoln Stein
9faffa2245 revert inadvertent breaking change to config causing test failures (override) 2023-07-15 18:15:59 -04:00
Lincoln Stein
6073cb8020 add documentation on the configuration system 2023-07-15 16:14:47 -04:00
psychedelicious
7b6159f8d6 feat(nodes): emit model loading events
- remove dependency on having access to a `node` during emits, would need a bit of additional args passed through the system and I don't think its necessary at this point. this also allowed us to drop an extraneous fetching/parsing of the session from db.
- provide the invocation context to all `get_model()` calls, so the events are able to be emitted
- test all model loading events in the app and confirm socket events are received
2023-07-16 02:12:01 +10:00
psychedelicious
c7b547ea3e feat(nodes): remove references to restoration services
- remove restoration services
- remove the restore faces nodes
- update tests
2023-07-16 01:12:39 +10:00
psychedelicious
74ca87ac9e feat(nodes): add realesrgan node 2023-07-16 01:06:50 +10:00
psychedelicious
d270f21c85 feat(nodes): valid controlnet weights are -1 to 2 2023-07-15 19:56:44 +10:00
psychedelicious
ae72f372be fix(nodes): do not use hardcoded controlnet model 2023-07-15 19:56:44 +10:00
psychedelicious
29b2e59e65 fix(nodes): fix ref to ctx mgr service, missing import 2023-07-15 19:56:44 +10:00
psychedelicious
82fa39b531 feat(nodes): add controlnet nodes type hint 2023-07-15 19:56:44 +10:00
psychedelicious
788dcbde70 fix(nodes): add missing import 2023-07-15 19:56:44 +10:00
Sergey Borisov
6ab9a5e108 Draft 2023-07-15 19:56:44 +10:00
blessedcoolant
808b2de709
Merge branch 'main' into lstein/model-manager-route-enhancements 2023-07-15 16:56:54 +12:00
Lincoln Stein
2faa7cee37 add rename_model route 2023-07-14 23:03:18 -04:00
Sergey Borisov
7093e5d033 Pad conditionings using zeros and encoder_attention_mask 2023-07-15 00:52:54 +03:00
Brandon Rising
bd7b59910d Testing onnx in new ui updates 2023-07-14 14:24:15 -04:00
Lincoln Stein
e71ce83e9c
Merge branch 'main' into lstein/model-manager-route-enhancements 2023-07-14 13:52:55 -04:00
Lincoln Stein
8600aad12b multiple enhancements to model manager REACT API
1. add a /sync route for synchronizing the in-memory model lists to
   models.yaml, the models directory, and the autoimport directories.

2. add optional destination_directories to convert_model and merge_model
   operations.

3. add /ckpt_confs route for retrieving known legacy checkpoint configuration
   files.

4. add /search route for finding all models in a directory located in the server
   filesystem
2023-07-14 13:45:16 -04:00
Jonathan
9960d7ca2a
Allow ImageResizeInvocation w/h to take inputs from other nodes (#3765) 2023-07-15 05:34:13 +12:00
Lincoln Stein
ad076b1174 add model directory search route 2023-07-14 11:14:33 -04:00
Mary Hipp Rogers
545e2f557f
Merge branch 'main' into feat/api/image-max-age 2023-07-14 08:21:44 -04:00
psychedelicious
23c1a6b9d5 fix(nodes): make ResizeLatents w/h optional
now you can connect to them in node editor
2023-07-14 21:42:42 +10:00
Sergey Borisov
9fb0b0959f Make sde and ancestral schedulers reproducible 2023-07-14 05:25:09 +03:00
Sergey Borisov
d8f88c09ea Fix pink output on a lot of samplers 2023-07-14 05:00:33 +03:00
Brandon Rising
524888bf3b Merge branch 'main' into feat/onnx 2023-07-13 14:23:57 -04:00
psychedelicious
4d25d702a1 feat(api): app/config route returns available infill methods 2023-07-13 23:26:52 +10:00
maryhipp
fba25792f9 add new route for app config 2023-07-13 23:26:52 +10:00
blessedcoolant
430b9c291f fix: Loras not working correctly with Inpainting 2023-07-13 22:59:38 +12:00
psychedelicious
5f5c93abb4 feat(app): embed PNG info in invokeai_metadata and invokeai_graph
Using just `metadata` and `graph` feel a bit too generic.
2023-07-13 15:40:05 +10:00
psychedelicious
50bef87da7 feat(db,nodes,api): refactor metadata
Metadata for the Linear UI is now sneakily provided via a `MetadataAccumulator` node, which the client populates / hooks up while building the graph.

Additionally, we provide the unexpanded graph with the metadata API response.

Both of these are embedded into the PNGs.

- Remove `metadata` from `ImageDTO`
- Split up the `images/` routes to accomodate this; metadata is only retrieved per-image
- `images/{image_name}` now gets the DTO
- `images/{image_name}/metadata` gets the new metadata
- `images/{image_name}/full` gets the full-sized image file
- Remove old metadata service
- Add `MetadataAccumulator` node, `CoreMetadataField`, hook up to `LatentsToImage` node
- Add `get_raw()` method to `ItemStorage`, retrieves the row from DB as a string, no pydantic parsing
- Update `images`related services to handle storing and retrieving the new metadata
- Add `get_metadata_graph_from_raw_session` which extracts the `graph` from `session` without needing to hydrate the session in pydantic, in preparation for providing it as metadata; also removes all references to the `MetadataAccumulator` node
2023-07-13 15:40:05 +10:00
Lincoln Stein
75c5ce46bc merged SDXLModelLoader into ModelLoader invocation 2023-07-11 16:33:08 -04:00
Lincoln Stein
25591788c1 fix conflicts 2023-07-11 15:55:10 -04:00
Lincoln Stein
dab03fb646 rename gpu_mem_reserved to max_vram_cache_size
To be consistent with max_cache_size, the amount of memory to hold in
VRAM for model caching is now controlled by the max_vram_cache_size
configuration parameter.
2023-07-11 15:25:39 -04:00
Lincoln Stein
d32f9f7cb0 reverse logic of gpu_mem_reserved
- gpu_mem_reserved now indicates the amount of VRAM that will be reserved
  for model caching (similar to max_cache_size).
2023-07-11 15:16:40 -04:00
Sergey Borisov
358ced6bab SDXL Prompt and t2l nodes draft, add fp32 to vae decode 2023-07-11 18:19:36 +03:00
Lincoln Stein
f6302aa691 Merge branch 'main' into release/invokeai-3-0-beta 2023-07-11 10:57:36 -04:00
Lincoln Stein
23d8a2777e add ability to filter list_models on list of base models 2023-07-10 21:59:32 -04:00
Lincoln Stein
8e42502dfd partial implementation of SDXL model loader 2023-07-10 20:18:30 -04:00
Lincoln Stein
83ec4c983c
Merge branch 'main' into lstein/keep-models-in-vram 2023-07-10 18:47:05 -04:00
Lincoln Stein
c9c61ee459
Update invokeai/app/services/config.py
Co-authored-by: Eugene Brodsky <ebr@users.noreply.github.com>
2023-07-10 18:46:32 -04:00
psychedelicious
00e26ffa9a fix(nodes): remove board_id column from images table
This is extraneous; the `board_images` table holds image-board relationships.
2023-07-10 11:30:35 +10:00
Lincoln Stein
5759a390f9 introduce gpu_mem_reserved configuration parameter 2023-07-09 18:35:04 -04:00
Lincoln Stein
2f3190ad6c merge with main 2023-07-09 13:28:05 -04:00
psychedelicious
c5539b442c feat(api): set max-age for images
Image files are immutable and we expect deletion to result in no further requests for a given image, so we can set the max-age to something thicc.

Resolves #3426
2023-07-09 22:42:05 +10:00
psychedelicious
4640969037 fix(api): fix for borked windows mimetypes registry
It's possible for the Windows mimetypes for js to be changed and cause content-type errors when running the app.

Explicitly set the mimetypes to rectify this. Note that the root cause is a misconfiguration on the client - not our end.

See https://github.com/invoke-ai/InvokeAI/discussions/3684#discussioncomment-6391352
2023-07-09 11:05:01 +10:00
Lincoln Stein
b6cc4df1d8 report processing stack traces to the console 2023-07-08 19:48:32 -04:00
Lincoln Stein
5f7435955e if models.yaml doesn't exist, rebuild it 2023-07-08 15:13:51 -04:00
Lincoln Stein
92d4486214 don't write 'version:' to the invokeai.yaml file 2023-07-08 12:06:23 -04:00
Lincoln Stein
bd9786564c merge with main 2023-07-08 10:11:25 -04:00
Lincoln Stein
f6ecee926f version of _find_root() that works in conda environment 2023-07-08 09:02:17 -04:00
Lincoln Stein
454c2c0952 version of _find_root() that works in conda environment 2023-07-08 09:01:05 -04:00
blessedcoolant
3333805821 feat: Add App Version to UI 2023-07-08 21:31:17 +12:00
Lincoln Stein
8e8f9cce0f print version when --version provided at command line 2023-07-07 20:47:29 -04:00
Lincoln Stein
10d3bccf32
Mac MPS FP16 fixes (#3641)
This PR is to allow FP16 precision to work on Macs with MPS. In
addition, it centralizes the torch fixes/workarounds required for MPS
into a new backend utility `mps_fixes.py`. This is conditionally
imported in `api_app.py`/`cli_app.py`.

Many MANY thanks to @StAlKeR7779 for patiently working to debug and fix
these issues.
2023-07-07 17:43:23 -04:00
Eugene Brodsky
97b2ec58e2
Merge branch 'main' into release/invokeai-3-0-alpha 2023-07-07 14:18:12 -04:00
Lincoln Stein
9f58ed35cf improve user migration experience
- No longer fail root directory probing if invokeai.yaml is missing
  (test is now whether a `models/core` directory exists).
- Migrate script does not overwrite previously-installed models.
- Can run migrate script on an existing 2.3 version directory
  with --from and --to pointing to same 2.3 root.
2023-07-07 08:18:46 -04:00
blessedcoolant
7aa918677e Merge branch 'main' into feat/clip_skip 2023-07-07 16:21:53 +12:00
Lincoln Stein
54f3686e3b merge with main, fix conflicts 2023-07-06 15:21:45 -04:00
Lincoln Stein
e9352227f3 add merge api 2023-07-06 15:12:34 -04:00
Lincoln Stein
90c66aab3d merge with upstream 2023-07-06 13:17:02 -04:00
Lincoln Stein
3e925fbf34 model merging API ready for testing 2023-07-06 13:15:15 -04:00
Sergey Borisov
a9e77675a8 Move clip skip to separate node 2023-07-06 17:39:49 +03:00
Sergey Borisov
04b57c408f Add clip skip option to prompt node 2023-07-06 16:09:40 +03:00
psychedelicious
c21245f590 fix(api): make list models params querys, make path /, remove defaults
The list models route should just be the base route path, and should use query parameters as opposed to path parameters (which cannot be optional)

Removed defaults for update model route - for the purposes of the API, we should always be explicit with this
2023-07-06 15:34:50 +10:00
Lincoln Stein
8f5fcb188c
Merge branch 'main' into lstein/model-manager-router-api 2023-07-05 23:16:43 -04:00
Lincoln Stein
f7daa6e71d all methods now return OPENAPI_MODEL_CONFIGS; convert uses PUT 2023-07-05 23:13:01 -04:00
Lincoln Stein
83d3a043da merge latest changes from main 2023-07-05 19:15:53 -04:00
Lincoln Stein
5b6dd47b9f add API for model convert 2023-07-05 15:13:21 -04:00
Lincoln Stein
5027d0a603 accept @psychedelicious suggestions above 2023-07-05 14:50:57 -04:00
Lincoln Stein
021e1eca8e
Merge branch 'main' into mps-fp16-fixes 2023-07-05 13:19:52 -04:00
Sergey Borisov
0ac9dca926 Fix loading diffusers ti 2023-07-05 19:46:00 +03:00
Lincoln Stein
9edf78dd2e merge with main 2023-07-05 09:12:54 -04:00
Lincoln Stein
6112197edf convert implemented; need router 2023-07-05 09:05:05 -04:00
gogurtenjoyer
ba7345deb4
Merge branch 'main' into mps-fp16-fixes 2023-07-05 07:38:41 -04:00
psychedelicious
56d4ea3252 fix(api): improve mm routes 2023-07-05 20:08:47 +10:00
psychedelicious
5d4d0e795c fix(mm): fix up mm service types 2023-07-05 20:07:10 +10:00
Eugene Brodsky
7170e82f73 expose max_cache_size in config 2023-07-05 02:44:15 -04:00
blessedcoolant
639d88afd6 revert: inference_mode to no_grad 2023-07-05 16:39:15 +12:00
blessedcoolant
c0501ed5c2 fix: Slow loading of Loras
Co-Authored-By: StAlKeR7779 <7768370+StAlKeR7779@users.noreply.github.com>
2023-07-05 12:47:34 +10:00
psychedelicious
08d428a5e7 feat(nodes): add lora field, update lora loader 2023-07-05 12:47:34 +10:00
gogurtenjoyer
233869b56a Mac MPS FP16 fixes
This PR is to allow FP16 precision to work on Macs with MPS. In addition, it centralizes the torch fixes/workarounds
required for MPS into a new backend utility file `mps_fixes.py`. This is conditionally imported in `api_app.py`/`cli_app.py`.

Many MANY thanks to StAlKeR7779 for patiently working to debug and fix these issues.
2023-07-04 18:10:53 -04:00
Lincoln Stein
5d099f4a49 update_model working 2023-07-04 17:26:57 -04:00
Lincoln Stein
752b4d50cf model_delete method now working 2023-07-04 10:40:32 -04:00