Commit Graph

949 Commits

Author SHA1 Message Date
psychedelicious
d65553841e fix: remove default_factory for ImageCollectionInvocation 2023-09-04 15:25:31 +10:00
psychedelicious
446dc6bea1 fix(nodes): denoise_mask is connection-only, ui_order=6 2023-09-04 15:25:31 +10:00
psychedelicious
92975130bd feat: allow float inputs to accept integers
Pydantic automatically casts ints to floats.
2023-09-04 15:25:31 +10:00
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
Lincoln Stein
7763594839
Merge branch 'main' into bugfix/run-on-3.9 2023-09-02 10:08:40 -04:00
psychedelicious
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
Sergey Borisov
8fa2302956 Fix name 2023-09-02 04:37:11 +03:00
Sergey Borisov
9c3405e0c0 Fix sdxl lora loader input definitions, fix namings 2023-09-02 04:34:17 +03:00
psychedelicious
d099924ae9
Merge branch 'main' into bugfix/run-on-3.9 2023-09-02 11:33:09 +10:00
blessedcoolant
ba2048dbc6 fix: SDXL Lora Loader not showing weight input 2023-09-02 10:47:55 +12:00
Lincoln Stein
10e4d8b72d fix second place where __annotations__ called 2023-08-31 23:49:08 -04:00
Lincoln Stein
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
Lincoln Stein
2cb57ef301 fix baseinvocation call to __attribute__ to work with py3.9 2023-08-31 23:11:54 -04:00
psychedelicious
ed72d51969 fix(nodes): fix primitives defaults for collections 2023-08-31 13:22:31 +10:00
Sergey Borisov
d5267357b1 Pad conditioning tensors from clip and clip2 in sdxl 2023-08-30 21:28:40 -04:00
Sergey Borisov
e085eb63bd Check noise and latents shapes, more informative error 2023-08-30 21:28:40 -04:00
Lincoln Stein
715686477e fix unknown PagingArgumentParser import error in ti-training 2023-08-30 17:49:19 -04:00
psychedelicious
24d44ca559 feat(nodes): add scheduler invocation 2023-08-30 22:35:47 +10:00
psychedelicious
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
psychedelicious
ae05d34584 fix(nodes): fix uploading image metadata retention
was causing failure to save images
2023-08-30 14:52:50 +10:00
psychedelicious
0ed6a141f1
Merge branch 'main' into feat/nodes-phase-5 2023-08-30 11:15:34 +10:00
Sergey Borisov
ca15b8b33e Fix wrong timestep selection in some cases(dpmpp_sde) 2023-08-30 03:40:59 +03:00
blessedcoolant
258b0814a8 Merge branch 'main' into feat/nodes-phase-5 2023-08-30 02:33:49 +12:00
Sergey Borisov
121396f844 Fix tokenization log for sd models 2023-08-29 17:07:33 +03:00
blessedcoolant
a1398dec91 Merge branch 'main' into pr/4112 2023-08-29 12:56:59 +12:00
blessedcoolant
d0c74822eb resolve: Merge conflicts 2023-08-29 12:08:00 +12:00
blessedcoolant
383d008529 Merge branch 'main' into feat/nodes-phase-5 2023-08-29 12:05:28 +12:00
blessedcoolant
6db19a8dee fix: Connection type on Seamless Node VAE Input 2023-08-29 04:15:15 +12:00
blessedcoolant
ef58635a76 chore: black lint 2023-08-29 04:04:03 +12:00
StAlKeR7779
cd548f73fd
Merge branch 'main' into feat_compel_and 2023-08-28 18:31:41 +03:00
Kent Keirsey
421f5b7d75 Seamless Updates 2023-08-28 08:43:08 -04:00
blessedcoolant
3ef36707a8 chore: Black lint 2023-08-28 23:10:00 +12:00
Kent Keirsey
b9731cb434
Merge branch 'main' into Seamless 2023-08-28 00:12:23 -04:00
Kent Keirsey
1f476692da Seamless fixes 2023-08-28 00:10:46 -04:00
Kent Keirsey
5fdd25501b updates per stalkers comments 2023-08-27 22:54:53 -04:00
StAlKeR7779
ef3bf2803f
Merge branch 'main' into feat_compel_and 2023-08-28 04:11:35 +03:00
Kent Keirsey
19e0f360e7 Fix vae fields 2023-08-27 15:05:10 -04:00
Kent Keirsey
ea40a7844a add VAE 2023-08-27 14:53:57 -04:00
Kent Keirsey
c6d00387a7 Revert old latent changes, update seamless 2023-08-27 14:15:37 -04:00
Kent Keirsey
3de45af734 updates 2023-08-27 14:13:00 -04:00
Sergey Borisov
526c7e7737 Provide antialias argument as behaviour will be changed in future(deprecation warning) 2023-08-27 20:04:55 +03:00
Sergey Borisov
1811b54727 Provide metadata to image creation call 2023-08-27 20:03:53 +03:00
Kent Keirsey
95883c2efd Add Initial (non-working) Seamless Implementation 2023-08-27 12:29:11 -04:00
blessedcoolant
71c3955530 feat: Add Scale Before Processing To Canvas Txt2Img / Img2Img (w/ SDXL) 2023-08-27 08:26:23 +12:00
blessedcoolant
3f8d17d6b7 chore: Black linting 2023-08-27 06:17:08 +12:00
blessedcoolant
249048aae7 fix: Reorder DenoiseMask socket fields 2023-08-27 06:14:35 +12:00
blessedcoolant
c923d094c6 rename: Inpaint Mask to Denoise Mask 2023-08-27 05:50:13 +12:00
blessedcoolant
e9633a3adb Merge branch 'main' into fix/inpaint_gen 2023-08-27 02:54:19 +12:00
Kevin Turner
368ff17ed4
Merge branch 'main' into feat/dev_reload 2023-08-24 15:21:50 -07:00
maryhipp
e6fd1c3d1f add optional field to type 2023-08-25 00:09:16 +10:00