From 0282aa83c5f4ee23f0d80aaf75f84e751cd8e127 Mon Sep 17 00:00:00 2001 From: blessedcoolant <54517381+blessedcoolant@users.noreply.github.com> Date: Wed, 12 Jul 2023 14:32:54 +1200 Subject: [PATCH] feat: Do not store edge styling data when saving a graph setup --- .../src/features/nodes/components/ui/SaveNodesButton.tsx | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/invokeai/frontend/web/src/features/nodes/components/ui/SaveNodesButton.tsx b/invokeai/frontend/web/src/features/nodes/components/ui/SaveNodesButton.tsx index 8623fa5cbe..14bf0a1ce8 100644 --- a/invokeai/frontend/web/src/features/nodes/components/ui/SaveNodesButton.tsx +++ b/invokeai/frontend/web/src/features/nodes/components/ui/SaveNodesButton.tsx @@ -1,6 +1,7 @@ import { RootState } from 'app/store/store'; import { useAppSelector } from 'app/store/storeHooks'; import IAIIconButton from 'common/components/IAIIconButton'; +import { map, omit } from 'lodash-es'; import { memo, useCallback } from 'react'; import { useTranslation } from 'react-i18next'; import { FaSave } from 'react-icons/fa'; @@ -14,6 +15,11 @@ const SaveNodesButton = () => { const saveEditorToJSON = useCallback(() => { if (editorInstance) { const editorState = editorInstance.toObject(); + + editorState.edges = map(editorState.edges, (edge) => { + return omit(edge, ['style']); + }); + const nodeSetupJSON = new Blob([JSON.stringify(editorState)]); const nodeDownloadElement = document.createElement('a'); nodeDownloadElement.href = URL.createObjectURL(nodeSetupJSON);