Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: workflow builder #7608

Merged
merged 126 commits into from
Feb 14, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
126 commits
Select commit Hold shift + click to select a range
9bc9cc9
feat(ui): add notes state to fields
psychedelicious Jan 17, 2025
9604229
feat(ui): add notes popover to field title bar
psychedelicious Jan 17, 2025
620717b
feat(ui): show notes icon on editor linear view
psychedelicious Jan 17, 2025
f825b3a
feat(ui): show notes icon on user-linear view, replacing info icon
psychedelicious Jan 17, 2025
6cadf9b
feat(ui): clean up user-linear view styling
psychedelicious Jan 17, 2025
6a26d44
feat(ui): add ViewContext so components can know where they are being…
psychedelicious Jan 17, 2025
c540b3f
perf(ui): use data attribute for input field wrapper styles
psychedelicious Jan 19, 2025
c1e1bdd
refactor(ui): workflows component structure (WIP)
psychedelicious Jan 20, 2025
3448634
refactor(ui): workflows left panel internal components structure
psychedelicious Jan 20, 2025
6ed3b10
fix(ui): remove accidental change to zFieldInput schema
psychedelicious Jan 20, 2025
b3acecd
refactor(ui): continued reorg of components & hooks
psychedelicious Jan 20, 2025
f49abc4
refactor(ui): continued reorg of components & hooks
psychedelicious Jan 20, 2025
635a51c
fix(ui): color field component layout
psychedelicious Jan 20, 2025
75e0cb0
feat(ui): get configurable notes display working
psychedelicious Jan 20, 2025
204ea22
feat(ui): use workflows view context
psychedelicious Jan 20, 2025
c34f314
fix(ui): dynamic prompts infinite recursion (wip)
psychedelicious Jan 20, 2025
e97db15
feat(ui): rough out workflow builder data structure & dummy data
psychedelicious Jan 21, 2025
05eaaa9
refactor(ui): split up float and integer field renderers
psychedelicious Jan 21, 2025
55d61a7
revert(ui): rip out linear view config stuff
psychedelicious Jan 22, 2025
31e74fb
refactor(ui): split integer, float and string field components in pre…
psychedelicious Jan 22, 2025
55969de
feat(ui): rough out workflow builder data structure
psychedelicious Jan 22, 2025
0e1c582
chore(ui): lint
psychedelicious Jan 22, 2025
091c143
feat(ui): iterate on builder (WIP)
psychedelicious Jan 22, 2025
6c346e6
feat(ui): iterate on builder (WIP)
psychedelicious Jan 22, 2025
30a4b92
feat(ui): iterate on builder (WIP)
psychedelicious Jan 22, 2025
f56a30e
feat(ui): iterate on builder (WIP)
psychedelicious Jan 22, 2025
773cf74
feat(ui): getPrefixedId supports custom separator
psychedelicious Jan 22, 2025
f7cd5c9
feat(ui): iterate on builder (WIP)
psychedelicious Jan 22, 2025
8316bdf
feat(ui): iterate on builder (WIP)
psychedelicious Jan 22, 2025
4336d78
feat(ui): iterate on builder (WIP)
psychedelicious Jan 22, 2025
d9a753a
feat(ui): iterate on builder (WIP)
psychedelicious Jan 23, 2025
60851b3
feat(ui): hacking on dnd (WIP)
psychedelicious Jan 23, 2025
bde6f53
feat(ui): dim form element while dragging
psychedelicious Jan 23, 2025
b32136e
feat(ui): dnd mostly working (WIP)
psychedelicious Jan 24, 2025
af3a596
feat(ui): dnd almost fully working (WIP)
psychedelicious Jan 24, 2025
b8d890f
feat(ui): improved dnd hitbox for edges when center drop is allowed
psychedelicious Jan 24, 2025
fa3d445
feat(ui): dnd drop target styling
psychedelicious Jan 24, 2025
218ca8d
fix(ui): do not allow reparenting to self
psychedelicious Jan 24, 2025
6c80e7d
feat(ui): improved drop target styling
psychedelicious Jan 24, 2025
cb8f772
feat(ui): support adding form elements and node fields with dnd
psychedelicious Jan 25, 2025
17eaed7
fix(ui): allow root element to be drop target
psychedelicious Jan 25, 2025
bd9a987
fix(ui): start workflow w/ single column as root
psychedelicious Jan 25, 2025
c59e6e7
fix(ui): use redux store for form
psychedelicious Jan 25, 2025
191eed5
tidy(ui): remove unused mock form builder data
psychedelicious Jan 25, 2025
a75b34b
fix(ui): hide nonfunctional delete button on root form element
psychedelicious Jan 25, 2025
5c5689d
chore(ui): upgrade reactflow to v12
psychedelicious Jan 25, 2025
67f3eaa
refactor(ui): edge rendering
psychedelicious Jan 25, 2025
7c44ceb
tweak(ui): node selection colors
psychedelicious Jan 25, 2025
fc4277a
fix(ui): do not render dashed edges unless animation is enabled
psychedelicious Jan 25, 2025
586c576
fix(ui): node-autoconnect showing invalid connection options
psychedelicious Jan 26, 2025
c49ec96
chore(ui): lint
psychedelicious Jan 26, 2025
7ac1b66
chore(ui): lint
psychedelicious Jan 26, 2025
477d03f
perf(ui): faster InputFieldRenderer
psychedelicious Jan 26, 2025
8d2da24
fix(ui): circular dep
psychedelicious Jan 26, 2025
6a2379e
tidy(ui): import reactflow css in main theme provider
psychedelicious Jan 26, 2025
f2eed4f
feat(ui): plumbing for editable form elements
psychedelicious Jan 30, 2025
56b5eda
chore(ui): bump @invoke-ai/ui-library
psychedelicious Jan 31, 2025
88f0404
feat(ui): editable heading and text elements
psychedelicious Jan 31, 2025
901c15d
fix(ui): drop indicator getting greyed out when dragging over self
psychedelicious Jan 31, 2025
47b97cf
feat(ui): remove sizes from text & heading
psychedelicious Jan 31, 2025
003dea0
refactor(ui): updated component structure for input and output fields
psychedelicious Feb 5, 2025
680c646
feat(ui): builder field settings (WIP)
psychedelicious Feb 5, 2025
69f4895
feat(ui): builder field settings (WIP)
psychedelicious Feb 5, 2025
c1a4245
fix(ui): divider layout
psychedelicious Feb 5, 2025
e7779b7
feat(ui): builder field settings (WIP)
psychedelicious Feb 5, 2025
21300b4
feat(ui): use useEditable in builder
psychedelicious Feb 5, 2025
fdb8496
feat(ui): add float field display settings
psychedelicious Feb 5, 2025
fbc3683
feat(ui): editable node form field labels & descriptions
psychedelicious Feb 6, 2025
624f393
fix(ui): tsc issues
psychedelicious Feb 6, 2025
8e35146
fix(ui): drop target jank
psychedelicious Feb 6, 2025
b315c11
feat(ui): empty state for drop containers
psychedelicious Feb 6, 2025
667405f
feat(ui): builder empty state (WIP)
psychedelicious Feb 6, 2025
ec638dc
feat(ui): string field settings
psychedelicious Feb 6, 2025
a4fa46c
feat(ui): delete form elements when node is deleted from workflow
psychedelicious Feb 6, 2025
47d30dc
feat(ui): iterate on builder data structure
psychedelicious Feb 6, 2025
cb56a7a
fix(ui): remove node field from form correctly when node is deleted
psychedelicious Feb 6, 2025
76cade6
feat(ui): make drop targets that are in root sticky
psychedelicious Feb 6, 2025
186fb4f
feat(ui): builder edit/view buttons
psychedelicious Feb 6, 2025
915dd1a
fix(ui): divider rendering
psychedelicious Feb 6, 2025
35b2d60
refactor(ui): add dispatchAndFlash util for dnd
psychedelicious Feb 6, 2025
647e8ec
tidy(ui): rename root utils in dnd
psychedelicious Feb 6, 2025
d83fc4a
refactor(ui): clean up dnd logic
psychedelicious Feb 6, 2025
b04a82c
refactor(ui): add vars in dnd logic for conciseness
psychedelicious Feb 6, 2025
3921bdf
tidy(ui): dnd logic formatting
psychedelicious Feb 6, 2025
f357908
tidy(ui): improve dnd hook names
psychedelicious Feb 6, 2025
167fa35
tidy(ui): rename builder dnd file
psychedelicious Feb 6, 2025
31b3688
tidy(ui): dnd code lint
psychedelicious Feb 6, 2025
82b3855
revert(ui): code lint that broke stuff
psychedelicious Feb 7, 2025
7d3cc91
feat(ui): workflow builder layout
psychedelicious Feb 7, 2025
596aa05
feat(ui): be double extra sure migrated workflows are parsed before l…
psychedelicious Feb 7, 2025
984dace
fix(ui): do not error in node/field selectors are used outside field …
psychedelicious Feb 7, 2025
95261f9
feat(ui): migrated linear view exposed fields to builder form on load
psychedelicious Feb 7, 2025
fb6fc9d
feat(ui): auto-update nodes on loading workflow
psychedelicious Feb 7, 2025
db6c580
tidy(ui): node description components
psychedelicious Feb 7, 2025
890b625
fix(ui): incorrect node data used during update
psychedelicious Feb 7, 2025
7514f78
chore(ui): lint
psychedelicious Feb 7, 2025
1062711
fix(ui): handle form fields not existing on node on workflow load
psychedelicious Feb 7, 2025
af8eb2b
feat(ui): rearrange builder buttons to be less annoying
psychedelicious Feb 7, 2025
d48f396
feat(ui): initial values for form fields (WIP)
psychedelicious Feb 7, 2025
75fb2a3
tidy(ui): extract util in dnd
psychedelicious Feb 11, 2025
7ae5cc5
tidy(ui): useNodeFieldDnd
psychedelicious Feb 11, 2025
f259d8e
feat(ui): demote dnd logs to trace
psychedelicious Feb 11, 2025
1fab4e7
refactor(ui): remove confusing `containerId` from various builder act…
psychedelicious Feb 11, 2025
e379857
feat(ui): default form field settings
psychedelicious Feb 11, 2025
1b07ef9
tweak(ui): layout of workflow builder field settings
psychedelicious Feb 11, 2025
a1ed784
feat(ui): better placeholders for text/heading
psychedelicious Feb 11, 2025
ea0b327
feat(ui): add initial values for builder fields
psychedelicious Feb 11, 2025
3aaffa4
feat(ui): remove the showLabel flag for node fields
psychedelicious Feb 11, 2025
cd3d152
tidy(ui): builder dnd monitor logic rearrange
psychedelicious Feb 11, 2025
045747a
fix(ui): ignore dropping on self
psychedelicious Feb 11, 2025
e66490f
feat(ui): remove node field reset button from edit mode header
psychedelicious Feb 11, 2025
54532a1
tweak(ui): styling for edit mode
psychedelicious Feb 11, 2025
5d2ea42
feat(ui): remove element id from edit mode header
psychedelicious Feb 11, 2025
15075df
feat(ui): text and heading element default content is empty string
psychedelicious Feb 11, 2025
5c7269c
feat(ui): remove separate flag for form vs workflow edit mode
psychedelicious Feb 11, 2025
26fbb40
feat(ui): consolidate row/column dnd draggables into container
psychedelicious Feb 11, 2025
8e6290b
tweak(ui): builder padding
psychedelicious Feb 11, 2025
a6257eb
tidy(ui): remove nonfunctional conditionals
psychedelicious Feb 11, 2025
dc3e5f1
fix(ui): remove images from node image collections when deleted
psychedelicious Feb 11, 2025
ff92654
feat(ui): add delete button to missing image placeholder for image co…
psychedelicious Feb 11, 2025
38162ad
fix(ui): force refetch when checking image access to ensure stale RTK…
psychedelicious Feb 11, 2025
58106c5
feat(ui): check image access for image collections when loading workf…
psychedelicious Feb 11, 2025
da4f43f
feat(ui): add warning about alpha status of builder
psychedelicious Feb 11, 2025
b23efa9
tweak(ui): form element edit mode styling
psychedelicious Feb 11, 2025
9ae978a
feat(ui): give vertical dividers a min height
psychedelicious Feb 11, 2025
daa41a5
chore(ui): knip
psychedelicious Feb 12, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 3 additions & 2 deletions invokeai/frontend/web/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -58,10 +58,11 @@
"@dagrejs/dagre": "^1.1.4",
"@dagrejs/graphlib": "^2.2.4",
"@fontsource-variable/inter": "^5.1.0",
"@invoke-ai/ui-library": "^0.0.44",
"@invoke-ai/ui-library": "^0.0.46",
"@nanostores/react": "^0.7.3",
"@reduxjs/toolkit": "2.2.3",
"@roarr/browser-log-writer": "^1.3.0",
"@xyflow/react": "^12.4.2",
"async-mutex": "^0.5.0",
"chakra-react-select": "^4.9.2",
"cmdk": "^1.0.0",
Expand Down Expand Up @@ -96,9 +97,9 @@
"react-icons": "^5.3.0",
"react-redux": "9.1.2",
"react-resizable-panels": "^2.1.4",
"react-textarea-autosize": "^8.5.7",
"react-use": "^17.5.1",
"react-virtuoso": "^4.10.4",
"reactflow": "^11.11.4",
"redux-dynamic-middlewares": "^2.2.0",
"redux-remember": "^5.1.0",
"redux-undo": "^1.1.0",
Expand Down
586 changes: 267 additions & 319 deletions invokeai/frontend/web/pnpm-lock.yaml

Large diffs are not rendered by default.

29 changes: 27 additions & 2 deletions invokeai/frontend/web/public/locales/en.json
Original file line number Diff line number Diff line change
Expand Up @@ -187,7 +187,10 @@
"values": "Values",
"resetToDefaults": "Reset to Defaults",
"seed": "Seed",
"combinatorial": "Combinatorial"
"combinatorial": "Combinatorial",
"layout": "Layout",
"row": "Row",
"column": "Column"
},
"hrf": {
"hrf": "High Resolution Fix",
Expand Down Expand Up @@ -931,13 +934,15 @@
"noWorkflows": "No Workflows",
"noMatchingWorkflows": "No Matching Workflows",
"noWorkflow": "No Workflow",
"unableToUpdateNode": "Node update failed: node {{node}} of type {{type}} (may require deleting and recreating)",
"mismatchedVersion": "Invalid node: node {{node}} of type {{type}} has mismatched version (try updating?)",
"missingTemplate": "Invalid node: node {{node}} of type {{type}} missing template (not installed?)",
"sourceNodeDoesNotExist": "Invalid edge: source/output node {{node}} does not exist",
"targetNodeDoesNotExist": "Invalid edge: target/input node {{node}} does not exist",
"sourceNodeFieldDoesNotExist": "Invalid edge: source/output field {{node}}.{{field}} does not exist",
"targetNodeFieldDoesNotExist": "Invalid edge: target/input field {{node}}.{{field}} does not exist",
"deletedInvalidEdge": "Deleted invalid edge {{source}} -> {{target}}",
"deletedMissingNodeFieldFormElement": "Deleted missing form field: node {{nodeId}} field {{fieldName}}",
"noConnectionInProgress": "No connection in progress",
"node": "Node",
"nodeOutputs": "Node Outputs",
Expand All @@ -952,6 +957,7 @@
"nodeVersion": "Node Version",
"noOutputRecorded": "No outputs recorded",
"notes": "Notes",
"description": "Description",
"notesDescription": "Add notes about your workflow",
"problemSettingTitle": "Problem Setting Title",
"resetToDefaultValue": "Reset to default value",
Expand Down Expand Up @@ -1694,7 +1700,26 @@
"download": "Download",
"copyShareLink": "Copy Share Link",
"copyShareLinkForWorkflow": "Copy Share Link for Workflow",
"delete": "Delete"
"delete": "Delete",
"builder": {
"builder": "Builder",
"layout": "Layout",
"row": "Row",
"column": "Column",
"label": "Label",
"description": "Description",
"component": "Component",
"numberInput": "Number Input",
"slider": "Slider",
"both": "Both",
"emptyRootPlaceholderViewMode": "Click Edit to start building a form for this workflow.",
"emptyRootPlaceholderEditMode": "Drag a form element or node field here to get started.",
"containerPlaceholder": "Empty Container",
"containerPlaceholderDesc": "Drag a form element or node field into this container.",
"headingPlaceholder": "Empty Heading",
"textPlaceholder": "Empty Text",
"workflowBuilderAlphaWarning": "The workflow builder is currently in alpha. There may be breaking changes before the stable release."
}
},
"controlLayers": {
"regional": "Regional",
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import '@fontsource-variable/inter';
import 'overlayscrollbars/overlayscrollbars.css';
import '@xyflow/react/dist/base.css';

import { ChakraProvider, DarkMode, extendTheme, theme as _theme, TOAST_OPTIONS } from '@invoke-ai/ui-library';
import type { ReactNode } from 'react';
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,36 +8,50 @@ import { imageDeletionConfirmed } from 'features/deleteImageModal/store/actions'
import { isModalOpenChanged } from 'features/deleteImageModal/store/slice';
import { selectListImagesQueryArgs } from 'features/gallery/store/gallerySelectors';
import { imageSelected } from 'features/gallery/store/gallerySlice';
import { fieldImageValueChanged } from 'features/nodes/store/nodesSlice';
import { isImageFieldInputInstance } from 'features/nodes/types/field';
import { fieldImageCollectionValueChanged, fieldImageValueChanged } from 'features/nodes/store/nodesSlice';
import { isImageFieldCollectionInputInstance, isImageFieldInputInstance } from 'features/nodes/types/field';
import { isInvocationNode } from 'features/nodes/types/invocation';
import { forEach, intersectionBy } from 'lodash-es';
import { imagesApi } from 'services/api/endpoints/images';
import type { ImageDTO } from 'services/api/types';
import type { Param0 } from 'tsafe';

const log = logger('gallery');

//TODO(psyche): handle image deletion (canvas staging area?)

// Some utils to delete images from different parts of the app
const deleteNodesImages = (state: RootState, dispatch: AppDispatch, imageDTO: ImageDTO) => {
const actions: Param0<typeof dispatch>[] = [];
state.nodes.present.nodes.forEach((node) => {
if (!isInvocationNode(node)) {
return;
}

forEach(node.data.inputs, (input) => {
if (isImageFieldInputInstance(input) && input.value?.image_name === imageDTO.image_name) {
dispatch(
actions.push(
fieldImageValueChanged({
nodeId: node.data.id,
fieldName: input.name,
value: undefined,
})
);
return;
}
if (isImageFieldCollectionInputInstance(input)) {
actions.push(
fieldImageCollectionValueChanged({
nodeId: node.data.id,
fieldName: input.name,
value: input.value?.filter((value) => value?.image_name !== imageDTO.image_name),
})
);
}
});
});

actions.forEach(dispatch);
};

const deleteControlLayerImages = (state: RootState, dispatch: AppDispatch, imageDTO: ImageDTO) => {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { logger } from 'app/logging/logger';
import type { AppStartListening } from 'app/store/middleware/listenerMiddleware';
import { $nodeExecutionStates } from 'features/nodes/hooks/useExecutionState';
import { $nodeExecutionStates } from 'features/nodes/hooks/useNodeExecutionState';
import { workflowLoaded, workflowLoadRequested } from 'features/nodes/store/actions';
import { $templates } from 'features/nodes/store/nodesSlice';
import { $needsFit } from 'features/nodes/store/reactFlowInstance';
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import type { As, ChakraProps, FlexProps } from '@invoke-ai/ui-library';
import type { ChakraProps, FlexProps } from '@invoke-ai/ui-library';
import { Flex, Icon, Skeleton, Spinner, Text } from '@invoke-ai/ui-library';
import type { ElementType } from 'react';
import { memo, useMemo } from 'react';
import { PiImageBold } from 'react-icons/pi';
import type { ImageDTO } from 'services/api/types';
Expand Down Expand Up @@ -28,7 +29,7 @@ IAILoadingImageFallback.displayName = 'IAILoadingImageFallback';

type IAINoImageFallbackProps = FlexProps & {
label?: string;
icon?: As | null;
icon?: ElementType | null;
boxSize?: ChakraProps['boxSize'];
};

Expand Down

This file was deleted.

Loading
Loading