Commit Graph

1290 Commits

Author SHA1 Message Date
psychedelicious
f56c47b550 fix(db): remove extraneous lock 2023-12-05 14:49:00 +11:00
psychedelicious
f8e35aec7b Merge remote-tracking branch 'origin/main' into feat/workflow-saving 2023-12-05 13:31:47 +11:00
psychedelicious
10cf10c16c fix(db): fix bug with releasing without lock in db.clean() 2023-12-05 06:48:53 +11:00
psychedelicious
0fdcc0af65 feat(nodes): add index and total to iterate output 2023-12-04 14:11:32 +11:00
Anthony Monthe
4fc2ed7195
Added full-version endpoint (#5206)
* Added get_app_deps endpoint

* Use importlib.version & added deps
2023-12-04 02:57:39 +00:00
psychedelicious
b9a1374b8f feat(backend): workflow_records.get_many arg "filter_text" -> "query" 2023-12-03 19:22:16 +11:00
psychedelicious
411ea75861 fix(backend): revert unrelated service organisational changes 2023-12-03 19:03:29 +11:00
psychedelicious
375c9a1c20 fix: tidy up unused files, unrelated changes 2023-12-03 19:00:01 +11:00
psychedelicious
907340b1e1 docs: update default workflows README 2023-12-03 18:54:42 +11:00
psychedelicious
929b1f4a41 fix(db): fix mis-ordered db cleanup step
It was happening before pruning queue items - should happen afterwards, else you have to restart the app again to free disk space made available by the pruning.
2023-12-02 21:40:01 +11:00
psychedelicious
f268ea4e39 fix(workflow_records): typo 2023-12-02 19:54:15 +11:00
psychedelicious
5a0e8261bf feat(workflows): update default workflows
- Update TextToImage_SD15
- Add TextToImage_SDXL
- Add README
2023-12-02 19:51:55 +11:00
psychedelicious
0447fa2dcb Merge remote-tracking branch 'origin/main' into feat/workflow-saving 2023-12-02 13:55:19 +11:00
psychedelicious
fb9b471150 feat(backend): move logic to clear latents to method 2023-12-01 17:44:07 -08:00
psychedelicious
3f0e0af177 feat(backend): only log pruned queue items / db freed space if > 0 2023-12-01 17:44:07 -08:00
psychedelicious
0228aba06f feat(backend): display freed space when cleaning DB 2023-12-01 17:44:07 -08:00
psychedelicious
1fd6666682 feat(backend): clear latents files on startup
Adds logic to `DiskLatentsStorage.start()` to empty the latents folder on startup.

Adds start and stop methods to `ForwardCacheLatentsStorage`. This is required for `DiskLatentsStorage.start()` to be called, due to how this particular service breaks the direct DI pattern, wrapping the underlying storage with a cache.
2023-12-01 17:44:07 -08:00
psychedelicious
4fd163698c feat: simplify default workflows
- Rename "system" -> "default"
- Simplify syncing logic
- Update UI to match
2023-12-02 11:41:05 +11:00
psychedelicious
224438a108 fix: merge conflicts 2023-12-01 23:05:52 +11:00
psychedelicious
81d2d5abae Merge remote-tracking branch 'origin/main' into feat/workflow-saving 2023-12-01 23:03:01 +11:00
psychedelicious
734e871e8f feat(backend): sync system workflows to db 2023-12-01 22:45:17 +11:00
psychedelicious
b0350e9bc8 feat: workflow library - system graphs - wip 2023-12-01 19:36:38 +11:00
psychedelicious
0a25efd054 feat: workflow library WIP
- Save to library
- Duplicate
- Filter/sort
- UI/queries
2023-12-01 15:24:22 +11:00
Ryan Dick
984e609c61 (minor) Tweak field ordering and field names for tiling nodes. 2023-11-30 07:53:27 -08:00
Ryan Dick
57e70aaf50 Change input field ordering of CropLatentsCoreInvocation to match ImageCropInvocation. 2023-11-30 07:53:27 -08:00
Ryan Dick
32da359ba5 Infer a tight-fitting output image size from the passed tiles in MergeTilesToImageInvocation. 2023-11-30 07:53:27 -08:00
Ryan Dick
b19ed36b43 Add width and height fields to TileToPropertiesInvocation output to avoid having to calculate them with math nodes. 2023-11-30 07:53:27 -08:00
Ryan Dick
e5a212b5c8 Update tiling nodes to use width-before-height field ordering convention. 2023-11-30 07:53:27 -08:00
Ryan Dick
9b863fb9bc Rename CropLatentsInvocation -> CropLatentsCoreInvocation to prevent conflict with custom node. And other minor tidying. 2023-11-30 07:53:27 -08:00
Ryan Dick
7cab51745b Improve documentation of CropLatentsInvocation. 2023-11-30 07:53:27 -08:00
Ryan Dick
18c6ff427e Use LATENT_SCALE_FACTOR = 8 constant in CropLatentsInvocation. 2023-11-30 07:53:27 -08:00
Ryan Dick
843f2d71d6 Copy CropLatentsInvocation from 74647fa9c1/images_to_grids.py (L1117C1-L1167C80). 2023-11-30 07:53:27 -08:00
Ryan Dick
67540c9ee0 (minor) Add 'Invocation' suffix to all tiling node classes. 2023-11-30 07:53:27 -08:00
Ryan Dick
7f816c9243 Tidy up tiles invocations, add documentation. 2023-11-30 07:53:27 -08:00
Ryan Dick
29eade4880 Add nodes for tile splitting and merging. The main motivation for these nodes is for use in tiled upscaling workflows. 2023-11-30 07:53:27 -08:00
ymgenesis
3e01c396e1
CenterPadCrop node (#3861)
* add centerpadcrop node

- Allows users to add padding to or crop images from the center
- Also outputs a white mask with the dimensions of the output image for use with outpainting

* add CenterPadCrop to NODES.md

Updates NODES.md with CenterPadCrop entry.

* remove mask & output class

- Remove "ImageMaskOutput" where both image and mask are output
- Remove ability to output mask from node

---------

Co-authored-by: psychedelicious <4822129+psychedelicious@users.noreply.github.com>
2023-11-30 21:15:59 +11:00
Damian Stewart
0beb08686c
Add CFG Rescale option for supporting zero-terminal SNR models (#4335)
* add support for CFG rescale

* fix typo

* move rescale position and tweak docs

* move input position

* implement suggestions from github and discord

* cleanup unused code

* add back dropped FieldDescription

* fix(ui): revert unrelated UI changes

* chore(nodes): bump denoise_latents version 1.4.0 -> 1.5.0

* feat(nodes): add cfg_rescale_multiplier to metadata node

* feat(ui): add cfg rescale multiplier to linear UI

- add param to state
- update graph builders
- add UI under advanced
- add metadata handling & recall
- regen types

* chore: black

* fix(backend): make `StableDiffusionGeneratorPipeline._rescale_cfg()` staticmethod

This doesn't need access to class.

* feat(backend): add docstring for `_rescale_cfg()` method

* feat(ui): update cfg rescale mult translation string

---------

Co-authored-by: psychedelicious <4822129+psychedelicious@users.noreply.github.com>
2023-11-30 20:55:20 +11:00
psychedelicious
46905175a9 wip 2023-11-30 19:19:58 +11:00
skunkworxdark
77933a0a85 Update prompt.py
bumped version to 1.0.1
2023-11-29 23:40:10 +11:00
skunkworxdark
2a087bf161 Update prompt.py
Use UTF-8 encoding on reading prompts from files to allow Unicode characters to load correctly. 
The following examples currently will not load correctly from a file:

Hello, 世界!
😭🤮 💔
2023-11-29 23:40:10 +11:00
psychedelicious
fcc056fe6a feat(backend): add WorkflowRecordListItemDTO
This is the id, name, description, created at and updated at workflow columns/attrs. Used to display lists of workflowsl
2023-11-29 23:37:11 +11:00
psychedelicious
c1bfc1f47b fix(nodes): fix get_workflow from queue item dict func 2023-11-29 15:36:28 +11:00
psychedelicious
14bf87e5e7 feat(nodes): restore WithWorkflow as no-op class
This class is deprecated and no longer needed. Set its workflow attr value to None (meaning it is now a no-op), and issue a warning when an invocation subclasses it.
2023-11-29 13:32:24 +11:00
psychedelicious
715ce8538b feat(nodes): do not overwrite custom node module names
Use a different, simpler method to detect if a node is custom.
2023-11-29 13:30:52 +11:00
psychedelicious
1987bc9cc5 feat: revert SQLiteMigrator class
Will pursue this in a separate PR.
2023-11-29 13:29:19 +11:00
psychedelicious
a514c9e28b feat(backend): update workflows handling
Update workflows handling for Workflow Library.

**Updated Workflow Storage**

"Embedded Workflows" are workflows associated with images, and are now only stored in the image files. "Library Workflows" are not associated with images, and are stored only in DB.

This works out nicely. We have always saved workflows to files, but recently began saving them to the DB in addition to in image files. When that happened, we stopped reading workflows from files, so all the workflows that only existed in images were inaccessible. With this change, access to those workflows is restored, and no workflows are lost.

**Updated Workflow Handling in Nodes**

Prior to this change, workflows were embedded in images by passing the whole workflow JSON to a special workflow field on a node. In the node's `invoke()` function, the node was able to access this workflow and save it with the image. This (inaccurately) models workflows as a property of an image and is rather awkward technically.

A workflow is now a property of a batch/session queue item. It is available in the InvocationContext and therefore available to all nodes during `invoke()`.

**Database Migrations**

Added a `SQLiteMigrator` class to handle database migrations. Migrations were needed to accomodate the DB-related changes in this PR. See the code for details.

The `images`, `workflows` and `session_queue` tables required migrations for this PR, and are using the new migrator. Other tables/services are still creating tables themselves. A followup PR will adapt them to use the migrator.

**Other/Support Changes**

- Add a `has_workflow` column to `images` table to indicate that the image has an embedded workflow.
- Add handling for retrieving the workflow from an image in python. The image file must be fetched, the workflow extracted, and then sent to client, avoiding needing the browser to parse the image file. With the `has_workflow` column, the UI knows if there is a workflow to be fetched, and only fetches when the user requests to load the workflow.
- Add route to get the workflow from an image
- Add CRUD service/routes for the library workflows
- `workflow_images` table and services removed (no longer needed now that embedded workflows are not in the DB)
2023-11-29 12:42:10 +11:00
psychedelicious
8cf2806489 fix(workflow_records): fix SQLite workflow insertion to ignore duplicates 2023-11-29 12:42:10 +11:00
psychedelicious
4468581d2e fix(nodes): remove extraneous del 2023-11-29 10:49:31 +11:00
psychedelicious
a1705dc6b3 fix(nodes): fix loading node pack display 2023-11-29 10:49:31 +11:00
psychedelicious
4af4486dd9 feat(nodes,ui): add detection of custom nodes
Custom nodes have a new attribute `node_pack` indicating the node pack they came from.

- This is displayed in the UI in the icon icon tooltip.
- If a workflow is loaded and a node is unavailable, its node pack will be displayed (if it is known).
- If a workflow is migrated from v1 to v2, and the node is unknown, it falls back to "Unknown". If the missing node pack is installed and the node is updated, the node pack will be updated as expected.
2023-11-29 10:49:31 +11:00