Commit Graph

812 Commits

Author SHA1 Message Date
b0f91f2e75 fix: Remove types on adapter nodes. Superseded by the decorator 2023-09-05 12:12:19 +12:00
a69b1cd598 chore: Add Versioning data to new adapters + update model paths 2023-09-05 11:54:50 +12:00
07381e5a26 cleanup: merge conflicts 2023-09-05 11:37:12 +12:00
6bb378a101 Merge branch 'main' into feat/ip-adapter 2023-09-05 11:35:19 +12:00
db4af7c287 Merge branch 'main' into lama-infill 2023-09-05 09:54:44 +12:00
3dbb0e1bfb feat(tests): add tests for node versions 2023-09-04 19:16:44 +10:00
d9148fb619 feat(nodes): add version to node schemas
The `@invocation` decorator is extended with an optional `version` arg. On execution of the decorator, the version string is parsed using the `semver` package (this was an indirect dependency and has been added to `pyproject.toml`).

All built-in nodes are set with `version="1.0.0"`.

The version is added to the OpenAPI Schema for consumption by the client.
2023-09-04 19:08:18 +10:00
d65553841e fix: remove default_factory for ImageCollectionInvocation 2023-09-04 15:25:31 +10:00
446dc6bea1 fix(nodes): denoise_mask is connection-only, ui_order=6 2023-09-04 15:25:31 +10:00
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
917c2c480e Merge branch 'main' into lama-infill 2023-09-03 23:16:34 +12:00
7763594839 Merge branch 'main' into bugfix/run-on-3.9 2023-09-02 10:08:40 -04:00
ec09e21fc2 Merge branch 'main' into lama-infill 2023-09-02 23:02:38 +12:00
7df67d077a Merge branch 'main' into feat/taesd 2023-09-01 22:18:40 -07:00
89b724d222 fix(ui): fix metadata parsing of older images
The metadata parsing was overly strict, not taking into account the shape of old metadata. Relaxed the schemas.

Also fixed a misspelling.
2023-09-02 13:03:48 +10:00
8fa2302956 Fix name 2023-09-02 04:37:11 +03:00
9c3405e0c0 Fix sdxl lora loader input definitions, fix namings 2023-09-02 04:34:17 +03:00
d099924ae9 Merge branch 'main' into bugfix/run-on-3.9 2023-09-02 11:33:09 +10:00
b761807219 Merge branch 'main' into feat/ip-adapter 2023-09-02 11:31:08 +10:00
48484e9fc8 Merge branch 'main' into lama-infill 2023-09-02 11:08:31 +12:00
ba2048dbc6 fix: SDXL Lora Loader not showing weight input 2023-09-02 10:47:55 +12:00
469fc49a2f ui: Make patchmatch downscale options optional 2023-09-02 08:36:01 +12:00
a36cf2f1dd Add scale to patchmatch 2023-09-01 23:08:46 +03:00
1a9f552a75 experimental: Add CV2 Infill 2023-09-02 04:48:18 +12:00
74bfb5e1f9 First commit of separate node for IP-Adapter.
And it own dataclasses for passing info.
2023-08-31 23:07:15 -07:00
10e4d8b72d fix second place where __annotations__ called 2023-08-31 23:49:08 -04:00
6c2786201b Update invokeai/app/invocations/baseinvocation.py
Co-authored-by: psychedelicious <4822129+psychedelicious@users.noreply.github.com>
2023-08-31 23:45:19 -04:00
bc1bce18b0 Merge branch 'main' into feat/taesd 2023-08-31 20:26:10 -07:00
2cb57ef301 fix baseinvocation call to __attribute__ to work with py3.9 2023-08-31 23:11:54 -04:00
6f162c5dec experimental: Dilate mask if blurred in Color Correction 2023-09-01 11:12:30 +12:00
ed72d51969 fix(nodes): fix primitives defaults for collections 2023-08-31 13:22:31 +10:00
79db0e9e93 More cleanup after rebasing to main. 2023-08-30 18:29:06 -07:00
d5267357b1 Pad conditioning tensors from clip and clip2 in sdxl 2023-08-30 21:28:40 -04:00
e085eb63bd Check noise and latents shapes, more informative error 2023-08-30 21:28:40 -04:00
0c17f8604f Resolving rebase conflict, redirecting control imports to invocations/control_adapter 2023-08-30 17:35:31 -07:00
054edc4077 Oops, forgot to add control_adapter.py for control nodes in last refactor commit 2023-08-30 17:31:46 -07:00
5a9993772d Added ip_adapter_strength parameter to adjust weighting of IP-Adapter's added cross-attention layers 2023-08-30 17:28:30 -07:00
f2cd9e9ae2 Working POC for IP-Adapters. Not fully nodified yet, lots of caveats, hardwired model paths, etc. 2023-08-30 17:28:30 -07:00
24d44ca559 feat(nodes): add scheduler invocation 2023-08-30 22:35:47 +10:00
044d4c107a feat(nodes): move all invocation metadata (type, title, tags, category) to decorator
All invocation metadata (type, title, tags and category) are now defined in decorators.

The decorators add the `type: Literal["invocation_type"]: "invocation_type"` field to the invocation.

Category is a new invocation metadata, but it is not used by the frontend just yet.

- `@invocation()` decorator for invocations

```py
@invocation(
    "sdxl_compel_prompt",
    title="SDXL Prompt",
    tags=["sdxl", "compel", "prompt"],
    category="conditioning",
)
class SDXLCompelPromptInvocation(BaseInvocation, SDXLPromptInvocationBase):
    ...
```

- `@invocation_output()` decorator for invocation outputs

```py
@invocation_output("clip_skip_output")
class ClipSkipInvocationOutput(BaseInvocationOutput):
    ...
```

- update invocation docs
- add category to decorator
- regen frontend types
2023-08-30 18:35:12 +10:00
ae05d34584 fix(nodes): fix uploading image metadata retention
was causing failure to save images
2023-08-30 14:52:50 +10:00
0ed6a141f1 Merge branch 'main' into feat/nodes-phase-5 2023-08-30 11:15:34 +10:00
ca15b8b33e Fix wrong timestep selection in some cases(dpmpp_sde) 2023-08-30 03:40:59 +03:00
258b0814a8 Merge branch 'main' into feat/nodes-phase-5 2023-08-30 02:33:49 +12:00
121396f844 Fix tokenization log for sd models 2023-08-29 17:07:33 +03:00
a1398dec91 Merge branch 'main' into pr/4112 2023-08-29 12:56:59 +12:00
d0c74822eb resolve: Merge conflicts 2023-08-29 12:08:00 +12:00
383d008529 Merge branch 'main' into feat/nodes-phase-5 2023-08-29 12:05:28 +12:00
6db19a8dee fix: Connection type on Seamless Node VAE Input 2023-08-29 04:15:15 +12:00
ef58635a76 chore: black lint 2023-08-29 04:04:03 +12:00