Invoke is a leading creative engine that uses image and video generation models to empower professionals, artists, and enthusiasts to generate and create visual media using the latest AI-driven technologies. The solution offers an industry-leading application interface, and serves as the foundation for multiple commercial products.
TypeScript ai-artartificial-intelligencegenerative-artimage-generationimg2imginpaintinglatent-diffusionlinuxmacosoutpaintingstable-diffusiontxt2imgwindows
docs: explain project-owned workflows and explicit library saving
Josh Corbett3362092b23d9
diff --git a/docs/src/content/docs/development/Front End/project-files.mdx b/docs/src/content/docs/development/Front End/project-files.mdxindex 2dd60b9b2d..85c4828d23 100644--- a/docs/src/content/docs/development/Front End/project-files.mdx+++ b/docs/src/content/docs/development/Front End/project-files.mdx@@ -218,4 +218,6 @@ Earlier webv2 builds exported `*.invokeproject.json` files containing a versionThe archive stores references to models, LoRAs and other generation resources, not the model files themselves. Loading a project on another install restores its canvas and images, but missing models still need to be installed or replaced.-**Not exported:** models and LoRAs, workflows from the library, queue history, intermediates, the canvas's private `other` media except where the document references it, gallery boards other than the project's own, and account preferences. A project file carries one project's workspace, not the install around it.+**Not exported:** models and LoRAs, library templates themselves, queue history, intermediates, the canvas's private `other` media except where the document references it, gallery boards other than the project's own, and account preferences. A project file carries one project's workspace, not the install around it.++**Workflows travel with the project.** A schema-3 document carries the project's whole workflow collection (`workflows.entries`, each with its document and optional source and last-run metadata) and its active selection, so an archive holds every workflow the project owns, active or not, and every media reference they name is bundled like any other document reference. Source metadata names the library template a copy came from; import clears it, because a template id on one install names nothing on another and a portable file must never inherit a library write target. Same-server duplication keeps it. Older archives that carry a schema-2 `projectGraph` load through the same migration as older server documents: that graph becomes the project's first and only workflow.diff --git a/docs/src/content/docs/features/Workflows/editor-interface.mdx b/docs/src/content/docs/features/Workflows/editor-interface.mdxindex 501cba30e3..2869d766e8 100644--- a/docs/src/content/docs/features/Workflows/editor-interface.mdx+++ b/docs/src/content/docs/features/Workflows/editor-interface.mdx@@ -3,7 +3,7 @@ title: Editor Interfacedescription: Learn how to use the Workflow Editor in InvokeAI.sidebar:order: 2-lastUpdated: 2026-02-20+lastUpdated: 2026-09-26---import { Card, CardGrid, Steps, Tabs, TabItem } from '@astrojs/starlight/components';@@ -18,17 +18,26 @@ If you're not familiar with Diffusion, take a look at our [Diffusion Overview](.## Features-<Card title="Workflow Library" icon="open-book">- Save workflows to the Invoke database, allowing you to easily create, modify, and share workflows as needed. A curated set of default workflows is provided to help explain important node usage.+:::note[Changed: the library no longer autosaves]+Earlier releases wrote every edit of a workflow opened from the library straight back to that library entry. Workflows now belong to the project they are in and autosave there; the library changes only when you choose **Save to library…** or **Update library template**. If you relied on library autosave, save to the library explicitly when a workflow is ready to reuse.+:::++<Card title="Project Workflows and the Library" icon="open-book">+ Each project owns its workflows. Everything you do in the editor autosaves with the project, alongside its canvas and settings, and every workflow keeps its own undo history for the session. The workflow library is a separate place for reusable templates: a curated set of bundled workflows plus the templates you save yourself.- The library has two views:+ Click the workflow name in the editor header to open the **Workflows** dialog. It has three views:++ - **This project** lists the workflows saved with the current project, with the active one marked. Open, rename, duplicate or remove them here, start a **New workflow**, or choose **Add workflow** to bring in a template.+ - **Browse** lists curated bundled templates, filterable by a fixed set of category tags.+ - **Yours** lists templates you have saved. The tag filter here is **dynamic** — it shows every unique tag found across your own templates, with a count per tag.++ Opening a template adds an independent copy to your project; the template itself is untouched. If the project already has a copy, **Open project copy** switches to it, and **Add another copy** makes a second one.- - **Browse Workflows** lists curated default workflows, filterable by a fixed set of category tags.- - **Your Workflows** lists workflows you have saved. The tag filter here is **dynamic** — it shows every unique tag found across your own workflows, with a count per tag.+ Editing or running a project workflow never changes the library. To publish, use **Save to library…** in the editor header: it creates a new template with the name you enter, using the workflow's current graph, form and input values as the template's defaults. A copy opened from one of your own templates can also **Update library template** explicitly; that replaces the template's content while the template and the project workflow each keep their own name. Because a template may have changed since you opened it, an update is checked against the revision you last saw; if the template moved on, you can save as new instead, or review the current template and replace it deliberately. Replacing a template affects workflows that call it through **Call Saved Workflow**.- Add comma-separated tags to a workflow (e.g. `portrait, SDXL, upscaling`) when saving it. The tags appear at the bottom of each workflow tile in the library and become selectable filters in the sidebar. Click one or more tags to narrow the list; click **Your Workflows** to clear the filter and show everything again. Tag counts update automatically when you create, edit, or delete a workflow.+ Add comma-separated tags to a workflow (e.g. `portrait, SDXL, upscaling`) in its details. The tags appear at the bottom of each tile in the library and become selectable filters in the sidebar. Click one or more tags to narrow the list; click **Yours** to clear the filter and show everything again.</Card><Card title="Linear View" icon="list-format">Create a custom UI for your workflow, making it easier to iterate on your generations. The Linear UI View is saved alongside the workflow, allowing you to share workflows and enable others to use them.diff --git a/invokeai/frontend/webv2/ARCHITECTURE.md b/invokeai/frontend/webv2/ARCHITECTURE.mdindex 89f0504b02..8d7e0c582a 100644--- a/invokeai/frontend/webv2/ARCHITECTURE.md+++ b/invokeai/frontend/webv2/ARCHITECTURE.md@@ -46,6 +46,8 @@ Fonts owns its authenticated catalog, managed-library UI, and browser font-regisFont runtime composition and project-file option state travel in the existing shared route chunk. Catalog transport, the Fonts page, and project-file option dialogs load on demand. Missing-font recovery loads only for documents containing custom references. The locale asset plugin serves font-library strings as a separate namespace in development and production, loaded when the library or recovery UI opens; source translations remain in the canonical locale files. Text tool controls load when selected; their shared Canvas/Layer form and interaction dependencies remain grouped to avoid extra widget-activation requests. Catalog query keys have a lightweight public entry so invalidating an imported font does not pull the transport into startup.+Projects own their workflows. The Workbench aggregate keeps an ordered workflow collection with an active selection and one session edit history per workflow (`src/workbench/projectWorkflows.ts`); the project document is schema 3 and `migrateProjectDocument` in `projects/projectDocument.ts` is the single migration boundary for older documents. Workflow reads the active workflow through the App-composed port and edits, publishes and presents documents; it never replaces authored project work. The library is written only by the Workflow-owned publication controller, which captures the account, project, workflow and content before it starts, refuses to overlap itself per workflow, reconciles a lost answer against the destination record before resending, and records the resulting library id and revision on the originating workflow alone. Queue submissions carry the originating project workflow so seed advances, node progress and run previews return to it whatever is active later.+Workbench persistence follows the same lifetime rule. `createWorkbenchPersistenceRuntime` owns hydration ordering, debounced autosave, revision/generation checks, conflict application, reconnect replay, status publication, and disposal without importing React. `createSyncedWorkbenchPersistence` constructs the local/remote project synchronization state for one mounted Workbench; no process-wide maps, sets, flags, or caches hold that state. `WorkbenchProvider` only constructs these lifetimes, starts/disposes the runtime through the mount lifecycle adapter, and selects aggregate hydration state.## Contract ownership@@ -97,7 +99,7 @@ Feature interfaces remain ordinary module interfaces unless two adapters add lev| Queue | Backend queue state, realtime interpretation, submission/reconciliation and Queue UI; App runtime, Workbench aggregate/shell, Generation/Gallery/Workflow | Platform and public envelopes/capabilities from Identity, Models, Generation, Workflow, Upscale; backend port, queue reads/commands and widget contribution || Gallery | Image collection, selection, board policy and Gallery UI; App adapter, Generation, Workflow, Upscale, Workbench image actions | Platform and Queue's public progress reads; gallery reads/commands and widget contribution || Generation | Generation settings, validation, graph compilation and Generate UI; Workbench invocation, Queue, Gallery, Workflow, Upscale | Platform and public Models/Gallery/Queue interfaces; settings/validation, compiled submission envelope and widget contribution |-| Workflow | Workflow document, validation, compilation, preview/editor/library; App adapter, Workbench invocation, Nodes | Platform and public Nodes/Models/Gallery/Queue/Generation interfaces; document reads/commands, compiled submission envelope and widget contribution |+| Workflow | Workflow document, validation, compilation, preview/editor/library and explicit publication; App adapter, Workbench invocation, Nodes | Platform and public Nodes/Models/Gallery/Queue/Generation interfaces; document reads/commands, compiled submission envelope and widget contribution || Upscale | Upscale settings, validation, compilation and UI; Workbench invocation and Queue | Platform and public Models/Gallery/Queue interfaces; value/validation reads, submission command and widget contribution || Intermediates | Per-project intermediates read models, cleanup previews/operations and the Settings section that manages them; Workbench settings, project menus, account administration | Platform plus Identity's public session/capability reads; query keys, read models, the focus intent, the browser hold lease and the `settingsContribution` metadata whose loader owns the section body |diff --git a/invokeai/frontend/webv2/src/workbench/projects/README.md b/invokeai/frontend/webv2/src/workbench/projects/README.mdindex 1fa5cc4e8f..18b4d7e776 100644--- a/invokeai/frontend/webv2/src/workbench/projects/README.md+++ b/invokeai/frontend/webv2/src/workbench/projects/README.md@@ -2,7 +2,15 @@The backend project record is authoritative. Writes use `expected_revision`; a divergent revision or remotely deleted project requires an explicit user decision. Editing can continue while that decision is pending. Saving a copy reuses one reserved identity through `createProjectSettled`, including after a lost response.-`ProjectDocumentV2` allowlists editable document fields. Queue runs, events, graph history, and undo are not project documents. Documents are limited to 32 MiB of UTF-8 JSON on both sides of the API. The workflow library is the durable home for saved workflows; undo and capped events are session-only.+`ProjectDocumentV3` allowlists editable document fields. Queue runs, events, undo and per-workflow edit histories are not project documents. Documents are limited to 32 MiB of UTF-8 JSON on both sides of the API.++## Workflows++A project owns an ordered workflow collection (`workflows.entries`) and remembers its active workflow. Each entry carries the editable document, optional source metadata (the library template it was opened from or last explicitly saved to, with the content revision then observed, or `null` when unknown) and the newest successful run's output. Source metadata sits beside the document, outside graph edit history, so undoing an edit never undoes a save. `projectWorkflows.ts` owns membership, selection and the session histories (one per workflow, 40 entries per project across all of them, structurally shared); Workflow owns editing, serialization, library transport and presentation.++Projects autosave their workflows. The library changes only through explicit publication (`features/workflow/data/publication.ts`): saving as a new template or updating the source at exactly the revision the copy last saw; a stale revision is a 409 the user resolves. Every media reference in every workflow, active or not, takes part in reference indexing, cleanup protection, duplication and archive export.++`migrateProjectDocument` is the one migration boundary. Unversioned (schema 1) and schema 2 documents become schema 3 with their single `projectGraph` as the first, active workflow; a `libraryWorkflowId` becomes a source with an unknown revision, never assumed to match the library's current contents. Server loads, recovery drafts, duplication and `.invk` import all pass through it; every write path emits schema 3. Malformed collections (dangling active id, repeated ids, damaged entries) and structurally damaged workflow documents are refused rather than repaired or replaced with blanks; a refused document is reported, left untouched on the server, and its raw content stays available for export. Same-server duplication keeps source references; `.invk` import clears them, because a portable file never names a library write target.Canvas uploads carrying a project id await that identity’s acknowledged server creation through the mounted persistence service. Uploads waiting on an unacknowledged project share one serialized creation attempt, and a failed attempt answers further uploads for a few seconds before another is made; later uploads use the acknowledged identity without flushing unrelated edits. Only a closed project, an account change, engine disposal or the operation's own cancellation stops an upload, and those stop the wait immediately. Any other outcome (creation failed or offline, a conflict, or a server that no longer knows the project and refuses the id) sends the upload without a project id. Such uploads are never re-associated with the project later, so the project's intermediates cleanup does not see them.