Commit Graph

3395 Commits

Author SHA1 Message Date
psychedelicious
3dbb0e1bfb feat(tests): add tests for node versions 2023-09-04 19:16:44 +10:00
psychedelicious
4aca264308 feat(ui): handle node versions
- Node versions are now added to node templates
- Node data (including in workflows) include the version of the node
- On loading a workflow, we check to see if the node and template versions match exactly. If not, a warning is logged to console.
- The node info icon (top-right corner of node, which you may click to open the notes editor) now shows the version and mentions any issues.
- Some workflow validation logic has been shifted around and is now executed in a redux listener.
2023-09-04 19:08:18 +10:00
psychedelicious
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
psychedelicious
920fc0e751 chore(ui): typegen 2023-09-04 15:25:58 +10:00
psychedelicious
34e3c2e000 feat(ui): style handles 2023-09-04 15:25:31 +10:00
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
a765f01c08 chore(ui): typegen 2023-09-04 15:25:31 +10:00
psychedelicious
09803b075d fix(ui): fix node value checks to compare to undefined
existing checks would fail if falsy values
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
blessedcoolant
95f44ff343 fix: Make the name extraction work for both ckpts and folders 2023-09-04 10:52:27 +12:00
blessedcoolant
f9c3c07d98 fix: Support UNIX paths 2023-09-04 10:16:57 +12:00
blessedcoolant
c91ba2dbe7 feat: Infer Model Name automatically if empty in Model Forms 2023-09-04 01:36:48 +12:00
psychedelicious
0a70a856e5
Merge branch 'main' into fix/ui/fix-click-node-collapse 2023-09-03 09:43:40 +10:00
Lincoln Stein
f1a01c473d
Merge branch 'main' into bugfix/run-on-3.9 2023-09-02 12:01:37 -04:00
blessedcoolant
f1f7778e73
Merge branch 'main' into chore/clean-up-unused-files 2023-09-03 02:59:31 +12:00
Lincoln Stein
7763594839
Merge branch 'main' into bugfix/run-on-3.9 2023-09-02 10:08:40 -04:00
psychedelicious
625b08cff7 chore: typegen 2023-09-02 13:03:48 +10: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
Lincoln Stein
6f6d920686
[Feature] Support the XL inpainting model (#4431)
* add StableDiffusionXLInpaintPipeline to probe list

* add StableDiffusionXLInpaintPipeline to probe list

* Blackified (?)

---------

Authored-by: Lincoln Stein <lstein@gmail.com>
Mucked about with to get it merged by: Kent Keirsey <31807370+hipsterusername@users.noreply.github.com>
2023-09-01 22:58:14 -04:00
psychedelicious
699dfa222e fix(ui): node UI elements do not select node on click
Add a click handler for node wrapper component that exclusively selects that node, IF no other modifier keys are held.

Technically I believe this means we are doubling up on the selection logic, as reactflow handles this internally also. But this is by far the most reliable way to fix the UX.
2023-09-02 12:11:07 +10:00
blessedcoolant
2c754cfce7
Merge branch 'main' into fix/lora_node_inputs_definition 2023-09-02 13:38:05 +12:00
Sergey Borisov
8fa2302956 Fix name 2023-09-02 04:37:11 +03:00
Mary Hipp
ec2b44bfbd update hooks to pass in DTO 2023-09-02 11:36:46 +10:00
Mary Hipp
f8bb1f7a3e update getImageMetadataFromFile query to allow dyanmic URL based on image without using baseUrl for rest of endpoints 2023-09-02 11:36:46 +10: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
psychedelicious
45259894e0
Merge branch 'main' into chore/clean-up-unused-files 2023-09-02 11:30:41 +10:00
psychedelicious
0a7d06f8c6 fix(ui): fix circular imports
The logic that introduced a circular import was actually extraneous. I have entirely removed it.
2023-09-02 11:26:48 +10:00
psychedelicious
3288d9b31a
Merge branch 'main' into chore/clean-up-unused-files 2023-09-02 11:13:15 +10:00
psychedelicious
9cb04f6f80 chore: remove unused files 2023-09-02 11:12:19 +10:00
blessedcoolant
46bc6968b8 fix: ControlImage Dimension retrieval not working as intended 2023-09-02 11:11:34 +12:00
blessedcoolant
a12fbc7406 chore: black fix 2023-09-02 10:51:53 +12: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
Lincoln Stein
ca5689dc54 jigger model naming so that v1-5-inpaint is not the default on new installs 2023-08-31 10:56:25 -04:00
Lincoln Stein
b567d65032 blackify and rerun frontend build 2023-08-31 10:35:17 -04:00
Lincoln Stein
35ac8e78bd bump to release version 2023-08-31 10:33:02 -04:00
psychedelicious
e90fd96eee fix(nodes): fix warning when using current image node 2023-08-31 13:40:38 +10: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
psychedelicious
8e470f9b6f fix(ui): fix metadata retrieval when has controlnet 2023-08-31 11:20:18 +10:00
Lincoln Stein
83163ddd9a fix migrate script to work when autoimport directories are None 2023-08-30 18:46:17 -04:00
Lincoln Stein
715686477e fix unknown PagingArgumentParser import error in ti-training 2023-08-30 17:49:19 -04:00
Lincoln Stein
05e203570d make image import script work with python3.9; cleanup wheel creator 2023-08-30 17:35:58 -04:00
blessedcoolant
3cd2d3b764 fix: SDXL T2I and L2I not respecting Scaled on Canvas 2023-08-31 06:45:21 +12:00