InvokeAI/invokeai/frontend/web
psychedelicious 1062fc4796 feat: polymorphic fields
Initial support for polymorphic field types. Polymorphic types are a single of or list of a specific type. For example, `Union[str, list[str]]`.

Polymorphics do not yet have support for direct input in the UI (will come in the future). They will be forcibly set as Connection-only fields, in which case users will not be able to provide direct input to the field.

If a polymorphic should present as a singleton type - which would allow direct input - the node must provide an explicit type hint.

For example, `DenoiseLatents`' `CFG Scale` is polymorphic, but in the node editor, we want to present this as a number input. In the node definition, the field is given `ui_type=UIType.Float`, which tells the UI to treat this as a `float` field.

The connection validation logic will prevent connecting a collection to `CFG Scale` in this situation, because it is typed as `float`. The workaround is to disable validation from the settings to make this specific connection. A future improvement will resolve this.

This also introduces better support for collection field types. Like polymorphics, collection types are parsed automatically by the client and do not need any specific type hints.

Also like polymorphics, there is no support yet for direct input of collection types in the UI.

- Disabling validation in workflow editor now displays the visual hints for valid connections, but lets you connect to anything.
- Added `ui_order: int` to `InputField` and `OutputField`. The UI will use this, if present, to order fields in a node UI. See usage in `DenoiseLatents` for an example.
- Updated the field colors - duplicate colors have just been lightened a bit. It's not perfect but it was a quick fix.
- Field handles for collections are the same color as their single counterparts, but have a dark dot in the center of them.
- Field handles for polymorphics are a rounded square with dot in the middle.
- Removed all fields that just render `null` from `InputFieldRenderer`, replaced with a single fallback
- Removed logic in `zValidatedWorkflow`, which checked for existence of node templates for each node in a workflow. This logic introduced a circular dependency, due to importing the global redux `store` in order to get the node templates within a zod schema. It's actually fine to just leave this out entirely; The case of a missing node template is handled by the UI. Fixing it otherwise would introduce a substantial headache.
- Fixed the `ControlNetInvocation.control_model` field default, which was a string when it shouldn't have one.
2023-09-04 15:25:31 +10:00
..
.husky fix(ui): post-onnx fixes 2023-08-01 07:59:01 -04:00
.yarn/releases all files migrated; tweaks needed 2023-03-03 00:02:15 -05:00
config export theme nad move chakra to peer dep 2023-08-01 08:54:03 +10:00
dist blackify and rerun frontend build 2023-08-31 10:35:17 -04:00
docs dummy commit to make github actions run 2023-06-04 22:55:35 +10:00
public/locales Merge branch 'main' into feat/nodes-phase-5 2023-08-30 14:11:49 +12:00
scripts fix(ui): simplify typegen script 2023-08-23 23:06:42 +10:00
src feat: polymorphic fields 2023-09-04 15:25:31 +10:00
static move static into invokeai.frontend.web directory for dist install 2023-05-22 16:48:17 -04:00
tests Partial migration of UI to nodes API (#3195) 2023-04-22 13:10:20 +10:00
__init__.py Run python black 2023-07-28 09:46:44 -04:00
.eslintignore feat: workflow saving and loading 2023-08-24 21:42:32 +10:00
.eslintrc.js build(ui): fix up lint scripts (way faster now) 2023-08-23 23:06:42 +10:00
.gitignore build(ui): add yalc to gitignore 2023-05-11 11:55:51 +10:00
.prettierignore feat: workflow saving and loading 2023-08-24 21:42:32 +10:00
.prettierrc.js feat(ui): migrate theming to chakra ui 2023-03-06 20:03:39 +11:00
.yarnrc all files migrated; tweaks needed 2023-03-03 00:02:15 -05:00
.yarnrc.yml all files migrated; tweaks needed 2023-03-03 00:02:15 -05:00
favicon.ico all files migrated; tweaks needed 2023-03-03 00:02:15 -05:00
index.html feat(ui): migrate theming to chakra ui 2023-03-06 20:03:39 +11:00
package.json feat(ui): better workflow validation and parsing 2023-08-30 13:02:49 +10:00
tsconfig.json feat: add multi-select to gallery 2023-08-03 11:46:59 +10:00
tsconfig.node.json feat(ui): improved node parsing 2023-06-26 11:53:54 +10:00
vite.config.ts build(ui): treeshake lodash via lodash-es 2023-04-28 21:56:43 +10:00
yarn.lock feat(ui): better workflow validation and parsing 2023-08-30 13:02:49 +10:00