Commit Graph

1991 Commits

Author SHA1 Message Date
blessedcoolant
fb015332f2 feat: Add tooltips to color mode switcher 2023-06-30 06:05:08 +12:00
blessedcoolant
6e917dcbb0 chore: More colors to own files + small color tweaks 2023-06-30 06:04:42 +12:00
psychedelicious
032c7e68d0 feat(ui): remove themes, add hand-crafted dark and light modes
Themes are very fun but due to the differences in perceived saturation and lightness across the
the color spectrum, it's impossible to have have multiple themes that look great without hand-
crafting *every* shade for *every* theme. We've ended up with 4 OK themes (well, 3, because the
light theme was pretty bad).

I've removed the themes and added color mode support. There is now a single dark and light mode,
each with their own color palette and the classic grey / purple / yellow invoke colors that
@blessedcoolant first designed.

I've re-styled almost everything except the model manager and lightbox, which I keep forgetting
to work on.

One new concept is the Chakra `layerStyle`. This lets us define "layers" - think body, first layer,
second layer, etc - that can be applied on various components. By defining layers, we can be more
consistent about the z-axis and its relationship to color and lightness.
2023-06-30 03:24:36 +10:00
psychedelicious
c00aea7a6c tests(nodes): fix nodes tests 2023-06-29 23:11:48 +10:00
Lincoln Stein
2c5b050d82 add image board support to invokeai-node-cli 2023-06-29 22:12:34 +10:00
Mary Hipp
723d68e496 add image usage for board images and listener to handle actual deletion 2023-06-29 21:14:53 +10:00
Mary Hipp
ba67e57a7e (wip) delete images along with board 2023-06-29 21:14:53 +10:00
maryhipp
45935caf1d fix query 2023-06-29 21:14:53 +10:00
Mary Hipp
73f2092ec5 (api) add option to board delete route and logic to services 2023-06-29 21:14:53 +10:00
blessedcoolant
5be1e71d1b
Merge branch 'main' into lstein/fix-model-scan-on-rel-root 2023-06-29 17:54:12 +12:00
mickr777
30a917f70c
Fix Typo in migrate_to_3.py 2023-06-29 14:45:55 +10:00
psychedelicious
4308d593c3 fix(ui): improve IDE TS performance by not resolving JSON
The TS Language Server slows down immensely with our translation JSON, which is used to provide kinda-type-safe translation keys. I say "kinda", because you don't get autocomplete - you only get red squigglies when the key is incorrect.

To improve the performance, we can opt out of this process entirely, at the cost of no red squigglies for translation keys. Hopefully we can resolve this in the future.

It's not clear why this became an issue only recently (like past couple weeks). We've tried rolling back the app dependencies, VSCode extensions, VSCode itself, and the TS version to before the time when the issue started, but nothing seems to improve the performance.

1. Disable `resolveJsonModule` in `tsconfig.json`
2. Ignore TS in `i18n.ts` when importing the JSON
3. Comment out the custom types in `i18.d.ts` entirely

It's possible that only `3` is needed to fix the issue.

I've tested building the app and running the build - it works fine, and translation works fine.
2023-06-28 23:55:44 -04:00
Brandon Rising
8f6b3660c5 Set use-credentials on commercial deployment if authToken is set on canvas image calls, comment out the UpdateImageUrls on connect listener 2023-06-29 13:55:03 +10:00
Lincoln Stein
1e97ba3628 merge with fix needed to run installer 2023-06-28 17:04:44 -04:00
Lincoln Stein
ace4f6d586 fix duplicate model key addition when root directory is a relative path 2023-06-28 17:02:03 -04:00
Lincoln Stein
261ca823c0 bump version number 2023-06-28 17:00:38 -04:00
StAlKeR7779
ac46b129bf
Merge branch 'main' into feat/lora_model_patch 2023-06-28 22:43:58 +03:00
Lincoln Stein
79fc708580 warn but do not crash when model scan finds random cruft in models directory 2023-06-28 15:26:42 -04:00
Lincoln Stein
72209d0cc3
Merge branch 'main' into lstein/installer-for-new-model-layout 2023-06-28 14:49:37 -04:00
blessedcoolant
75614bbba3
Merge branch 'main' into feat/nodes/cpu-noise 2023-06-28 18:22:08 +12:00
blessedcoolant
32883adf6e
Merge branch 'main' into feat/controlnet_extras 2023-06-28 17:36:21 +12:00
blessedcoolant
1ea3160594
Merge branch 'main' into feat/ui/dynamic-prompts-ux 2023-06-28 17:34:36 +12:00
Kent Keirsey
fc322aa9f7 Update controlnet-aux to 0.0.6 and add LeReS 2023-06-27 23:45:47 -04:00
psychedelicious
73f63853ba fix(nodes): use context for logger in param_easing 2023-06-27 23:30:10 -04:00
Lincoln Stein
e8ed0fad6c autoimport from embedding/controlnet/lora folders designated in startup file 2023-06-27 12:30:53 -04:00
psychedelicious
1f3e5582f4 feat(ui): add type extraction helpers 2023-06-28 01:17:34 +10:00
psychedelicious
642db657c2 feat(ui): use max prompts for combinatorial, iterations for non-combinatorial 2023-06-27 20:29:41 +10:00
psychedelicious
246298d1d6 chore(ui): regen types 2023-06-27 13:57:41 +10:00
psychedelicious
2e14528e4c feat(nodes): default to CPU noise 2023-06-27 13:57:31 +10:00
Lincoln Stein
f15d28d141 improved wording of v2 selection prompt 2023-06-26 20:30:08 -04:00
user1
862bfa2c36 Merge branch 'main' of github.com:invoke-ai/InvokeAI into feat/controlnet_extras 2023-06-26 16:39:31 -07:00
Lincoln Stein
044fe6bb20 remove dangling debug statement 2023-06-26 17:48:06 -04:00
Lincoln Stein
8c74f49a18 Merge branch 'lstein/installer-for-new-model-layout' of github.com:invoke-ai/InvokeAI into lstein/installer-for-new-model-layout 2023-06-26 16:31:00 -04:00
Lincoln Stein
823e098b7c prompt user for prediction type when autoimporting a v2 model without .yaml file
don't ask user for prediction type of a config.yaml provided
2023-06-26 16:30:34 -04:00
Eugene Brodsky
b7e9d09537
Merge branch 'main' into lstein/installer-for-new-model-layout 2023-06-26 16:22:23 -04:00
Lincoln Stein
ea15d037f9
Merge branch 'main' into lstein/tweak-installer-ui 2023-06-26 15:05:16 -04:00
user1
10d2d85c83 Started to add ControlNet resize_crop and resize_fill options, but commented out, not ready to deploy yet. 2023-06-26 12:03:05 -07:00
Lincoln Stein
011adfc958 merge with main 2023-06-26 13:53:59 -04:00
Lincoln Stein
befd95eb19 rename root_dir to root_path attributes to emphasize return of a Path 2023-06-26 13:52:25 -04:00
Lincoln Stein
a2ddb3823b fix add_model() logic 2023-06-26 13:33:38 -04:00
user1
af566adf56 For MediapipeFace ControlNet preprocessor, if input image is RGBA format then convert to RGB (otherwise MediapipeFace image processing throws an error) 2023-06-26 04:29:43 -07:00
user1
873c18bc4b Added TileResampler ControlNet preprocessor node.
Also fixes to SegmentAnything ControlNet preprocessor node.
2023-06-26 04:27:26 -07:00
psychedelicious
6ccf62a863 feat(ui): only show canvas image fallback on loading error 2023-06-26 19:20:05 +10:00
psychedelicious
6390af229d feat(ui): add dynamic prompts to t2i tab
- add param accordion for dynamic prompts
- update graphs
2023-06-26 19:15:54 +10:00
Eugene Brodsky
47e651225d query for 'main' model type when populating UI lists
to support renaming of 'pipeline' models to 'main'
2023-06-26 01:39:46 -04:00
blessedcoolant
3a19be1606 fix: Add missing IAIMantineSelect disabled styles 2023-06-26 17:37:47 +12:00
blessedcoolant
b51ab056f2
Merge branch 'main' into feat/ui/update-node-parsing 2023-06-26 17:32:44 +12:00
Eugene Brodsky
7b97639961
Merge branch 'main' into lstein/installer-for-new-model-layout 2023-06-26 01:24:30 -04:00
psychedelicious
60780e990d fix(ui): fix controlnet image size 2023-06-26 12:03:11 +10:00
psychedelicious
8d43cf92f6 feat(ui): update action santizer for schema actions 2023-06-26 12:00:38 +10:00
psychedelicious
862bf7546c feat(ui): improved node parsing
- use `swagger-parser` to dereference openapi schema
- tidy vite plugins
- use mantine select for node add menu
2023-06-26 11:53:54 +10:00
Sergey Borisov
91c3a58fb6 Fix lycoris layers init 2023-06-26 04:33:37 +03:00
Sergey Borisov
5cebf67ee4 Apply lora by patching lora instead of hooks 2023-06-26 03:57:33 +03:00
Sergey Borisov
1ba94a92b3 Fixes 2023-06-26 03:54:42 +03:00
Sergey Borisov
23c22ac933 Refactor logic/small fixes 2023-06-26 03:07:54 +03:00
Lincoln Stein
160b5d7992 add support for an autoimport models directory scanned at startup time 2023-06-25 18:50:15 -04:00
user1
10e8389fa4 Commenting out LeReS ControlNet image preprocessor until release of controlnet_aux v0.0.6 (supported on controlnet_aux current main, but not on latest release v0.0.5) 2023-06-25 14:25:14 -07:00
user1
414a04774c Added LeReS ControlNet image preprocessor. 2023-06-25 14:19:55 -07:00
Lincoln Stein
c91d1eacba Merge branch 'lstein/installer-for-new-model-layout' of github.com:invoke-ai/InvokeAI into lstein/installer-for-new-model-layout 2023-06-25 16:04:48 -04:00
Lincoln Stein
60b37b7ff4 fix model manager documentation 2023-06-25 16:04:43 -04:00
user1
b872e7a5e0 Simplifying ControlNet SAM preprocessor segmentation color mapping. 2023-06-25 12:54:48 -07:00
user1
de4064bdac Fixed problem with with non-reproducible results from ControlNet SegmentAnything preprocessor. Cause was controlnet_aux randomization of segmentation coloring, which seems to lead to some randomization of resulting images using ControlNet seg model. Switched to using deterministic ADE20K color palette instead, which solved the problem. 2023-06-25 12:38:17 -07:00
user1
10c3753d7f Added SAM preprocessor 2023-06-25 11:16:39 -07:00
Sergey Borisov
a3c22b5fe6 Remove upcast_attention and prediction_type from stable diffusion model logic, fix ckpt conversion according to this 2023-06-25 21:06:22 +03:00
psychedelicious
57e719702d fix(ui): add missing ControlNetInvocation type; tidy schema-derived types 2023-06-25 14:04:53 +10:00
psychedelicious
11378a9236 chore(ui): regen api schema 2023-06-25 14:04:16 +10:00
psychedelicious
132829c88f fix(ui): fix path of generated schema types 2023-06-25 14:04:00 +10:00
blessedcoolant
4d4b5b56dc
Merge branch 'main' into feat/controlnet-control-modes 2023-06-25 15:48:07 +12:00
psychedelicious
6b276587d8 chore(ui): bump all packages
Everything seems to be working.

- Due to a change to `reactflow`, I regenerated `yarn.lock`
- New chakra CLI fixes issue I had made a patch for; removed the patch
- Change to fontsource changed how we import that font
- Change to fontawesome means we lost the txt2img tab icon, just chose a similar one
2023-06-25 13:44:10 +10:00
user1
c5faffc18b Merge branch 'main' of github.com:invoke-ai/InvokeAI into feat/controlnet-control-modes
Only "real" conflicts were in:
     invokeai/frontend/web/src/features/controlNet/components/ControlNet.tsx
     invokeai/frontend/web/src/features/controlNet/store/controlNetSlice.ts
2023-06-24 17:05:57 -07:00
Lincoln Stein
c3c4a71173 implemented Stalker's suggested improvements 2023-06-24 12:37:26 -04:00
Lincoln Stein
d5f742620f Merge branch 'main' into lstein/installer-for-new-model-layout 2023-06-24 11:58:06 -04:00
Lincoln Stein
ba1371a88f rename ModelType.Pipeline to ModelType.Main 2023-06-24 11:45:49 -04:00
psychedelicious
3ae996ebcb fix(ui): fix metadata viewer too stronk 2023-06-24 18:15:49 +10:00
psychedelicious
3d16605762 fix(ui): fix controlnet upload button 2023-06-24 18:15:49 +10:00
psychedelicious
b6dec2b826 fix(ui): fix controlnet dnd overlay not showing on dragover 2023-06-24 18:15:49 +10:00
psychedelicious
013e2aa2a1 fix(ui): fix control image sizes
they were all weird
2023-06-24 18:15:49 +10:00
psychedelicious
8f9fa15fc8 fix(ui): fix image fetching query string 2023-06-24 18:15:49 +10:00
psychedelicious
dde497404b fix(ui): fix init image display buttons
- Reset and Upload buttons along top of initial image
- Also had to mess around with the control net & DnD image stuff after changing the styles
- Abstract image upload logic into hook - does not handle native HTML drag and drop upload - only the button click upload
2023-06-24 18:15:49 +10:00
psychedelicious
0472b33164 fix(ui): fix duplicate is_intermediate query param when fetching images 2023-06-24 17:57:39 +10:00
psychedelicious
a6c615a98c fix(ui): fix canvas staging area
Missed some of the `imageUpdated` stuff
2023-06-24 17:57:39 +10:00
psychedelicious
bab3a9504e fix(nodes): fix LatentsToImage not using is_intermediate when creating images
Appears this was removed during a merge conflict resolution.
2023-06-24 17:57:39 +10:00
psychedelicious
13f25edb1e fix(ui): fix incorrect boards endpoint matchers being used
Should fix some stale-data issues with the auto-adding of images to selected boards, and deleting images from boards.
2023-06-24 17:57:39 +10:00
psychedelicious
8bacee115a fix(ui): fix thunks not using configured api client 2023-06-24 17:57:39 +10:00
psychedelicious
3619c86f07 fix(ui): fix deleting image does not refresh board
I had some some wonkiness in the thunks
2023-06-24 17:57:39 +10:00
psychedelicious
8e724b5abe fix(ui): fix image upload
`openapi-fetch` does not handle non-JSON `body`s, always stringifying them, and sets the `content-type` to `application/json`.

The patch here does two things:
- Do not stringify `body` if it is one of the types that should not be stringified (https://developer.mozilla.org/en-US/docs/Web/API/Fetch_API/Using_Fetch#body)
- Do not add `content-type: application/json` unless it really is stringified JSON.

Upstream issue: https://github.com/drwpow/openapi-typescript/issues/1123

I'm not a bit lost on fixing the types and adding tests, so not raising a PR upstream.
2023-06-24 17:57:39 +10:00
psychedelicious
e076231398 fix(ui): fix node editor image fields
I had broken this when converting to rtk-query
2023-06-24 17:57:39 +10:00
psychedelicious
e386b5dc53 feat(ui): api layer refactor
*migrate from `openapi-typescript-codegen` to `openapi-typescript` and `openapi-fetch`*

`openapi-typescript-codegen` is not very actively maintained - it's been over a year since the last update.
`openapi-typescript` and `openapi-fetch` are part of the actively maintained repo. key differences:

- provides a `fetch` client instead of `axios`, which means we need to be a bit more verbose with typing thunks
- fetch client is created at runtime and has a very nice typescript DX
- generates a single file with all types in it, from which we then extract individual types. i don't like how verbose this is, but i do like how it is more explicit.
- removed npm api generation scripts - now we have a single `typegen` script

overall i have more confidence in this new library.

*use nanostores for api base and token*

very simple reactive store for api base url and token. this was suggested in the `openapi-fetch` docs and i quite like the strategy.

*organise rtk-query api*

split out each endpoint (models, images, boards, boardImages) into their own api extensions. tidy!
2023-06-24 17:57:39 +10:00
Mary Hipp
8137a99981 simplify 2023-06-24 17:57:39 +10:00
Mary Hipp
878847defd use BASE and TOKEN from OpenAPI if they are set 2023-06-24 17:57:39 +10:00
Lincoln Stein
539d1f3bde remove redundant prediction_type and attention_upscaling flags 2023-06-23 16:54:52 -04:00
Lincoln Stein
466ec3ab5e add router API support for model manager heuristic_import()` 2023-06-23 16:35:39 -04:00
Lincoln Stein
54b74427f4 adjust for change in list_models() API 2023-06-23 14:13:37 -04:00
Lincoln Stein
58d1857ab6 merge with main 2023-06-23 13:57:25 -04:00
Lincoln Stein
3043af4620 implement vae passthru 2023-06-23 13:56:30 -04:00
Lincoln Stein
56bd873d7a make relative model paths work in model manager 2023-06-23 10:52:59 -04:00
Sergey Borisov
5aaaaf64a1 Fix ckpt conversion 2023-06-23 17:29:54 +03:00
StAlKeR7779
9140e2c0f2
Merge branch 'main' into fix/vae_conversion 2023-06-23 15:03:59 +03:00
Lincoln Stein
a910403003 correctly migrate models that have relative paths 2023-06-22 21:10:31 -04:00
Lincoln Stein
c7b7e087e4
Merge branch 'main' into lstein/installer-for-new-model-layout 2023-06-23 01:45:05 +01:00
Lincoln Stein
d65c833b90 migration now integrated into invokeai-configure 2023-06-22 16:44:55 -04:00
Lincoln Stein
33b04f6386 migration script working well 2023-06-22 15:47:12 -04:00
psychedelicious
339e7ce213 feat(ui): initial implementation of model loading
- Update model listing code to use `rtk-query`
- Update all graph generation to use new `pipeline_model_loader` node
2023-06-22 17:48:57 +10:00
psychedelicious
2a178f5a25 chore(ui): regen api client 2023-06-22 17:48:13 +10:00
psychedelicious
1bc170727b tidy(nodes): rename sd_model_loader to pipeline_model_loader
this is more accurate bc it can do eg kandinsky also
2023-06-22 17:47:58 +10:00
psychedelicious
3722cdf5d6 chore(ui): regen api client 2023-06-22 17:36:20 +10:00
psychedelicious
42a59aa147 feat(nodes): add sd_model_loader node
Loads any pipeline model.

Also introduced is `PipelineModelField`, which includes a model name and base model.
2023-06-22 17:36:05 +10:00
psychedelicious
b937b7da01 feat(models): update model manager service & route to return list of models 2023-06-22 17:34:12 +10:00
Sergey Borisov
21245a0fb2 Set model type to const value in openapi schema, add model format enums to model schema(as they not not referenced in case of Literal definition) 2023-06-22 16:51:53 +10:00
Sergey Borisov
da566b59e8 Update model format field to use enums 2023-06-22 16:51:53 +10:00
Sergey Borisov
e4dc9c5a04 Rename format to model_format(still named format when work with config) 2023-06-22 16:51:53 +10:00
Sergey Borisov
aceadacad4 Remove default model logic 2023-06-22 16:51:53 +10:00
blessedcoolant
d3dec59cc3 tweal: UI colors 2023-06-22 16:51:53 +10:00
blessedcoolant
6c98700740 fix: Adjust the Schedular select width
So the long names do not get cut off.
2023-06-22 16:51:53 +10:00
blessedcoolant
c4c3c96062 Revert "feat: Port Schedulers to Mantine"
This reverts commit e0c105f413.
2023-06-22 16:51:35 +10:00
blessedcoolant
6256be480c fix: Remove type from Model type name 2023-06-22 16:48:35 +10:00
blessedcoolant
7033071934 fix: Unserialization key issue 2023-06-22 16:48:35 +10:00
blessedcoolant
e48528bbef revert: getModels to receivedModels 2023-06-22 16:48:35 +10:00
blessedcoolant
6bdf68dd4c feat: Port Schedulers to Mantine 2023-06-22 16:48:35 +10:00
blessedcoolant
0c3616229e cleanup: Updated model slice names to be more descriptive
Basically updated all slices to be more descriptive in their names. Did so in order to make sure theres good naming scheme available for secondary models.
2023-06-22 16:43:14 +10:00
blessedcoolant
604cc1adcd wip: Move Model Selector to own file 2023-06-22 16:43:14 +10:00
blessedcoolant
4847212d5b feat: Enable 2.x Model Generation in Linear UI 2023-06-22 16:43:14 +10:00
blessedcoolant
727293d722 fix: 2.1 models breaking generation
Co-Authored-By: StAlKeR7779 <7768370+StAlKeR7779@users.noreply.github.com>
2023-06-22 16:42:59 +10:00
blessedcoolant
d2f3500e1b chore: Rebuild API - base_model and type added 2023-06-22 16:42:59 +10:00
Sergey Borisov
ef83a2fffe Add name, base_mode, type fields to model info 2023-06-22 16:42:51 +10:00
blessedcoolant
f8d7477c7a wip: Add 2.x Models to the Model List 2023-06-22 16:42:51 +10:00
blessedcoolant
e374211313 chore: Rebuild API with new Model API names 2023-06-22 16:41:31 +10:00
Sergey Borisov
01d17601b8 Generate config names for openapi 2023-06-22 16:41:19 +10:00
blessedcoolant
bf0d5f4cfc fix: Update missing name types to new names 2023-06-22 16:41:02 +10:00
blessedcoolant
663f4935f5 chore: Rebuild API 2023-06-22 16:41:02 +10:00
blessedcoolant
9838dda1b7 chore: Update model config type names 2023-06-22 16:40:40 +10:00
psychedelicious
2d889e133d chore(ui): regen api client 2023-06-22 16:25:49 +10:00
psychedelicious
6779f1a5ad fix(db): update models for boards w/ nullable deleted_at 2023-06-22 16:25:49 +10:00
psychedelicious
19a6e5dad8 chore(ui): regen api client 2023-06-22 16:25:49 +10:00
psychedelicious
285195bf72 feat(api): add get_board route 2023-06-22 16:25:49 +10:00
psychedelicious
10008859a4 tidy(ui): remove all refs to boards thunks 2023-06-22 16:25:49 +10:00
psychedelicious
3c04340f3f tidy(ui): tidy up update image board modal 2023-06-22 16:25:49 +10:00
psychedelicious
79f0c4d3c4 feat(ui): add remove from board to image context menu 2023-06-22 16:25:49 +10:00
psychedelicious
37d4e05838 fix(ui): fix board's image list not updating when image removed from board 2023-06-22 16:25:49 +10:00
psychedelicious
a00ad6ac03 feat(ui): dropping image on All Images board removes it from board 2023-06-22 16:25:49 +10:00
psychedelicious
2ffead000c tidy(ui): remove console.log() 2023-06-22 16:25:49 +10:00
psychedelicious
922319cb84 fix(ui): fix first added board doesn't show until refresh
Had incorrect `invalidatesTags` array for the mutation.
2023-06-22 16:25:49 +10:00
psychedelicious
6ee0e197bb feat(db): add deleted_at to board_images 2023-06-22 16:25:49 +10:00
psychedelicious
d3e6f0130c fix(ui): fix issue with gallery not letting you load more images
To determine whether the Load More button should work, we need to keep track of how many images are left to load for a given board or category.

The Assets tab doesn't work, though. Need to figure out a better way to handle this.
2023-06-22 16:25:49 +10:00
psychedelicious
421c23d3ea fix(ui): fix gallery image fetching for board categories 2023-06-22 16:25:49 +10:00
psychedelicious
4545f3209f fix(ui): fix bug with image deletion not removing image from gallery 2023-06-22 16:25:49 +10:00
psychedelicious
e2ee8102c2 tidy(db): tidy image_record_storage.py 2023-06-22 16:25:49 +10:00
psychedelicious
083a0fc4cf tidy(ui): remove references to boardsAdapter 2023-06-22 16:25:49 +10:00
psychedelicious
26b75b85f7 fix(ui): if deleting selected board, deselect it 2023-06-22 16:25:49 +10:00
psychedelicious
f560a462a0 feat(ui): rudimentary categorized gallery image fetching 2023-06-22 16:25:49 +10:00
psychedelicious
d501986610 chore(ui): regen api client 2023-06-22 16:25:49 +10:00
psychedelicious
67a75f6895 feat(api, db): support board_id filter on images service get_many() 2023-06-22 16:25:49 +10:00
psychedelicious
3c032c0767 feat(ui): only auto-add image to board if is not intermediate 2023-06-22 16:25:49 +10:00
psychedelicious
abd6561140 feat(ui): just fetch all boards instead of paginating them 2023-06-22 16:25:49 +10:00
psychedelicious
bd533426fc feat(ui): first pass at boards styling 2023-06-22 16:25:49 +10:00
psychedelicious
2489d5459f chore(ui): regen api client 2023-06-22 16:25:49 +10:00
psychedelicious
ac477cf5d6 fix(ui): improve image deletion handling 2023-06-22 16:25:49 +10:00
psychedelicious
be3bdae847 fix: resolve rebase conflicts 2023-06-22 16:25:49 +10:00
psychedelicious
3e0ee838cf fix(ui): add initial image dimensions to state
We need to access the initial image dimensions during the creation of the `ImageToImage` graph to determine if we need to resize the image.

Because the `initialImage` is now just an image name, we need to either store (easy) or dynamically retrieve its dimensions during graph creation (a bit less easy).

Took the easiest path. May need to revise this in the future.
2023-06-22 16:25:49 +10:00
psychedelicious
8d3bec57d5 feat(ui): store only image name in parameters
Images that are used as parameters (e.g. init image, canvas images) are stored as full `ImageDTO` objects in state, separate from and duplicating any object representing those same objects in the `imagesSlice`.

We cannot store only image names as parameters, then pull the full `ImageDTO` from `imagesSlice`, because if an image is not on a loaded page, it doesn't exist in `imagesSlice`. For example, if you scroll down a few pages in the gallery and send that image to canvas, on reloading the app, the canvas will be unable to load that image.

We solved this temporarily by storing the full `ImageDTO` object wherever it was needed, but this is both inefficient and allows for stale `ImageDTO`s across the app.

One other possible solution was to just fetch the `ImageDTO` for all images at startup, and insert them into the `imagesSlice`, but then we run into an issue where we are displaying images in the gallery totally out of context.

For example, if an image from several pages into the gallery was sent to canvas, and the user refreshes, we'd display the first 20 images in gallery. Then to populate the canvas, we'd fetch that image we sent to canvas and add it to `imagesSlice`. Now we'd have 21 images in the gallery: 1 to 20 and whichever image we sent to canvas. Weird.

Using `rtk-query` solves this by allowing us to very easily fetch individual images in the components that need them, and not directly interact with `imagesSlice`.

This commit changes all references to images-as-parameters to store only the name of the image, and not the full `ImageDTO` object. Then, we use an `rtk-query` generated `useGetImageDTOQuery()` hook in each of those components to fetch the image.

We can use cache invalidation when we mutate any image to trigger automated re-running of the query and all the images are automatically kept up to date.

This also obviates the need for the convoluted URL fetching scheme for images that are used as parameters. The `imagesSlice` still need this handling unfortunately.
2023-06-22 16:25:49 +10:00
psychedelicious
cfda128e06 feat(ui): wip boards via rtk-query 2023-06-22 16:25:49 +10:00
psychedelicious
661a94b3de feat(db): add get_all() method for boards
This is needed to show the full list of boards in the update boards modal.
2023-06-22 16:25:49 +10:00
psychedelicious
9ef64016c7 feat(db): sort board by created_at 2023-06-22 16:25:49 +10:00
psychedelicious
21f0d0b0c1 fix(db): fix deserialize_board_record()
It was not adding `cover_image_name`
2023-06-22 16:25:49 +10:00
psychedelicious
8bce234542 feat(db): update image-board relationships on add
Functionally, `add_image_to_board()` now moves images between boards.
2023-06-22 16:25:49 +10:00
psychedelicious
daadf6ebfd feat(ui): add board image count badge 2023-06-22 16:25:49 +10:00
Mary Hipp
fe10a9f747 render cover image based on URL in image entities 2023-06-22 16:25:49 +10:00
Mary Hipp
7a2d3f628a add boardToAddTo state so that result can be added to board when generation is complete 2023-06-22 16:25:49 +10:00
Mary Hipp
4defb92105 handle long board names 2023-06-22 16:25:49 +10:00
Mary Hipp
f9f3c91a83 drag and drop to move image to board, a bit of board list UI 2023-06-22 16:25:49 +10:00
maryhipp
95b9c8e505 return cover_image_name since urls change, override one from db for now 2023-06-22 16:25:49 +10:00
psychedelicious
49a02c157b feat(ui): fix UpdateImageBoardModal select 2023-06-22 16:25:49 +10:00
psychedelicious
d604d986f9 feat(db, api): update get_board_for_image & service dependencies
- previously was `get_boards_for_image`, returning a list of `BoardDTO`, now returns a single `board_id`
2023-06-22 16:25:49 +10:00
psychedelicious
70cc037a9c fix(ui): do not persist boards 2023-06-22 16:25:49 +10:00
psychedelicious
e4893e4031 fix(db): return board records from CRUD methods 2023-06-22 16:25:49 +10:00
maryhipp
4a0a718b96 foiled by a comma 2023-06-22 16:25:49 +10:00
maryhipp
ca8f1a7828 (api) use most recently generated image for cover photo 2023-06-22 16:25:49 +10:00
Mary Hipp
2e41af2109 [half-baked] adding image to board modal 2023-06-22 16:25:49 +10:00
Mary Hipp
bd29e5e655 UI tweaks 2023-06-22 16:25:49 +10:00
Mary Hipp
dcfee2e1e4 add searching to boards list 2023-06-22 16:25:49 +10:00
Mary Hipp
8aac683319 can delete and rename boards 2023-06-22 16:25:49 +10:00
psychedelicious
d306a84447 feat(ui): rough out boards UI 2023-06-22 16:25:49 +10:00
psychedelicious
5865ecd530 feat(db): add FK for boards.cover_image_name 2023-06-22 16:25:49 +10:00
psychedelicious
e1f9685b02 feat(db): add index for boards 2023-06-22 16:25:49 +10:00
psychedelicious
498bf0d0ba feat(db): add indices for board_images 2023-06-22 16:25:49 +10:00
psychedelicious
163ef2c941 feat(ui): remove refs to BoardRecord in UI
UI should only work w/ BoardDTO
2023-06-22 16:25:49 +10:00
psychedelicious
48193b7fa7 chore(ui): regen api client 2023-06-22 16:25:49 +10:00
psychedelicious
dd1b3c9f35 fix(api): update API models to use BoardDTOs 2023-06-22 16:25:49 +10:00
psychedelicious
4b32322a58 feat(nodes): make board <> images a one-to-many relationship
we can extend this to many-to-many in the future if desired.
2023-06-22 16:25:49 +10:00
Mary Hipp
e06c43adc8 lint fix 2023-06-22 16:25:49 +10:00
Mary Hipp
c009f46b00 regenerate api schema 2023-06-22 16:25:49 +10:00
maryhipp
748016bdab routes working 2023-06-22 16:25:49 +10:00
psychedelicious
72e9ced889 feat(nodes): add boards and board_images services 2023-06-22 16:25:49 +10:00
maryhipp
3833304f57 [WIP] board list endpoint w cover photos 2023-06-22 16:25:49 +10:00
maryhipp
4bfaae6617 fix type 2023-06-22 16:25:49 +10:00
maryhipp
499a174832 some more 2023-06-22 16:25:49 +10:00
maryhipp
6ca5ad9075 filter images by board_id 2023-06-22 16:25:49 +10:00
maryhipp
a121e6b3a0 add board_id association to image 2023-06-22 16:25:49 +10:00
maryhipp
207602f425 remove unused 2023-06-22 16:25:49 +10:00
maryhipp
a1671519d5 board CRUD 2023-06-22 16:25:49 +10:00
Lincoln Stein
1c31efa57c punctuation fix in user message 2023-06-21 09:37:24 -04:00
Lincoln Stein
b727442f84 better window size behavior under alacritty & terminator 2023-06-21 09:32:58 -04:00
Lincoln Stein
90df316835
Merge branch 'main' into lstein/installer-for-new-model-layout 2023-06-20 22:50:41 +01:00
Lincoln Stein
2fc19d9afa suppress description in "other models" tab for space reasons 2023-06-20 11:45:37 -04:00
Lincoln Stein
ac6403f877 address some of ebr issues 2023-06-20 11:08:27 -04:00
Lincoln Stein
678bb4fe10 Merge branch 'lstein/installer-for-new-model-layout' of github.com:invoke-ai/InvokeAI into lstein/installer-for-new-model-layout 2023-06-20 09:42:21 -04:00
Lincoln Stein
294b1e83e6 test and fix edge cases 2023-06-20 09:42:10 -04:00
blessedcoolant
4f5693040e
Merge branch 'main' into fix/inpaint_new_manager 2023-06-19 22:55:00 +12:00
psychedelicious
41442eb7f6 feat(ui): convert canvas txt2img & img2img to latents
- Add graph builders for canvas txt2img & img2img - they are mostly copy and paste from the linear graph builders but different in a few ways that are very tricky to work around. Just made totally new functions for them.
- Canvas txt2img and img2img support ControlNet (not inpaint/outpaint). There's no way to determine in real-time which mode the canvas is in just yet, so we cannot disable the ControlNet UI when the mode will be inpaint/outpaint - it will always display. It's possible to determine this in near-real-time, will add this at some point.
- Canvas inpaint/outpaint migrated to use model loader, though inpaint/outpaint are still using the non-latents nodes.
2023-06-19 15:57:28 +10:00
psychedelicious
223a679ac1 chore(ui): regen api client 2023-06-19 15:57:28 +10:00
psychedelicious
3c60616b4d feat(ui): simplify linear graph creation logic
Instead of manually creating every node and edge, we can simply copy/paste the base graph from node editor, then sub in parameters.

This is a much more intelligible process. We still need to handle seed, img2img fit and controlnet separately.
2023-06-19 15:57:28 +10:00
Sergey Borisov
a01998d095 Remove more old logic 2023-06-19 15:57:28 +10:00
Sergey Borisov
7b35162b9e Remove old logic except for inpaint, add support for lora and ti to inpaint node 2023-06-19 15:57:28 +10:00
Sergey Borisov
c26e1a9271 Rewrite inpaint node to new model manager, remove TextToImage and ImageToImage nodes 2023-06-19 15:57:28 +10:00
Sergey Borisov
9b32407744 Provide generator to all schedulers step function to make both ancestral and sde schedulers reproducible 2023-06-19 00:34:01 +03:00
Sergey Borisov
82091b9a66 Fix vae conversion 2023-06-18 23:46:07 +03:00
Sergey Borisov
f3d9797ebe Add dpmpp_sde and dpmpp_2m_sde schedulers(with karras) 2023-06-18 23:38:15 +03:00
blessedcoolant
80a8d3ef28 style: Theme placeholder style for IAIMantineMultiSelect 2023-06-18 22:17:09 +12:00
blessedcoolant
f4ca9d0e09 Merge branch 'scheduler-select' of https://github.com/blessedcoolant/InvokeAI into scheduler-select 2023-06-18 22:05:12 +12:00
blessedcoolant
a960fa009d fix: Fix some styling issues with IAIMantineMultiSelect 2023-06-18 22:04:12 +12:00
psychedelicious
b96b95bc95 feat(ui): enabledSchedulers -> favoriteSchedulers 2023-06-18 20:01:05 +10:00
psychedelicious
450641c414 fix(ui): enable all schedulers by default 2023-06-18 19:39:31 +10:00
psychedelicious
94cfcdc411 feat(ui): improve scheduler selection logic
- remove UI-specific state (the enabled schedulers) from redux, instead derive it in a selector
- simplify logic by putting schedulers in an object instead of an array
- rename `activeSchedulers` to `enabledSchedulers`
- remove need for `useEffect()` when `enabledSchedulers` changes by adding a listener for the `enabledSchedulersChanged` action/event to `generationSlice`
- increase type safety by making `enabledSchedulers` an array of `SchedulerParam`, which is created by the zod schema for scheduler
2023-06-18 19:34:37 +10:00
psychedelicious
150059f704 fix(ui): create all scheduler constants up-front 2023-06-18 18:49:10 +10:00
psychedelicious
f1a8b9daee fix(ui): clarify scheduler logic
- use full conditional syntax with `{}`
- do not mutate `action.payload` in a reducer
2023-06-18 18:47:59 +10:00
blessedcoolant
be8c0bb952 feat: Use Labels for Schedulers 2023-06-18 20:17:51 +12:00
blessedcoolant
dae5b9b259 fix: Minor styling fix to the IAIMantineMultiSelect component 2023-06-18 20:06:56 +12:00
blessedcoolant
06428fac67 fix: Revert scheduler back to zod validation 2023-06-18 20:02:36 +12:00
blessedcoolant
59b5dfc3e0 feat: Port Schedulers to Mantine 2023-06-18 19:47:27 +12:00
Lincoln Stein
e1d53b86f3
Merge branch 'main' into lstein/installer-for-new-model-layout 2023-06-17 16:26:56 -07:00
Lincoln Stein
ddb3f4b02b make configure script work properly on empty rootdir 2023-06-17 19:26:35 -04:00
Sergey Borisov
6b7cf3f3be Add lms and dpmpp2_s karras scheduler 2023-06-17 21:00:16 +03:00
Lincoln Stein
f28d50070e configure/install basically working; needs edge case testing 2023-06-16 22:54:36 -04:00
Lincoln Stein
ada7399753 rewrite of widget display - marshalling needs rewrite 2023-06-15 23:32:33 -04:00
Sergey Borisov
5f2d07917d Fix lora import, fix sd2 config, fix list models api 2023-06-15 21:30:15 +03:00
Lincoln Stein
82c2498043
Merge branch 'main' into lstein/new-model-manager 2023-06-14 08:41:40 -07:00
blessedcoolant
4ca325e8e6 chore: Rebuild API 2023-06-15 03:20:49 +12:00
blessedcoolant
6b8e88ad7f Merge branch 'main' into feat/controlnet-control-modes 2023-06-15 03:18:41 +12:00
psychedelicious
b8e32fa459 chore(ui): regen api client 2023-06-15 01:05:16 +10:00
psychedelicious
34ebee67b7 fix(nodes): fix revert conflict 2023-06-15 01:05:16 +10:00
psychedelicious
e0c998d192 Revert "feat(ui): add warning socket event handling"
This reverts commit e7a61e631a42190e4b64e0d5e22771c669c5b30c.
2023-06-15 01:05:16 +10:00
psychedelicious
b51e9a6bdb Revert "feat(nodes): add warning socket event"
This reverts commit cefdd9d634e515239bd85666c872a0d64bb9d772.
2023-06-15 01:05:16 +10:00
psychedelicious
09f396ce84 feat(ui): add warning socket event handling 2023-06-15 01:05:16 +10:00
psychedelicious
abee37eab3 feat(nodes): add warning socket event 2023-06-15 01:05:16 +10:00
psychedelicious
42e48b2bef feat(nodes): add dynamic prompt node 2023-06-15 01:05:16 +10:00
psychedelicious
f9d5f9d52c fix(nodes): minor fixes for folder validation
- fix type for `__output_folder`
- prefix `validate_storage_folders()` with `__` to indicate private method
2023-06-15 00:40:39 +10:00
StAlKeR7779
d0ee3558d1
Merge branch 'main' into lstein/new-model-manager 2023-06-14 17:29:01 +03:00
blessedcoolant
587297878a refactor(minor): Latent Disk Storage 2023-06-15 02:21:49 +12:00
blessedcoolant
b4c998a9ae refactor(minor): Image File Storage 2023-06-15 01:58:58 +12:00
psychedelicious
88e8e3977b feat(ui): update UI to not use image_origin
see commit `8ad8de8: feat(nodes): remove `image_origin` from most places` for details.
2023-06-14 23:08:27 +10:00
psychedelicious
24b86cffe9 chore(ui): regen api client & types 2023-06-14 23:08:27 +10:00
psychedelicious
a1773197e9 feat(nodes): remove image_origin from most places
- remove `image_origin` from most places where we interact with images
- consolidate image file storage into a single `images/` dir

Images have an `image_origin` attribute but it is not actually used when retrieving images, nor will it ever be. It is still used when creating images and helps to differentiate between internally generated images and uploads.

It was included in eg API routes and image service methods as a holdover from the previous app implementation where images were not managed in a database. Now that we have images in a db, we can do away with this and simplify basically everything that touches images.

The one potentially controversial change is to no longer separate internal and external images on disk. If we retain this separation, we have to keep `image_origin` around in a number of spots and it getting image paths on disk painful.

So, I am have gotten rid of this organisation. Images are now all stored in `images`, regardless of their origin. As we improve the image management features, this change will hopefully become transparent.
2023-06-14 23:08:27 +10:00
blessedcoolant
6c53abc034 feat: Add ControlMode to Linear UI 2023-06-14 20:01:17 +12:00
blessedcoolant
eb7047b21d chore: Rebuild WebAPI 2023-06-14 19:26:02 +12:00
blessedcoolant
43419ac761 Merge branch 'main' into feat/controlnet-control-modes 2023-06-14 19:04:42 +12:00
user1
5cd0e90816 Renamed ControlNet control_mode option "even_more_control" to "unbalanced" 2023-06-13 22:30:17 -07:00
user1
cfd49e3921 Removing vestigial comments. 2023-06-13 21:33:15 -07:00
user1
a8e0490133 Merge branch 'feat/controlnet-control-modes' of https://github.com/invoke-ai/InvokeAI into feat/controlnet-control-modes 2023-06-13 21:21:13 -07:00
psychedelicious
1e08d865c9 chore: dummy commit to trigger actions 2023-06-14 14:14:24 +10:00
blessedcoolant
f8bb650cc1 revert: IAIScrollArea 2023-06-14 14:14:24 +10:00
psychedelicious
2cee8bebb2 fix(ui): revert offset scrollbars
The wonky padding is too janky. Just overlay for now.
2023-06-14 14:14:24 +10:00
psychedelicious
ade4ec5fd8 fix(ui): fix crash when toggling pinned parameters panel 2023-06-14 14:14:24 +10:00
psychedelicious
70ffd6b03f fix(ui): fix controlnet selects data types 2023-06-14 14:14:24 +10:00
psychedelicious
6c551df311 fix(ui): fix rebase conflicts 2023-06-14 14:14:24 +10:00
blessedcoolant
24f605629e cleanup: Remove OverlayScrollable component 2023-06-14 14:14:24 +10:00
blessedcoolant
2af1ec9d02 fix: Minor padding issue in unpinned drawer 2023-06-14 14:14:24 +10:00
blessedcoolant
79d53341de fix: Stretch scroll area so it retains parent width 2023-06-14 14:14:24 +10:00
blessedcoolant
e40b3506c4 fix: Options squishing on accordion collapse 2023-06-14 14:14:24 +10:00
blessedcoolant
33912382e3 feat: Introduce Mantine's ScrollArea 2023-06-14 14:14:24 +10:00
blessedcoolant
d282810e53 cleanup: Remove IAICustomSelect and port types 2023-06-14 14:14:24 +10:00
psychedelicious
9df502fc77 fix(ui): fix mantine select props 2023-06-14 14:14:24 +10:00
psychedelicious
705573f0a8 feat(ui): even more pedantic mantine select theming 2023-06-14 14:14:24 +10:00
blessedcoolant
1878ea94f6 feat: Port Canvas Layer Select to IAIMantineSelect 2023-06-14 14:14:24 +10:00
psychedelicious
4ba5086b9a feat(ui): add tooltip to IAIMantineSelect 2023-06-14 14:14:24 +10:00
psychedelicious
4a991b4daa feat(ui): more pedantic mantine select theming 2023-06-14 14:14:24 +10:00
psychedelicious
80474d26f9 feat(ui): mantine scrollbar theming 2023-06-14 14:14:24 +10:00
blessedcoolant
9a77bd9140 feat: Port IAISelect's to IAIMantineSelect's
Ported everything except Model Manager selects and the Canvas Layer Select (this needs tooltip support)
2023-06-14 14:14:24 +10:00
psychedelicious
14cdc800c3 feat(ui): pedantic mantine select theming 2023-06-14 14:14:24 +10:00
blessedcoolant
9cfbea4c25 feat: Match styling of Mantine Select with InvokeAI 2023-06-14 14:14:24 +10:00
blessedcoolant
5fe674e223 feat: Standardize IAIMantineSelect Component 2023-06-14 14:14:24 +10:00
blessedcoolant
32200efce8 feat: Change default font to Inter 2023-06-14 14:14:24 +10:00
blessedcoolant
68a02da990 feat: Use Mantine Select for Scheduler 2023-06-14 14:14:24 +10:00
blessedcoolant
5b20766ea3 chore: Move Mantine Theme Override to own file 2023-06-14 14:14:24 +10:00
blessedcoolant
9a914250a0 feat: Change Model Select To Mantine 2023-06-14 14:14:24 +10:00
blessedcoolant
0e3106f631 feat: Add Mantine Support 2023-06-14 14:14:24 +10:00
user1
de3e6cdb02 Switched over to ControlNet control_mode with 4 options: balanced, more_prompt, more_control, even_more_control. Based on True/False combinations of internal booleans cfg_injection and soft_injection 2023-06-13 21:08:34 -07:00
Sergey Borisov
6c5954f9d1 Add controlnet to model manager, fixes 2023-06-14 04:26:21 +03:00
Sergey Borisov
740c05a0bb Save models on rescan, uncache model on edit/delete, fixes 2023-06-14 03:12:12 +03:00
Sergey Borisov
26090011c4 Fix conflict resolve, add model configs to type annotation 2023-06-14 00:26:37 +03:00
StAlKeR7779
c9ae26a176
Merge branch 'main' into lstein/new-model-manager 2023-06-13 23:37:52 +03:00
Sergey Borisov
e7db6d8120 Fix ckpt and vae conversion, migrate script, remove sd2-base 2023-06-13 18:05:12 +03:00
user1
8495764d45 Moving from ControlNet guess_mode to separate booleans for cfg_injection and soft_injection for testing control modes 2023-06-13 00:41:36 -07:00
user1
8b7fac75ed First pass at ControlNet "guess mode" implementation. 2023-06-13 00:41:36 -07:00
user1
9e0e26f4c4 Moving from ControlNet guess_mode to separate booleans for cfg_injection and soft_injection for testing control modes 2023-06-12 23:57:57 -07:00
Lincoln Stein
87ba17a1f5 add migration script and update convert and face restoration paths 2023-06-13 01:27:51 -04:00
Lincoln Stein
1439dc7712 Add SchedulerPredictionType and ModelVariantType enums 2023-06-12 16:07:04 -04:00
blessedcoolant
2a814d886b
Merge branch 'main' into diffusers-upgrade 2023-06-13 05:29:15 +12:00
psychedelicious
60a2fbec41 feat(ui): improve controlnet-related config types 2023-06-13 00:04:21 +10:00
psychedelicious
f15a328b80 fix(ui): allow controlnet with preprocessed control image 2023-06-13 00:04:21 +10:00
psychedelicious
811d9ab55a fix(ui): disable shouldAutoConfig switch while processing 2023-06-13 00:04:21 +10:00
psychedelicious
e00fed5c46 feat(ui): support disabling controlnet models & processors 2023-06-13 00:04:21 +10:00
psychedelicious
a3fa38b353 fix(ui): revert IAICustomSelect usage to IAISelect
There are some bugs with it that I cannot figure out related to `floating-ui` and `downshift`'s handling of refs.

Will need to revisit this component in the future.
2023-06-13 00:04:21 +10:00
psychedelicious
2e42a4bdd9 feat(ui): disable controlnets during processing 2023-06-13 00:04:21 +10:00
psychedelicious
36f72b5a49 fix(ui): check for valid controlnets before adding to graph 2023-06-13 00:04:21 +10:00
psychedelicious
af42d7d347 feat(ui): support negative controlnet weights 2023-06-13 00:04:21 +10:00
psychedelicious
8607b1994c fix(ui): fix crash when controlnet enabled but no controlnets added 2023-06-13 00:04:21 +10:00
Sergey Borisov
36eb1bd893 Fixes 2023-06-12 16:14:09 +03:00
Sergey Borisov
9fa78443de Fixes, add sd variant detection 2023-06-12 05:52:30 +03:00
Lincoln Stein
893f776f1d model_probe working; model_install incomplete 2023-06-11 19:51:53 -04:00
blessedcoolant
50135b726e fix: git stash 2023-06-12 08:53:09 +12:00
Lincoln Stein
085ab54124 remove modified models.py and migrate code to models/base.py 2023-06-11 16:10:15 -04:00
Lincoln Stein
8e1a56875e remove defunct code 2023-06-11 12:57:06 -04:00
Lincoln Stein
000626ab2e move all installation code out of model_manager 2023-06-11 12:51:50 -04:00
Sergey Borisov
694fd0c92f Fixes, first runable version 2023-06-11 16:42:40 +03:00
user1
fd715026a7 First pass at ControlNet "guess mode" implementation. 2023-06-11 02:00:39 -07:00
Gregg Helt
c647056287
Feat/easy param (#3504)
* Testing change to LatentsToText to allow setting different cfg_scale values per diffusion step.

* Adding first attempt at float param easing node, using Penner easing functions.

* Core implementation of ControlNet and MultiControlNet.

* Added support for ControlNet and MultiControlNet to legacy non-nodal Txt2Img in backend/generator. Although backend/generator will likely disappear by v3.x, right now they are very useful for testing core ControlNet and MultiControlNet functionality while node codebase is rapidly evolving.

* Added example of using ControlNet with legacy Txt2Img generator

* Resolving rebase conflict

* Added first controlnet preprocessor node for canny edge detection.

* Initial port of controlnet node support from generator-based TextToImageInvocation node to latent-based TextToLatentsInvocation node

* Switching to ControlField for output from controlnet nodes.

* Resolving conflicts in rebase to origin/main

* Refactored ControlNet nodes so they subclass from PreprocessedControlInvocation, and only need to override run_processor(image) (instead of reimplementing invoke())

* changes to base class for controlnet nodes

* Added HED, LineArt, and OpenPose ControlNet nodes

* Added an additional "raw_processed_image" output port to controlnets, mainly so could route ImageField to a ShowImage node

* Added more preprocessor nodes for:
      MidasDepth
      ZoeDepth
      MLSD
      NormalBae
      Pidi
      LineartAnime
      ContentShuffle
Removed pil_output options, ControlNet preprocessors should always output as PIL. Removed diagnostics and other general cleanup.

* Prep for splitting pre-processor and controlnet nodes

* Refactored controlnet nodes: split out controlnet stuff into separate node, stripped controlnet stuff form image processing/analysis nodes.

* Added resizing of controlnet image based on noise latent. Fixes a tensor mismatch issue.

* More rebase repair.

* Added support for using multiple control nets. Unfortunately this breaks direct usage of Control node output port  ==> TextToLatent control input port -- passing through a Collect node is now required. Working on fixing this...

* Fixed use of ControlNet control_weight parameter

* Fixed lint-ish formatting error

* Core implementation of ControlNet and MultiControlNet.

* Added first controlnet preprocessor node for canny edge detection.

* Initial port of controlnet node support from generator-based TextToImageInvocation node to latent-based TextToLatentsInvocation node

* Switching to ControlField for output from controlnet nodes.

* Refactored controlnet node to output ControlField that bundles control info.

* changes to base class for controlnet nodes

* Added more preprocessor nodes for:
      MidasDepth
      ZoeDepth
      MLSD
      NormalBae
      Pidi
      LineartAnime
      ContentShuffle
Removed pil_output options, ControlNet preprocessors should always output as PIL. Removed diagnostics and other general cleanup.

* Prep for splitting pre-processor and controlnet nodes

* Refactored controlnet nodes: split out controlnet stuff into separate node, stripped controlnet stuff form image processing/analysis nodes.

* Added resizing of controlnet image based on noise latent. Fixes a tensor mismatch issue.

* Cleaning up TextToLatent arg testing

* Cleaning up mistakes after rebase.

* Removed last bits of dtype and and device hardwiring from controlnet section

* Refactored ControNet support to consolidate multiple parameters into data struct. Also redid how multiple controlnets are handled.

* Added support for specifying which step iteration to start using
each ControlNet, and which step to end using each controlnet (specified as fraction of total steps)

* Cleaning up prior to submitting ControlNet PR. Mostly turning off diagnostic printing. Also fixed error when there is no controlnet input.

* Added dependency on controlnet-aux v0.0.3

* Commented out ZoeDetector. Will re-instate once there's a controlnet-aux release that supports it.

* Switched CotrolNet node modelname input from free text to default list of popular ControlNet model names.

* Fix to work with current stable release of controlnet_aux (v0.0.3). Turned of pre-processor params that were added post v0.0.3. Also change defaults for shuffle.

* Refactored most of controlnet code into its own method to declutter TextToLatents.invoke(), and make upcoming integration with LatentsToLatents easier.

* Cleaning up after ControlNet refactor in TextToLatentsInvocation

* Extended node-based ControlNet support to LatentsToLatentsInvocation.

* chore(ui): regen api client

* fix(ui): add value to conditioning field

* fix(ui): add control field type

* fix(ui): fix node ui type hints

* fix(nodes): controlnet input accepts list or single controlnet

* Moved to controlnet_aux v0.0.4, reinstated Zoe controlnet preprocessor. Also in pyproject.toml  had to specify downgrade of timm to 0.6.13 _after_ controlnet-aux installs timm >= 0.9.2, because timm >0.6.13 breaks Zoe preprocessor.

* Core implementation of ControlNet and MultiControlNet.

* Added first controlnet preprocessor node for canny edge detection.

* Switching to ControlField for output from controlnet nodes.

* Resolving conflicts in rebase to origin/main

* Refactored ControlNet nodes so they subclass from PreprocessedControlInvocation, and only need to override run_processor(image) (instead of reimplementing invoke())

* changes to base class for controlnet nodes

* Added HED, LineArt, and OpenPose ControlNet nodes

* Added more preprocessor nodes for:
      MidasDepth
      ZoeDepth
      MLSD
      NormalBae
      Pidi
      LineartAnime
      ContentShuffle
Removed pil_output options, ControlNet preprocessors should always output as PIL. Removed diagnostics and other general cleanup.

* Prep for splitting pre-processor and controlnet nodes

* Refactored controlnet nodes: split out controlnet stuff into separate node, stripped controlnet stuff form image processing/analysis nodes.

* Added resizing of controlnet image based on noise latent. Fixes a tensor mismatch issue.

* Added support for using multiple control nets. Unfortunately this breaks direct usage of Control node output port  ==> TextToLatent control input port -- passing through a Collect node is now required. Working on fixing this...

* Fixed use of ControlNet control_weight parameter

* Core implementation of ControlNet and MultiControlNet.

* Added first controlnet preprocessor node for canny edge detection.

* Initial port of controlnet node support from generator-based TextToImageInvocation node to latent-based TextToLatentsInvocation node

* Switching to ControlField for output from controlnet nodes.

* Refactored controlnet node to output ControlField that bundles control info.

* changes to base class for controlnet nodes

* Added more preprocessor nodes for:
      MidasDepth
      ZoeDepth
      MLSD
      NormalBae
      Pidi
      LineartAnime
      ContentShuffle
Removed pil_output options, ControlNet preprocessors should always output as PIL. Removed diagnostics and other general cleanup.

* Prep for splitting pre-processor and controlnet nodes

* Refactored controlnet nodes: split out controlnet stuff into separate node, stripped controlnet stuff form image processing/analysis nodes.

* Added resizing of controlnet image based on noise latent. Fixes a tensor mismatch issue.

* Cleaning up TextToLatent arg testing

* Cleaning up mistakes after rebase.

* Removed last bits of dtype and and device hardwiring from controlnet section

* Refactored ControNet support to consolidate multiple parameters into data struct. Also redid how multiple controlnets are handled.

* Added support for specifying which step iteration to start using
each ControlNet, and which step to end using each controlnet (specified as fraction of total steps)

* Cleaning up prior to submitting ControlNet PR. Mostly turning off diagnostic printing. Also fixed error when there is no controlnet input.

* Commented out ZoeDetector. Will re-instate once there's a controlnet-aux release that supports it.

* Switched CotrolNet node modelname input from free text to default list of popular ControlNet model names.

* Fix to work with current stable release of controlnet_aux (v0.0.3). Turned of pre-processor params that were added post v0.0.3. Also change defaults for shuffle.

* Refactored most of controlnet code into its own method to declutter TextToLatents.invoke(), and make upcoming integration with LatentsToLatents easier.

* Cleaning up after ControlNet refactor in TextToLatentsInvocation

* Extended node-based ControlNet support to LatentsToLatentsInvocation.

* chore(ui): regen api client

* fix(ui): fix node ui type hints

* fix(nodes): controlnet input accepts list or single controlnet

* Added Mediapipe image processor for use as ControlNet preprocessor.
Also hacked in ability to specify HF subfolder when loading ControlNet models from string.

* Fixed bug where MediapipFaceProcessorInvocation was ignoring max_faces and min_confidence params.

* Added nodes for float params: ParamFloatInvocation and FloatCollectionOutput. Also added FloatOutput.

* Added mediapipe install requirement. Should be able to remove once controlnet_aux package adds mediapipe to its requirements.

* Added float to FIELD_TYPE_MAP ins constants.ts

* Progress toward improvement in fieldTemplateBuilder.ts  getFieldType()

* Fixed controlnet preprocessors and controlnet handling in TextToLatents to work with revised Image services.

* Cleaning up from merge, re-adding cfg_scale to FIELD_TYPE_MAP

* Making sure cfg_scale of type list[float] can be used in image metadata, to support param easing for cfg_scale

* Fixed math for per-step param easing.

* Added option to show plot of param value at each step

* Just cleaning up after adding param easing plot option, removing vestigial code.

* Modified control_weight ControlNet param to be polistmorphic --
can now be either a single float weight applied for all steps, or a list of floats of size total_steps, that specifies weight for each step.

* Added more informative error message when _validat_edge() throws an error.

* Just improving parm easing bar chart title to include easing type.

* Added requirement for easing-functions package

* Taking out some diagnostic prints.

* Added option to use both easing function and mirror of easing function together.

* Fixed recently introduced problem (when pulled in main), triggered by num_steps in StepParamEasingInvocation not having a default value -- just added default.

---------

Co-authored-by: psychedelicious <4822129+psychedelicious@users.noreply.github.com>
2023-06-11 16:27:44 +10:00
Sergey Borisov
738ba40f51 Fixes 2023-06-11 06:12:21 +03:00
Sergey Borisov
3ce3a7ee72 Rewrite model configs, separate models 2023-06-11 04:49:09 +03:00
Lincoln Stein
74b43c9bdf fix incorrect variable/typenames in model_cache 2023-06-10 10:41:48 -04:00
Lincoln Stein
3d2ff7755e resolve conflicts 2023-06-10 10:13:54 -04:00
Lincoln Stein
a87d52a389 resolve conflicts between lstein & sttalker changes 2023-06-10 09:59:19 -04:00
Lincoln Stein
959e64c9b3 start removing repo_id support 2023-06-10 09:57:23 -04:00
Sergey Borisov
2c056ead42 New models structure draft 2023-06-10 03:14:10 +03:00
Lincoln Stein
1bca32ed16
Merge branch 'main' into lstein/fix-logger-reconfiguration 2023-06-09 06:27:26 -07:00
psychedelicious
7f91139e21 fix(ui): fix crash when using dropdown on certain device resolutions 2023-06-09 22:19:30 +10:00
psychedelicious
93f3658a4a fix(ui): blur tab on click
Fixes issue where after clicking a tab, using the arrow keys changes tab instead of changing selected image
2023-06-09 18:20:52 +10:00
psychedelicious
68be95acbb fix(ui): fix canvas not filling screen on first load 2023-06-09 17:55:11 +10:00
psychedelicious
813f79f0f9 feat(ui): remove clear temp folder canvas button
This button is nonfunctional.

Soon we will introduce a different way to handle clearing out intermediate images (likely automated).
2023-06-09 17:33:17 +10:00
psychedelicious
05a19753c6 feat(ui): remove controlnet model descriptions
These are not yet exposed on the UI - somebody who understands what they do better can add them when we have a place to expose them
2023-06-09 16:20:30 +10:00
psychedelicious
a33327c651 feat(ui): enhance IAICustomSelect
Now accepts an array of strings or array of `IAICustomSelectOption`s. This supports custom labels and tooltips within the select component.
2023-06-09 16:00:17 +10:00
psychedelicious
c506355b8b feat(ui): decrease delay on dnd to 150ms 2023-06-09 15:53:17 +10:00
psychedelicious
c91b071c47 fix(nodes): use DFS with preorder traversal 2023-06-09 14:53:45 +10:00
psychedelicious
9c57b18008 fix(nodes): update Invoker.invoke() docstring 2023-06-09 14:53:45 +10:00
psychedelicious
69539a0472 feat(nodes): depth-first execution
There was an issue where for graphs w/ iterations, your images were output all at once, at the very end of processing. So if you canceled halfway through an execution of 10 nodes, you wouldn't get any images - even though you'd completed 5 images' worth of inference.

## Cause

Because graphs executed breadth-first (i.e. depth-by-depth), leaf nodes were necessarily processed last. For image generation graphs, your `LatentsToImage` will be leaf nodes, and be the last depth to be executed.

For example, a `TextToLatents` graph w/ 3 iterations would execute all 3 `TextToLatents` nodes fully before moving to the next depth, where the `LatentsToImage` nodes produce output images, resulting in a node execution order like this:

1. TextToLatents
2. TextToLatents
3. TextToLatents
4. LatentsToImage
5. LatentsToImage
6. LatentsToImage

## Solution

This PR makes a two changes to graph execution to execute as deeply as it can along each branch of the graph.

### Eager node preparation

We now prepare as many nodes as possible, instead of just a single node at a time.

We also need to change the conditions in which nodes are prepared. Previously, nodes were prepared only when all of their direct ancestors were executed.

The updated logic prepares nodes that:
- are *not* `Iterate` nodes whose inputs have *not* been executed
- do *not* have any unexecuted `Iterate` ancestor nodes

This results in graphs always being maximally prepared.

### Always execute the deepest prepared node

We now choose the next node to execute by traversing from the bottom of the graph instead of the top, choosing the first node whose inputs are all executed.

This means we always execute the deepest node possible.

## Result

Graphs now execute depth-first, so instead of an execution order like this:

1. TextToLatents
2. TextToLatents
3. TextToLatents
4. LatentsToImage
5. LatentsToImage
6. LatentsToImage

... we get an execution order like this:

1. TextToLatents
2. LatentsToImage
3. TextToLatents
4. LatentsToImage
5. TextToLatents
6. LatentsToImage

Immediately after inference, the image is decoded and sent to the gallery.

fixes #3400
2023-06-09 14:53:45 +10:00
blessedcoolant
7bce455d16
Merge branch 'main' into diffusers-upgrade 2023-06-09 16:27:52 +12:00
psychedelicious
fd03c7eebe feat(ui): restore reset button for init image 2023-06-09 14:00:23 +10:00
psychedelicious
8c688f8e29 feat(ui): skip resize on img2img if not needed 2023-06-09 13:54:23 +10:00
Lincoln Stein
887576d217 add directory scanning for loras, controlnets and textual_inversions 2023-06-08 23:11:53 -04:00
Lincoln Stein
6652f3405b merge with main 2023-06-08 21:08:43 -04:00
Lincoln Stein
3d13167d32
Merge branch 'main' into lstein/fix-logger-reconfiguration 2023-06-08 13:41:24 -07:00
Lincoln Stein
27b5e43ea4 add messages to the user to tell them to enlarge window 2023-06-08 16:37:10 -04:00
Lincoln Stein
f2bb507ebb allow logger to be reconfigured after startup 2023-06-08 09:23:11 -04:00
Lincoln Stein
2a6d11e645 create databases directory on startup 2023-06-08 07:17:54 -04:00
Lincoln Stein
01f46d3c7d
Merge branch 'main' into lstein/fix-logger-reconfiguration 2023-06-07 19:50:44 -07:00
Lincoln Stein
4bbe3b0d00
Merge branch 'main' into release/make-web-dist-startable 2023-06-07 19:21:01 -07:00
Lincoln Stein
9ed86a08f1 multiple small fixes
1. Contents of autoscan directory field are restored after doing an installation.
2. Activate dialogue to choose V2 parameterization when importing from a directory.
3. Remove autoscan directory from init file when its checkbox is unselected.
4. Add widget cycling behavior to install models form.
2023-06-07 17:32:00 -04:00
blessedcoolant
68405910ba Upgrade to Diffusers 0.17.0 2023-06-08 04:42:52 +12:00
psychedelicious
fc7c5da4dd fix(ui): default controlnet autoprocess to true
I had accidentally defaulted it to false
2023-06-07 23:55:24 +10:00
Lincoln Stein
a3357e073c refactor exception handling 2023-06-07 07:35:34 -04:00
Lincoln Stein
d114833a12 pause after printing exception 2023-06-07 07:26:14 -04:00