From f8a09b84913b433927dbae2f8cf700baabce44f7 Mon Sep 17 00:00:00 2001 From: 6174 Date: Wed, 24 Jan 2024 10:02:54 +0800 Subject: [PATCH 01/37] add postive & negative state to sdnode --- .npmrc | 2 +- .../reactflow-node/reactflow-node.tsx | 4 +-- .../comfui-interfaces/comfy-node-types.ts | 4 ++- packages/common/store/app-state.ts | 25 +++++++++++++++++++ tsconfig.json | 2 +- turbo.json | 2 +- 6 files changed, 33 insertions(+), 6 deletions(-) diff --git a/.npmrc b/.npmrc index ded82e2f..096cda1e 100755 --- a/.npmrc +++ b/.npmrc @@ -1 +1 @@ -auto-install-peers = true +auto-install-peers = true diff --git a/apps/electron-frontend/src/components/workflow-editor/reactflow-node/reactflow-node.tsx b/apps/electron-frontend/src/components/workflow-editor/reactflow-node/reactflow-node.tsx index a6a0734d..d7618199 100644 --- a/apps/electron-frontend/src/components/workflow-editor/reactflow-node/reactflow-node.tsx +++ b/apps/electron-frontend/src/components/workflow-editor/reactflow-node/reactflow-node.tsx @@ -2,7 +2,7 @@ import { memo, useCallback, useEffect, useRef, useState } from 'react' import { type NodeProps, Position, type HandleType, Handle, NodeResizeControl, Connection, Dimensions} from 'reactflow' import { Widget, Input, SDNode, PreviewImage, SDNODE_DEFAULT_COLOR, ContrlAfterGeneratedValuesOptions } from '@comflowy/common/comfui-interfaces'; -import { Image, Popover, Progress } from 'antd'; +import { Image, Popover } from 'antd'; import { InputContainer } from '../reactflow-input/reactflow-input-container'; import nodeStyles from "./reactflow-node.style.module.scss"; import { getImagePreviewUrl } from '@comflowy/common/comfyui-bridge/bridge'; @@ -11,7 +11,7 @@ import { useAppStore } from '@comflowy/common/store'; import { validateEdge } from '@comflowy/common/store/app-state'; import Color from "color"; import { getWidgetIcon } from './reactflow-node-icons'; -import { ImageWithDownload, PreviewGroupWithDownload } from '../reactflow-gallery/image-with-download'; +import { PreviewGroupWithDownload } from '../reactflow-gallery/image-with-download'; import { ComfyUINodeError } from '@comflowy/common/comfui-interfaces/comfy-error-types'; export const NODE_IDENTIFIER = 'sdNode' diff --git a/packages/common/comfui-interfaces/comfy-node-types.ts b/packages/common/comfui-interfaces/comfy-node-types.ts index 57f51836..2fe055e5 100755 --- a/packages/common/comfui-interfaces/comfy-node-types.ts +++ b/packages/common/comfui-interfaces/comfy-node-types.ts @@ -17,7 +17,9 @@ export interface SDNode { color?: string; bgcolor?: string; title?: string; - properties?: any + properties?: any; + isPositive?: boolean; + isNegative?: boolean; } export type SDNodeColorOption = { diff --git a/packages/common/store/app-state.ts b/packages/common/store/app-state.ts index eab31d49..635569b2 100644 --- a/packages/common/store/app-state.ts +++ b/packages/common/store/app-state.ts @@ -180,6 +180,8 @@ export const AppState = { ...state.graph, [node.id]: { ...node.value, + isPositive: false, + isNegative: false, images: state.graph[node.id]?.images || node.images || [], } } @@ -359,9 +361,32 @@ export const useAppStore = create((set, get) => ({ console.log(`Unknown widget ${node.value.widget}`) } } + for (const connection of workflow.connections) { state = AppState.addConnection(state, connection) } + + /** + * Check is postive of is negative connection, and update graph + */ + for (const connection of workflow.connections) { + const sourceNode = state.graph[connection.source]; + const targetNode = state.graph[connection.target]; + const sourceOutputs = sourceNode.outputs; + const targetInputs = targetNode.inputs; + const output = sourceOutputs.find(output => output.name.toUpperCase() === connection.sourceHandle); + const input = targetInputs.find(input => input.name.toUpperCase() === connection.targetHandle); + const sourceGraphNode = state.graph[connection.source]; + if (output && input) { + if (output.type === "CONDITIONING") { + if (input.name === "negative") { + sourceGraphNode.isNegative = true; + } else if (input.name === "positive") { + sourceGraphNode.isPositive = true; + } + } + } + } return { ...state, } diff --git a/tsconfig.json b/tsconfig.json index a682c3b8..5563b847 100755 --- a/tsconfig.json +++ b/tsconfig.json @@ -2,7 +2,7 @@ "extends": "tsconfig/base.json", "compilerOptions": { "target": "es6", - "module": "commonjs", + "module": "commonjs", "esModuleInterop": true, "resolveJsonModule": true } diff --git a/turbo.json b/turbo.json index ec4d016d..d4803156 100755 --- a/turbo.json +++ b/turbo.json @@ -4,7 +4,7 @@ "pipeline": { "build": { "dependsOn": ["^build"], - "outputs": [".next/**", "!.next/cache/**"] + "outputs": [".next/**", "!.next/cache/**"] }, "lint": {}, "dev": { From 69d3db0993111f6ce295753a12f69b72c2b55210 Mon Sep 17 00:00:00 2001 From: 6174 Date: Wed, 24 Jan 2024 10:12:23 +0800 Subject: [PATCH 02/37] update version --- apps/electron-backend/package.json | 2 +- apps/electron-frontend/.env | 2 +- apps/electron-package/package.json | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/apps/electron-backend/package.json b/apps/electron-backend/package.json index aedf1c04..665c11de 100644 --- a/apps/electron-backend/package.json +++ b/apps/electron-backend/package.json @@ -1,6 +1,6 @@ { "name": "comflowy", - "version": "0.0.3-alpha", + "version": "0.0.4-alpha", "private": true, "main": "layers/main/dist/index.js", "scripts": { diff --git a/apps/electron-frontend/.env b/apps/electron-frontend/.env index 35a30695..9c0b2f4f 100644 --- a/apps/electron-frontend/.env +++ b/apps/electron-frontend/.env @@ -1 +1 @@ -NEXT_PUBLIC_APP_VERSION=0.0.3-alpha \ No newline at end of file +NEXT_PUBLIC_APP_VERSION=0.0.4-alpha \ No newline at end of file diff --git a/apps/electron-package/package.json b/apps/electron-package/package.json index efc01ab5..55b52687 100644 --- a/apps/electron-package/package.json +++ b/apps/electron-package/package.json @@ -1,6 +1,6 @@ { "name": "comflowy", - "version": "0.0.3-alpha", + "version": "0.0.4-alpha", "private": true, "main": "layers/main/dist/index.js", "scripts": { From 5e9050dc20741541f7982ac7c5758b1b860dee88 Mon Sep 17 00:00:00 2001 From: 6174 Date: Wed, 24 Jan 2024 10:33:10 +0800 Subject: [PATCH 03/37] #135, Auto Update Positive & Negative Text Node Style --- .../reactflow-node-container.tsx | 4 +++ .../reactflow-node.style.module.scss | 12 ++++++- .../reactflow-node/reactflow-node.tsx | 35 +++++++++++++++---- 3 files changed, 44 insertions(+), 7 deletions(-) diff --git a/apps/electron-frontend/src/components/workflow-editor/reactflow-node/reactflow-node-container.tsx b/apps/electron-frontend/src/components/workflow-editor/reactflow-node/reactflow-node-container.tsx index 49b6209b..0e139d41 100644 --- a/apps/electron-frontend/src/components/workflow-editor/reactflow-node/reactflow-node-container.tsx +++ b/apps/electron-frontend/src/components/workflow-editor/reactflow-node/reactflow-node-container.tsx @@ -13,6 +13,8 @@ export type FlowNodeProps = NodeProps<{ export const NodeContainer = memo((props: FlowNodeProps): JSX.Element => { const progressBar = useAppStore(st => st.nodeInProgress?.id === props.id ? st.nodeInProgress.progress : undefined); const imagePreviews = useAppStore(st => st.graph[props.id]?.images || []); + const isPositive = useAppStore(st => st.graph[props.id]?.isPositive); + const isNegative = useAppStore(st => st.graph[props.id]?.isNegative); const widget = useAppStore(st => st.widgets[props.data.widget.name]) || { ...UnknownWidget, name: props.data.value.widget, @@ -22,6 +24,8 @@ export const NodeContainer = memo((props: FlowNodeProps): JSX.Element => { return ( + isPositive: boolean; + isNegative: boolean; progressBar?: number; nodeError?: ComfyUINodeError; widget: Widget; @@ -32,6 +34,8 @@ export const NodeComponent = memo(({ node, nodeError, progressBar, + isPositive, + isNegative, widget, imagePreviews, }: Props): JSX.Element => { @@ -167,8 +171,7 @@ export const NodeComponent = memo(({ const invisible = transform < 0.2; - const nodeBgColor = node.data.value.bgcolor || SDNODE_DEFAULT_COLOR.bgcolor; - + const imagePreviewsWithSrc = (imagePreviews||[]).map((image, index) => { const imageSrc = getImagePreviewUrl(image.filename, image.type, image.subfolder) return { @@ -176,6 +179,20 @@ export const NodeComponent = memo(({ filename: image.filename } }); + + let nodeBgColor = node.data.value.bgcolor || SDNODE_DEFAULT_COLOR.bgcolor; + let nodeColor = node.data.value.color || SDNODE_DEFAULT_COLOR.color; + + if (isPositive) { + nodeBgColor = "#212923"; + nodeColor = "#67A166"; + } + + if (isNegative) { + nodeBgColor = "#261E1F"; + nodeColor = "#DE654B"; + } + return (

- {getWidgetIcon(widget)} {nodeTitle} + {getWidgetIcon(widget)} + {nodeTitle} + {isPositive && {"("}Positive{")"}} + {isNegative && {"("}Negative{")"}} +

{isInProgress? From d64d8c4e214d55c85ec83e24ac9e41cb142a4b57 Mon Sep 17 00:00:00 2001 From: 6174 Date: Wed, 24 Jan 2024 10:38:08 +0800 Subject: [PATCH 04/37] fix: https://github.com/6174/comflowyspace/issues/117 --- packages/common/store/app-state.ts | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/packages/common/store/app-state.ts b/packages/common/store/app-state.ts index 635569b2..e341183a 100644 --- a/packages/common/store/app-state.ts +++ b/packages/common/store/app-state.ts @@ -367,7 +367,7 @@ export const useAppStore = create((set, get) => ({ } /** - * Check is postive of is negative connection, and update graph + * Check is postive or is negative connection, and update graph */ for (const connection of workflow.connections) { const sourceNode = state.graph[connection.source]; @@ -523,6 +523,7 @@ export const useAppStore = create((set, get) => ({ value }); onSyncFromYjsDoc(); + set(AppState.attatchStaticCheckErrors(get())); }, onNodeAttributeChange: (id: string, updates) => { const { doc, onSyncFromYjsDoc } = get(); From 2fd76d86a6f3579133be23625848a7ac6da6d9d9 Mon Sep 17 00:00:00 2001 From: 6174 Date: Wed, 24 Jan 2024 11:34:34 +0800 Subject: [PATCH 05/37] bugfix --- .../websocket-controller/websocket-controller.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/apps/electron-frontend/src/components/workflow-editor/websocket-controller/websocket-controller.tsx b/apps/electron-frontend/src/components/workflow-editor/websocket-controller/websocket-controller.tsx index 7d176c75..28e4e282 100644 --- a/apps/electron-frontend/src/components/workflow-editor/websocket-controller/websocket-controller.tsx +++ b/apps/electron-frontend/src/components/workflow-editor/websocket-controller/websocket-controller.tsx @@ -59,7 +59,7 @@ export function WsController(): JSX.Element { useEffect(() => { const disposable = SlotGlobalEvent.on((event) => { - if (event.type = GlobalEvents.comfyui_process_error) { + if (event.type === GlobalEvents.comfyui_process_error) { message.error("Runtime Error: " + event.data.message); } }) From 31e880efccb28cae01f7d4e7e41e34df97a845db Mon Sep 17 00:00:00 2001 From: 6174 Date: Wed, 24 Jan 2024 14:53:01 +0800 Subject: [PATCH 06/37] add retry logic of install python venv. fix #148 --- apps/node/src/modules/comfyui/bootstrap.ts | 31 +++++++++++++++------- 1 file changed, 21 insertions(+), 10 deletions(-) diff --git a/apps/node/src/modules/comfyui/bootstrap.ts b/apps/node/src/modules/comfyui/bootstrap.ts index 75f58e59..ac528960 100644 --- a/apps/node/src/modules/comfyui/bootstrap.ts +++ b/apps/node/src/modules/comfyui/bootstrap.ts @@ -153,16 +153,27 @@ export async function installPythonTask(dispatcher: TaskEventDispatcher): Promis }); return true; } - try { - dispatcher({ - message: `Start installing Python=3.10.8` - }); - await runCommand(`conda create -c anaconda -n ${CONDA_ENV_NAME} python=3.10.8 -y`, dispatcher); - dispatcher({ - message: `Install Python=3.10.8 finished` - }); - } catch (e: any) { - throw new Error(`Install python error: ${e.message}`) + + let success = false; + let lastError = null; + for (let i = 0; i < 5; i++) { + try { + dispatcher({ + message: `Start installing Python=3.10.8` + }); + await runCommand(`conda create -c anaconda -n ${CONDA_ENV_NAME} python=3.10.8 -y`, dispatcher); + dispatcher({ + message: `Install Python=3.10.8 finished` + }); + success = true; + break; + } catch (e: any) { + lastError = e; + } + } + + if (!success) { + throw new Error(`Install python error: ${lastError.message}`); } return true; } From f59aa07d61f949fc30460a2e6b9243a8b4e047e5 Mon Sep 17 00:00:00 2001 From: 6174 Date: Wed, 24 Jan 2024 14:56:45 +0800 Subject: [PATCH 07/37] fix install conda report File or directory already exists problem #149 --- apps/node/src/modules/comfyui/bootstrap.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/apps/node/src/modules/comfyui/bootstrap.ts b/apps/node/src/modules/comfyui/bootstrap.ts index ac528960..9527ccfe 100644 --- a/apps/node/src/modules/comfyui/bootstrap.ts +++ b/apps/node/src/modules/comfyui/bootstrap.ts @@ -128,7 +128,7 @@ export async function installCondaTask(dispatcher: TaskEventDispatcher): Promise } else if (systemType.toUpperCase().includes("LINUX")) { installerUrl = 'https://repo.anaconda.com/miniconda/Miniconda3-latest-Linux-x86_64.sh'; installerPath = path.resolve(appTmpDir, './Miniconda3-latest-Linux-x86_64.sh'); - installCommand = ['bash', [installerPath, '-b']]; + installCommand = ['bash', [installerPath, '-b', '-u']]; } await downloadUrl(dispatcher,installerUrl!, installerPath!) await runCommand(`${installCommand[0]} ${installCommand[1].join(" ")}`, dispatcher) From ad3878c08884d3a4912c3e16030f08ca2a850b8c Mon Sep 17 00:00:00 2001 From: 6174 Date: Wed, 24 Jan 2024 15:10:17 +0800 Subject: [PATCH 08/37] add retry for main task --- apps/node/src/modules/comfyui/bootstrap.ts | 248 ++++++++++++--------- 1 file changed, 145 insertions(+), 103 deletions(-) diff --git a/apps/node/src/modules/comfyui/bootstrap.ts b/apps/node/src/modules/comfyui/bootstrap.ts index 9527ccfe..4f9a7ce9 100644 --- a/apps/node/src/modules/comfyui/bootstrap.ts +++ b/apps/node/src/modules/comfyui/bootstrap.ts @@ -99,44 +99,52 @@ export async function checkIfInstalled(name: string): Promise { * @returns */ export async function installCondaTask(dispatcher: TaskEventDispatcher): Promise { - if (await checkIfInstalled("conda")) { - dispatcher({ - message: `Already Find Conda` - }); - return true; - } - dispatcher({ - message: `Start install conda` - }); - try { - let installerUrl, installerPath, installCommand: any[] = []; - if (systemType.toUpperCase().includes("WINDOWS")) { - installerUrl = 'https://repo.anaconda.com/miniconda/Miniconda3-latest-Windows-x86_64.exe'; - installerPath = path.resolve(appTmpDir, './Miniconda3-latest-Windows-x86_64.exe'); - installCommand = [installerPath, ['/InstallationType=JustMe', '/RegisterPython=0', '/S', '/D=C:\\tools\\Miniconda3']]; - } else if (systemType.toUpperCase().includes("DARWIN")) { - const architecture = await getMacArchitecture(); - installerUrl = architecture === 'arm64' - ? 'https://repo.anaconda.com/miniconda/Miniconda3-latest-MacOSX-arm64.sh' - : 'https://repo.anaconda.com/miniconda/Miniconda3-latest-MacOSX-x86_64.sh'; - installerPath = path.resolve(appTmpDir, architecture === 'arm64' - ? 'Miniconda3-latest-MacOSX-arm64.sh' - : 'Miniconda3-latest-MacOSX-x86_64.sh' - ); - - installCommand = ['bash', [installerPath, '-b']]; - } else if (systemType.toUpperCase().includes("LINUX")) { - installerUrl = 'https://repo.anaconda.com/miniconda/Miniconda3-latest-Linux-x86_64.sh'; - installerPath = path.resolve(appTmpDir, './Miniconda3-latest-Linux-x86_64.sh'); - installCommand = ['bash', [installerPath, '-b', '-u']]; + let success = false; + let lastError = null; + for (let i = 0; i < 3; i++) { + try { + if (await checkIfInstalled("conda")) { + dispatcher({ + message: `Already Find Conda` + }); + return true; + } + dispatcher({ + message: `Start install conda` + }); + let installerUrl, installerPath, installCommand: any[] = []; + if (systemType.toUpperCase().includes("WINDOWS")) { + installerUrl = 'https://repo.anaconda.com/miniconda/Miniconda3-latest-Windows-x86_64.exe'; + installerPath = path.resolve(appTmpDir, './Miniconda3-latest-Windows-x86_64.exe'); + installCommand = [installerPath, ['/InstallationType=JustMe', '/RegisterPython=0', '/S', '/D=C:\\tools\\Miniconda3']]; + } else if (systemType.toUpperCase().includes("DARWIN")) { + const architecture = await getMacArchitecture(); + installerUrl = architecture === 'arm64' + ? 'https://repo.anaconda.com/miniconda/Miniconda3-latest-MacOSX-arm64.sh' + : 'https://repo.anaconda.com/miniconda/Miniconda3-latest-MacOSX-x86_64.sh'; + installerPath = path.resolve(appTmpDir, architecture === 'arm64' + ? 'Miniconda3-latest-MacOSX-arm64.sh' + : 'Miniconda3-latest-MacOSX-x86_64.sh' + ); + + installCommand = ['bash', [installerPath, '-b']]; + } else if (systemType.toUpperCase().includes("LINUX")) { + installerUrl = 'https://repo.anaconda.com/miniconda/Miniconda3-latest-Linux-x86_64.sh'; + installerPath = path.resolve(appTmpDir, './Miniconda3-latest-Linux-x86_64.sh'); + installCommand = ['bash', [installerPath, '-b', '-u']]; + } + await downloadUrl(dispatcher,installerUrl!, installerPath!) + await runCommand(`${installCommand[0]} ${installCommand[1].join(" ")}`, dispatcher) + dispatcher({ + message: `Install conda end` + }); + success = true; + } catch (e: any) { + lastError = e; } - await downloadUrl(dispatcher,installerUrl!, installerPath!) - await runCommand(`${installCommand[0]} ${installCommand[1].join(" ")}`, dispatcher) - dispatcher({ - message: `Install conda end` - }); - } catch (e: any) { - throw new Error(`Install conda error: ${e.message}`) + } + if (!success) { + throw new Error(`Install conda error: ${lastError.message}`) } return true; } @@ -147,17 +155,16 @@ export async function installCondaTask(dispatcher: TaskEventDispatcher): Promise * @returns */ export async function installPythonTask(dispatcher: TaskEventDispatcher): Promise { - if (await checkIfInstalled("python")) { - dispatcher({ - message: `Already Find Python=3.10.8` - }); - return true; - } - let success = false; let lastError = null; - for (let i = 0; i < 5; i++) { + for (let i = 0; i < 3; i++) { try { + if (await checkIfInstalled("python")) { + dispatcher({ + message: `Already Find Python=3.10.8` + }); + return true; + } dispatcher({ message: `Start installing Python=3.10.8` }); @@ -187,20 +194,31 @@ export async function installPythonTask(dispatcher: TaskEventDispatcher): Promis export async function installCondaPackageTask(dispatcher: TaskEventDispatcher, params: { packageRequirment: string }): Promise { - try { - dispatcher({ - message: `Start installing ${params.packageRequirment}...` - }); - if (await checkIfInstalled(params.packageRequirment.split("=")[0])) { - return true; + let success = false; + let lastError = null; + + for (let i = 0; i < 3; i++) { + try { + dispatcher({ + message: `Start installing ${params.packageRequirment}...` + }); + if (await checkIfInstalled(params.packageRequirment.split("=")[0])) { + return true; + } + await runCommand(`conda install -c anaconda ${params.packageRequirment}`, dispatcher); + dispatcher({ + message: `Install ${params.packageRequirment} end` + }); + success = true; + } catch(e: any) { + lastError = e } - await runCommand(`conda install -c anaconda ${params.packageRequirment}`, dispatcher); - dispatcher({ - message: `Install ${params.packageRequirment} end` - }); - } catch(e: any) { - throw new Error(`Install conda packages error: ${e.message}`) } + + if (!success) { + new Error(`Install conda packages error: ${lastError.message}`) + } + return true; } @@ -216,37 +234,51 @@ export async function installPyTorchForGPU(dispatcher: TaskEventDispatcher, nigh dispatcher({ message: "Start installing PyTorch..." }); - if (isMac) { - try { - const installCommand = `${PIP_PATH} install --pre torch torchvision torchaudio --extra-index-url https://download.pytorch.org/whl/nightly/cpu`; - await runCommand(installCommand, dispatcher); - } catch (error: any) { - throw new Error(`PyTorch installation failed: ${error.message}`) - } - } else { - try { - const gpuType = await getGPUType() - // AMD GPU - if (gpuType === 'amd') { - const rocmVersion = nightly ? 'rocm5.7' : 'rocm5.6'; - const installCommand = nightly - ? `${PIP_PATH} install --pre torch torchvision torchaudio --index-url https://download.pytorch.org/whl/nightly/${rocmVersion}` - : ` ${PIP_PATH} install torch torchvision torchaudio --index-url https://download.pytorch.org/whl/${rocmVersion}`; + let success = false; + let lastError = null; + for (let i = 0; i < 3; i++) { + if (isMac) { + try { + const installCommand = `${PIP_PATH} install --pre torch torchvision torchaudio --extra-index-url https://download.pytorch.org/whl/nightly/cpu`; await runCommand(installCommand, dispatcher); + success = true; + } catch (error: any) { + lastError = error; } - // NVIDIA GPU - else if (gpuType === 'nvidia') { - const installCommand = `${PIP_PATH} install torch torchvision torchaudio --extra-index-url https://download.pytorch.org/whl/cu121`; + } else { + try { + const gpuType = await getGPUType() + // AMD GPU + if (gpuType === 'amd') { + const rocmVersion = nightly ? 'rocm5.7' : 'rocm5.6'; + const installCommand = nightly + ? `${PIP_PATH} install --pre torch torchvision torchaudio --index-url https://download.pytorch.org/whl/nightly/${rocmVersion}` + : ` ${PIP_PATH} install torch torchvision torchaudio --index-url https://download.pytorch.org/whl/${rocmVersion}`; - await runCommand(installCommand, dispatcher); - } else { - throw new Error(`Unkown GPU Type`) + await runCommand(installCommand, dispatcher); + success = true; + } + // NVIDIA GPU + else if (gpuType === 'nvidia') { + const installCommand = `${PIP_PATH} install torch torchvision torchaudio --extra-index-url https://download.pytorch.org/whl/cu121`; + + await runCommand(installCommand, dispatcher); + success = true; + } else { + lastError = new Error(`Unkown GPU Type`) + } + + } catch (error: any) { + lastError = error; } - } catch (error: any) { - throw new Error(`PyTorch installation failed: ${error.message}`) } } + + if (!success) { + throw new Error(`PyTorch installation failed: ${lastError.message}`) + } + dispatcher({ message: "Installing PyTorch Finish" }); @@ -255,33 +287,43 @@ export async function installPyTorchForGPU(dispatcher: TaskEventDispatcher, nigh } export async function cloneComfyUI(dispatch: TaskEventDispatcher): Promise { - try { - dispatch({ - message: 'Start cloning ComfyUI...' - }); + let success = false; + let lastError = null; + for (let i = 0; i < 3; i++) { + try { + const repoPath = getComfyUIDir(); + const parentDir = path.dirname(repoPath); + await fsExtra.ensureDir(parentDir); - const repoPath = getComfyUIDir(); - const parentDir = path.dirname(repoPath); - await fsExtra.ensureDir(parentDir); + if (!await checkIfInstalledComfyUI()) { + dispatch({ + message: 'Start cloning ComfyUI...' + }); + await runCommand(`git clone https://github.com/comfyanonymous/ComfyUI`, dispatch, { + cwd: parentDir + }); + } - await runCommand(`git clone https://github.com/comfyanonymous/ComfyUI`, dispatch, { - cwd: parentDir - }); + await runCommand(`${PIP_PATH} install -r requirements.txt`, dispatch, { + cwd: repoPath + }); - await runCommand(`${PIP_PATH} install -r requirements.txt`, dispatch, { - cwd: repoPath - }); + const sdPath = getStableDiffusionDir() + if (sdPath !== "") { + createOrUpdateExtraConfigFileFromStableDiffusion(sdPath) + } - const sdPath = getStableDiffusionDir() - if (sdPath !== "") { - createOrUpdateExtraConfigFileFromStableDiffusion(sdPath) - } + dispatch({ + message: "clone comfyui success" + }); - dispatch({ - message: "clone comfyui success" - }); - } catch (error: any) { - throw new Error(`clone comfyui error: ${error.message}`); + success = true; + } catch (error: any) { + lastError = error; + } + } + if (!success) { + throw new Error(`clone comfyui error: ${lastError.message}`); } return true; } From 51c88ef6d494a13d8e666effa46379084d9c54eb Mon Sep 17 00:00:00 2001 From: 6174 Date: Wed, 24 Jan 2024 15:25:40 +0800 Subject: [PATCH 09/37] Error catch for auto update --- .../layers/main/src/auto-update.ts | 18 +++++++++++------- 1 file changed, 11 insertions(+), 7 deletions(-) diff --git a/apps/electron-backend/layers/main/src/auto-update.ts b/apps/electron-backend/layers/main/src/auto-update.ts index efd9d395..62e97091 100644 --- a/apps/electron-backend/layers/main/src/auto-update.ts +++ b/apps/electron-backend/layers/main/src/auto-update.ts @@ -18,10 +18,10 @@ export function startAutoUpdater() { // showMessage("Update Available", "A new version " + info.version + " is available") try { - autoUpdater.downloadUpdate(); + await autoUpdater.downloadUpdate(); } catch(err: any) { logger.error("download update error: " + err.message); - showMessage("Update App Error", "There was a problem updating the application: " + err.message) + // showMessage("Update App Error", "There was a problem updating the application: " + err.message) } }); @@ -55,19 +55,23 @@ export function startAutoUpdater() { } } -function startUpdateCheck(timeInterval: number) { +async function startUpdateCheck(timeInterval: number) { try { if (!findAvaliableUpdate) { - autoUpdater.checkForUpdates(); + await autoUpdater.checkForUpdates(); } - updateCheckIntervaId = setInterval(() => { + updateCheckIntervaId = setInterval(async () => { if (!findAvaliableUpdate) { - autoUpdater.checkForUpdates(); + try { + await autoUpdater.checkForUpdates(); + } catch(err: any) { + logger.error("auto update error: " + err.message) + } } }, timeInterval); } catch(err: any) { logger.error("auto update error: " + err.message) - showMessage("Update App Error", "There was a problem updating the application: " + err.message) + // showMessage("Update App Error", "There was a problem updating the application: " + err.message) } } From ebc2beaebc51d74eeed886d0c65893c282be4fe8 Mon Sep 17 00:00:00 2001 From: 6174 Date: Wed, 24 Jan 2024 16:45:13 +0800 Subject: [PATCH 10/37] attach old prompt error when error check --- packages/common/store/app-state.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/common/store/app-state.ts b/packages/common/store/app-state.ts index e341183a..8ccf0719 100644 --- a/packages/common/store/app-state.ts +++ b/packages/common/store/app-state.ts @@ -205,7 +205,7 @@ export const AppState = { }, attatchStaticCheckErrors(state: AppState, error?: ComfyUIExecuteError): AppState { // check all nodes are valid; - let flowError: ComfyUIExecuteError | undefined = error || { + let flowError: ComfyUIExecuteError | undefined = error || state.promptError || { error: { message: "" }, From 7fe52a3983d190c0a3d51819b4139ff4df15e889 Mon Sep 17 00:00:00 2001 From: 6174 Date: Wed, 24 Jan 2024 16:50:31 +0800 Subject: [PATCH 11/37] clean message --- apps/node/src/modules/task-queue/task-queue.ts | 5 ----- packages/common/store/dashboard-state.ts | 2 +- 2 files changed, 1 insertion(+), 6 deletions(-) diff --git a/apps/node/src/modules/task-queue/task-queue.ts b/apps/node/src/modules/task-queue/task-queue.ts index 2c6fc185..f58c49b1 100644 --- a/apps/node/src/modules/task-queue/task-queue.ts +++ b/apps/node/src/modules/task-queue/task-queue.ts @@ -39,11 +39,6 @@ class TaskQueue { private processJob = async (job: TaskProps, done: Done) => { const { executor, params } = job; - this.#dispatchTaskProgressEvent({ - type: "PROGRESS", - task: job, - message: "Start task " + job.name - }); try { const result = await executor((event) => { this.#dispatchTaskProgressEvent({ diff --git a/packages/common/store/dashboard-state.ts b/packages/common/store/dashboard-state.ts index 13d33913..54670e18 100644 --- a/packages/common/store/dashboard-state.ts +++ b/packages/common/store/dashboard-state.ts @@ -91,7 +91,7 @@ function checkEnvRequirements(env: EnvRequirements): BootstrapTask[] { }); tasks.push({ type: BootStrapTaskType.installPython, - title: "Install Python", + title: "Create Conda venv", description: "ComfyUI need a safe and proper python enviroment to run. We will use conda to create virtual env called comflowy to manage your python & pip packages", finished: env.isPythonInstalled }); From 984ecfebf4a7ed616b479c34c8c6d55cb2d797e9 Mon Sep 17 00:00:00 2001 From: 6174 Date: Wed, 24 Jan 2024 17:56:29 +0800 Subject: [PATCH 12/37] Add missing widget UI & basic state --- ...eactflow-missing-widgets.style.module.scss | 15 +++++ .../reactflow-missing-widgets.tsx | 59 +++++++++++++++++++ .../reactflow-node.style.module.scss | 4 ++ .../reactflow-node/reactflow-node.tsx | 44 ++++++++++++-- .../workflow-editor/workflow-editor.tsx | 16 ++++- .../comfui-interfaces/comfy-error-types.ts | 13 ++-- packages/common/store/app-state.ts | 9 ++- packages/common/store/extension-state.ts | 20 ++++++- packages/common/utils/slot-event.ts | 3 +- 9 files changed, 164 insertions(+), 19 deletions(-) create mode 100644 apps/electron-frontend/src/components/workflow-editor/reactflow-missing-widgets/reactflow-missing-widgets.style.module.scss create mode 100644 apps/electron-frontend/src/components/workflow-editor/reactflow-missing-widgets/reactflow-missing-widgets.tsx diff --git a/apps/electron-frontend/src/components/workflow-editor/reactflow-missing-widgets/reactflow-missing-widgets.style.module.scss b/apps/electron-frontend/src/components/workflow-editor/reactflow-missing-widgets/reactflow-missing-widgets.style.module.scss new file mode 100644 index 00000000..96973bfe --- /dev/null +++ b/apps/electron-frontend/src/components/workflow-editor/reactflow-missing-widgets/reactflow-missing-widgets.style.module.scss @@ -0,0 +1,15 @@ +.missingWidgetsContent { + :global { + .widget-list{ + display: flex; + flex-direction: column; + align-items: center; + justify-content: center; + height: 100%; + width: 100%; + padding: 0 20px; + overflow-y: auto; + overflow-x: hidden; + } + } +} \ No newline at end of file diff --git a/apps/electron-frontend/src/components/workflow-editor/reactflow-missing-widgets/reactflow-missing-widgets.tsx b/apps/electron-frontend/src/components/workflow-editor/reactflow-missing-widgets/reactflow-missing-widgets.tsx new file mode 100644 index 00000000..e9d5ba97 --- /dev/null +++ b/apps/electron-frontend/src/components/workflow-editor/reactflow-missing-widgets/reactflow-missing-widgets.tsx @@ -0,0 +1,59 @@ +import { memo, useCallback, useEffect, useState } from "react"; +import styles from "./reactflow-missing-widgets.style.module.scss"; +import { DraggableModal } from "ui/antd/draggable-modal"; +import { GlobalEvents, SlotGlobalEvent } from "@comflowy/common/utils/slot-event"; +/** + * Component for install missing widgets + */ +export const MissingWidgetsPopoverEntry = memo(() => { + const [visible, setVisible] = useState(false); + const showModal = () => { + setVisible(true); + }; + + const handleOk = e => { + console.log(e); + setVisible(false); + }; + + const handleCancel = useCallback(e => { + console.log(e); + setVisible(false); + }, [setVisible]); + + useEffect(() => { + const disposable = SlotGlobalEvent.on((event) => { + if (event.type === GlobalEvents.show_missing_widgets_modal) { + showModal(); + } + }); + return () => { + disposable.dispose(); + } + }, []); + + return ( +
+ + + +
+ ) +}); + +function MissingWidgetInstallHelper() { + return ( +
+ missing widgets +
+ ) +} \ No newline at end of file diff --git a/apps/electron-frontend/src/components/workflow-editor/reactflow-node/reactflow-node.style.module.scss b/apps/electron-frontend/src/components/workflow-editor/reactflow-node/reactflow-node.style.module.scss index 51c9ee5b..9ffeda1a 100644 --- a/apps/electron-frontend/src/components/workflow-editor/reactflow-node/reactflow-node.style.module.scss +++ b/apps/electron-frontend/src/components/workflow-editor/reactflow-node/reactflow-node.style.module.scss @@ -294,6 +294,10 @@ top: -3em; left: 0.5em; } + + .install-missing-widget { + padding: 0 10px; + } } } diff --git a/apps/electron-frontend/src/components/workflow-editor/reactflow-node/reactflow-node.tsx b/apps/electron-frontend/src/components/workflow-editor/reactflow-node/reactflow-node.tsx index 07981c24..f080f6de 100644 --- a/apps/electron-frontend/src/components/workflow-editor/reactflow-node/reactflow-node.tsx +++ b/apps/electron-frontend/src/components/workflow-editor/reactflow-node/reactflow-node.tsx @@ -1,8 +1,8 @@ -import { memo, useCallback, useEffect, useRef, useState } from 'react' +import { memo, useCallback, useEffect, useRef, useState, useSyncExternalStore } from 'react' import { type NodeProps, Position, type HandleType, Handle, NodeResizeControl, Connection, Dimensions} from 'reactflow' import { Widget, Input, SDNode, PreviewImage, SDNODE_DEFAULT_COLOR, ContrlAfterGeneratedValuesOptions } from '@comflowy/common/comfui-interfaces'; -import { Image, Popover } from 'antd'; +import { Button, Image, Popover } from 'antd'; import { InputContainer } from '../reactflow-input/reactflow-input-container'; import nodeStyles from "./reactflow-node.style.module.scss"; import { getImagePreviewUrl } from '@comflowy/common/comfyui-bridge/bridge'; @@ -12,7 +12,8 @@ import { validateEdge } from '@comflowy/common/store/app-state'; import Color from "color"; import { getWidgetIcon } from './reactflow-node-icons'; import { PreviewGroupWithDownload } from '../reactflow-gallery/image-with-download'; -import { ComfyUINodeError } from '@comflowy/common/comfui-interfaces/comfy-error-types'; +import { ComfyUIErrorTypes, ComfyUINodeError } from '@comflowy/common/comfui-interfaces/comfy-error-types'; +import { useExtensionsState } from '@comflowy/common/store/extension-state'; export const NODE_IDENTIFIER = 'sdNode' @@ -265,12 +266,13 @@ export const NodeComponent = memo(({ ))}
- +
{params.map(({ property, input }) => ( ))}
+
@@ -350,7 +352,6 @@ function Slot({ id, label, type, position, valueType }: SlotProps): JSX.Element transformFactor = Math.max(1, (1 / transform)) * 2.8; }; - return (
st.extensions); + const extensionsNodeMap = useExtensionsState(st => st.extensionNodeMap); + const {nodeError, node} = props; + + if (!nodeError) { + return null; + } + const widgetNotFoundError = nodeError.errors.find(err => err.type === ComfyUIErrorTypes.widget_not_found); + + if (!widgetNotFoundError) { + return null; + } + + const widget = node.widget; + const extension = extensionsNodeMap[widget]; + console.log(widget, extension, extensionsNodeMap) + if (!extension) { + return null + } else { + console.log("extension", extension); + } + + return ( +
+ +
+ ) +} + diff --git a/apps/electron-frontend/src/components/workflow-editor/workflow-editor.tsx b/apps/electron-frontend/src/components/workflow-editor/workflow-editor.tsx index e4b66e99..9a0e945f 100755 --- a/apps/electron-frontend/src/components/workflow-editor/workflow-editor.tsx +++ b/apps/electron-frontend/src/components/workflow-editor/workflow-editor.tsx @@ -19,6 +19,9 @@ import { copyNodes, pasteNodes } from './reactflow-clipboard'; import { ReactflowExtensionController } from '@/lib/extensions/extensions.controller'; import { WidgetTreeOnPanel, WidgetTreeOnPanelContext } from './reactflow-bottomcenter-panel/widget-tree/widget-tree-on-panel-click'; import { onEdgeUpdateFailed } from './reactflow-connecting'; +import { useExtensionsState } from '@comflowy/common/store/extension-state'; +import { message } from 'antd'; +import { MissingWidgetsPopoverEntry } from './reactflow-missing-widgets/reactflow-missing-widgets'; const nodeTypes = { [NODE_IDENTIFIER]: NodeContainer, @@ -26,6 +29,7 @@ const nodeTypes = { } export default function WorkflowEditor() { const [inited, setInited] = React.useState(false); + const onInitExtensionState = useExtensionsState((st) => st.onInit); const { nodes, widgets, edges, inprogressNodeId, selectionMode, transform, onTransformStart, onTransformEnd, onConnectStart, onConnectEnd, onDeleteNodes, onAddNode, onEdgesDelete,onNodesChange, onEdgesChange, onEdgesUpdate, onEdgeUpdateStart, onEdgeUpdateEnd, onLoadWorkflow, onConnect, onInit, onChangeDragingAndResizingState} = useAppStore((st) => ({ nodes: st.nodes, widgets: st.widgets, @@ -388,9 +392,14 @@ export default function WorkflowEditor() { onChangeDragingAndResizingState(false); }} onInit={async (instance) => { - setReactFlowInstance(instance); - await onInit(instance); - setInited(true); + try { + setReactFlowInstance(instance); + await onInitExtensionState(false); + await onInit(instance); + setInited(true); + } catch(err) { + message.error("App init failed: " + err.message); + } }} > @@ -413,6 +422,7 @@ export default function WorkflowEditor() { { widgetTreeContext && } +
) } diff --git a/packages/common/comfui-interfaces/comfy-error-types.ts b/packages/common/comfui-interfaces/comfy-error-types.ts index 2540f339..2b5a1587 100644 --- a/packages/common/comfui-interfaces/comfy-error-types.ts +++ b/packages/common/comfui-interfaces/comfy-error-types.ts @@ -56,9 +56,12 @@ // } // } // } +export enum ComfyUIErrorTypes { + widget_not_found = "widget_not_found", +} -export interface ComfyUIError { - type?: string; +export type ComfyUIError = { + type?: ComfyUIErrorTypes | string; message: string; details?: string; extra_info?: { @@ -68,13 +71,15 @@ export interface ComfyUIError { } | any; }; -export interface ComfyUINodeError { + +export type ComfyUINodeError = { errors: ComfyUIError[]; dependent_outputs?: string[]; class_type?: string; + extra_info?: any; } -export interface ComfyUIExecuteError { +export type ComfyUIExecuteError = { error: ComfyUIError; node_errors: Record; } \ No newline at end of file diff --git a/packages/common/store/app-state.ts b/packages/common/store/app-state.ts index 8ccf0719..5cb05000 100644 --- a/packages/common/store/app-state.ts +++ b/packages/common/store/app-state.ts @@ -48,7 +48,7 @@ import exifr from 'exifr' import { uuid } from '../utils'; import { SlotEvent } from '../utils/slot-event'; -import { ComfyUIExecuteError } from '../comfui-interfaces/comfy-error-types'; +import { ComfyUIErrorTypes, ComfyUIExecuteError } from '../comfui-interfaces/comfy-error-types'; import { ComfyUIEvents } from '../comfui-interfaces/comfy-event-types'; export type SelectionMode = "figma" | "default"; @@ -226,9 +226,12 @@ export const AppState = { // check widget exist if (!widget) { error.errors.push({ - type: "widget_not_found", + type: ComfyUIErrorTypes.widget_not_found, message: `Widget \`${sdnode.widget}\` not found`, - details: `${sdnode.widget}` + details: `${sdnode.widget}`, + extra_info: { + widget: sdnode.widget + } }); findError = true; flowError!.node_errors[id] = error as any; diff --git a/packages/common/store/extension-state.ts b/packages/common/store/extension-state.ts index 56e3524f..4328c646 100644 --- a/packages/common/store/extension-state.ts +++ b/packages/common/store/extension-state.ts @@ -14,7 +14,7 @@ export type Extension = { export type ExtensionsState = { extensions: Extension[], loading: boolean, - extensionNodeMap: Record + extensionNodeMap: Record } export type ExtensionsAction = { @@ -32,9 +32,23 @@ export const useExtensionsState = create((se set({ loading: false, extensions: extensions, - extensionNodeMap: extensionNodeMap + extensionNodeMap: transformModeMap(extensionNodeMap, extensions) }); console.log("extension infos", ret); } }, -})); \ No newline at end of file +})); + +export function transformModeMap(extensionNodeMap: Record, extensions: Extension[]): Record { + const ret: Record = {}; + for (let extensionName in extensionNodeMap) { + const widgetList = extensionNodeMap[extensionName]; + const extension = extensions.find(ext => ext.title === extensionName); + if (extension) { + widgetList.forEach(widgetName => { + ret[widgetName] = extension; + }) + } + } + return ret; +} \ No newline at end of file diff --git a/packages/common/utils/slot-event.ts b/packages/common/utils/slot-event.ts index 61bf8423..854114a7 100755 --- a/packages/common/utils/slot-event.ts +++ b/packages/common/utils/slot-event.ts @@ -131,7 +131,8 @@ export enum GlobalEvents { execution_interrupted = "execution_interrupted", restart_comfyui = "restart_comfyui", initial_launch = "initial_launch", - comfyui_process_error = "comfyui_process_error" + comfyui_process_error = "comfyui_process_error", + show_missing_widgets_modal = "show_missing_widgets_modal" } export type GlobalEventKeys = keyof typeof GlobalEvents; From cc366784eec71466a4cc73eb43d2deec3b85dc31 Mon Sep 17 00:00:00 2001 From: 6174 Date: Wed, 24 Jan 2024 18:28:51 +0800 Subject: [PATCH 13/37] show missing widget list --- ...eactflow-missing-widgets.style.module.scss | 22 ++++--- .../reactflow-missing-widgets.tsx | 62 ++++++++++++++++++- .../reactflow-node/reactflow-node.tsx | 14 ++++- .../comfui-interfaces/comfy-error-types.ts | 1 + packages/common/store/app-state.ts | 35 +++++++---- 5 files changed, 106 insertions(+), 28 deletions(-) diff --git a/apps/electron-frontend/src/components/workflow-editor/reactflow-missing-widgets/reactflow-missing-widgets.style.module.scss b/apps/electron-frontend/src/components/workflow-editor/reactflow-missing-widgets/reactflow-missing-widgets.style.module.scss index 96973bfe..afdf48a8 100644 --- a/apps/electron-frontend/src/components/workflow-editor/reactflow-missing-widgets/reactflow-missing-widgets.style.module.scss +++ b/apps/electron-frontend/src/components/workflow-editor/reactflow-missing-widgets/reactflow-missing-widgets.style.module.scss @@ -1,15 +1,17 @@ .missingWidgetsContent { + padding: 10px; :global { - .widget-list{ - display: flex; - flex-direction: column; - align-items: center; - justify-content: center; - height: 100%; - width: 100%; - padding: 0 20px; - overflow-y: auto; - overflow-x: hidden; + .extension-item { + margin-bottom: 20px; + border-bottom: solid 1px var(--borderColor); + .extension-item-description { + font-size: 14px; + opacity: .8; + line-height: 1.2; + max-height: 60px; + overflow: hidden; + margin-bottom: 10px; + } } } } \ No newline at end of file diff --git a/apps/electron-frontend/src/components/workflow-editor/reactflow-missing-widgets/reactflow-missing-widgets.tsx b/apps/electron-frontend/src/components/workflow-editor/reactflow-missing-widgets/reactflow-missing-widgets.tsx index e9d5ba97..d7def12f 100644 --- a/apps/electron-frontend/src/components/workflow-editor/reactflow-missing-widgets/reactflow-missing-widgets.tsx +++ b/apps/electron-frontend/src/components/workflow-editor/reactflow-missing-widgets/reactflow-missing-widgets.tsx @@ -2,6 +2,13 @@ import { memo, useCallback, useEffect, useState } from "react"; import styles from "./reactflow-missing-widgets.style.module.scss"; import { DraggableModal } from "ui/antd/draggable-modal"; import { GlobalEvents, SlotGlobalEvent } from "@comflowy/common/utils/slot-event"; +import { useAppStore } from "@comflowy/common/store"; +import { Extension, useExtensionsState } from "@comflowy/common/store/extension-state"; +import { ExtensionIcon } from "ui/icons"; +import { openExternalURL } from "@/lib/electron-bridge"; +import { Button, Space } from "antd"; + +import extensionStyles from "../../extension-manager/extension-manager.style.module.scss"; /** * Component for install missing widgets */ @@ -17,7 +24,6 @@ export const MissingWidgetsPopoverEntry = memo(() => { }; const handleCancel = useCallback(e => { - console.log(e); setVisible(false); }, [setVisible]); @@ -35,7 +41,7 @@ export const MissingWidgetsPopoverEntry = memo(() => { return (
{ }); function MissingWidgetInstallHelper() { + const unknownWidgets = useAppStore(st => st.unknownWidgets); + const extensionsNodeMap = useExtensionsState(st => st.extensionNodeMap); + + const extensions = new Set(); + unknownWidgets.forEach(widgetName => { + const extension = extensionsNodeMap[widgetName]; + if (extension) { + extensions.add(extension); + } + }); + + const extensionsArr: Extension[] = []; + extensions.forEach(extension => { + extensionsArr.push(extension); + }); + + return (
- missing widgets + {extensionsArr.map(extension => { + return + })} +
+ ) +} + +function ExtensionItem(props: { + extension: Extension +}) { + const {extension} = props; + const title = ( +
+
+ +
+
+
{extension.title}
+ +
+
+ +
+
+ ) + + return ( +
+ {title} +
{extension.description}
) } \ No newline at end of file diff --git a/apps/electron-frontend/src/components/workflow-editor/reactflow-node/reactflow-node.tsx b/apps/electron-frontend/src/components/workflow-editor/reactflow-node/reactflow-node.tsx index f080f6de..447bedb9 100644 --- a/apps/electron-frontend/src/components/workflow-editor/reactflow-node/reactflow-node.tsx +++ b/apps/electron-frontend/src/components/workflow-editor/reactflow-node/reactflow-node.tsx @@ -14,6 +14,7 @@ import { getWidgetIcon } from './reactflow-node-icons'; import { PreviewGroupWithDownload } from '../reactflow-gallery/image-with-download'; import { ComfyUIErrorTypes, ComfyUINodeError } from '@comflowy/common/comfui-interfaces/comfy-error-types'; import { useExtensionsState } from '@comflowy/common/store/extension-state'; +import { GlobalEvents, SlotGlobalEvent } from '@comflowy/common/utils/slot-event'; export const NODE_IDENTIFIER = 'sdNode' @@ -416,7 +417,6 @@ function InstallMissingWidget(props: { nodeError?: ComfyUINodeError; node: SDNode; }) { - const extensions = useExtensionsState(st => st.extensions); const extensionsNodeMap = useExtensionsState(st => st.extensionNodeMap); const {nodeError, node} = props; @@ -431,16 +431,24 @@ function InstallMissingWidget(props: { const widget = node.widget; const extension = extensionsNodeMap[widget]; - console.log(widget, extension, extensionsNodeMap) if (!extension) { return null } else { console.log("extension", extension); } + const installWidget = useCallback((extension) => { + SlotGlobalEvent.emit({ + type: GlobalEvents.show_missing_widgets_modal, + data: null + }); + }, []); + return (
- +
) } diff --git a/packages/common/comfui-interfaces/comfy-error-types.ts b/packages/common/comfui-interfaces/comfy-error-types.ts index 2b5a1587..aa2dd6d5 100644 --- a/packages/common/comfui-interfaces/comfy-error-types.ts +++ b/packages/common/comfui-interfaces/comfy-error-types.ts @@ -58,6 +58,7 @@ // } export enum ComfyUIErrorTypes { widget_not_found = "widget_not_found", + value_not_in_list = "value_not_in_list" } export type ComfyUIError = { diff --git a/packages/common/store/app-state.ts b/packages/common/store/app-state.ts index 5cb05000..63504e53 100644 --- a/packages/common/store/app-state.ts +++ b/packages/common/store/app-state.ts @@ -65,6 +65,7 @@ export interface AppState { slectionMode: SelectionMode transform: number transforming: boolean + unknownWidgets: Set; // full workflow meta in storage persistedWorkflow: PersistedFullWorkflow | null; @@ -220,19 +221,23 @@ export const AppState = { const sdnode = node.value; const widget = widgets[sdnode.widget]; const error = flowError!.node_errors[id] || { errors: [] }; + if (["Reroute", "PrimitiveNode"].indexOf(sdnode.widget) >= 0) { return; } + // check widget exist if (!widget) { - error.errors.push({ - type: ComfyUIErrorTypes.widget_not_found, - message: `Widget \`${sdnode.widget}\` not found`, - details: `${sdnode.widget}`, - extra_info: { - widget: sdnode.widget - } - }); + if (!error.errors.find(err => err.type === ComfyUIErrorTypes.widget_not_found)) { + error.errors.push({ + type: ComfyUIErrorTypes.widget_not_found, + message: `Widget \`${sdnode.widget}\` not found`, + details: `${sdnode.widget}`, + extra_info: { + widget: sdnode.widget + } + }); + } findError = true; flowError!.node_errors[id] = error as any; } @@ -241,11 +246,14 @@ export const AppState = { const image = sdnode.fields.image; const options = widget.input.required.image[0] as [string]; if (options.indexOf(image) < 0) { - error.errors.push({ - type: "value_not_in_list", + const errorInfo = { + type: ComfyUIErrorTypes.value_not_in_list, message: `Image ${image} not in list`, details: `[ ${options.join(", ")} ]`, - }); + } + if (!error.errors.find(err => err.type === ComfyUIErrorTypes.value_not_in_list && err.message === errorInfo.message)) { + error.errors.push(); + } findError = true; flowError!.node_errors[id] = error; } @@ -275,6 +283,7 @@ export const useAppStore = create((set, get) => ({ graph: {}, nodes: [], edges: [], + unknownWidgets: new Set(), // temporary state slectionMode: "default", @@ -343,7 +352,7 @@ export const useAppStore = create((set, get) => ({ set((st) => { const workflowMap = st.doc.getMap("workflow"); const workflow = workflowMap.toJSON() as PersistedWorkflowDocument; - + const unknownWidgets = new Set(); throttledUpdateDocument({ ...st.persistedWorkflow!, last_edit_time: +new Date(), @@ -361,6 +370,7 @@ export const useAppStore = create((set, get) => ({ name: node.value.widget, display_name: node.value.widget }, node); + unknownWidgets.add(node.value.widget); console.log(`Unknown widget ${node.value.widget}`) } } @@ -392,6 +402,7 @@ export const useAppStore = create((set, get) => ({ } return { ...state, + unknownWidgets } }, true) }, From caa538db4168fa2fa078048a08afc696881e5303 Mon Sep 17 00:00:00 2001 From: 6174 Date: Wed, 24 Jan 2024 20:56:36 +0800 Subject: [PATCH 14/37] install extension bugfix --- .../reactflow-missing-widgets.tsx | 34 +++++++++++++++--- .../reactflow-node/reactflow-node.tsx | 18 +++++----- .../reactflow-topleft-panel.tsx | 4 +++ .../installed-extensions.ts | 13 ++++++- apps/node/src/modules/utils/logger.ts | 6 ++-- apps/node/src/routes/api/extension.ts | 9 +++++ .../comfui-interfaces/comfy-error-types.ts | 3 +- packages/common/store/app-state.ts | 36 ++++++++++--------- 8 files changed, 89 insertions(+), 34 deletions(-) diff --git a/apps/electron-frontend/src/components/workflow-editor/reactflow-missing-widgets/reactflow-missing-widgets.tsx b/apps/electron-frontend/src/components/workflow-editor/reactflow-missing-widgets/reactflow-missing-widgets.tsx index d7def12f..c3c0c96f 100644 --- a/apps/electron-frontend/src/components/workflow-editor/reactflow-missing-widgets/reactflow-missing-widgets.tsx +++ b/apps/electron-frontend/src/components/workflow-editor/reactflow-missing-widgets/reactflow-missing-widgets.tsx @@ -6,9 +6,11 @@ import { useAppStore } from "@comflowy/common/store"; import { Extension, useExtensionsState } from "@comflowy/common/store/extension-state"; import { ExtensionIcon } from "ui/icons"; import { openExternalURL } from "@/lib/electron-bridge"; -import { Button, Space } from "antd"; +import { Button, Space, message } from "antd"; import extensionStyles from "../../extension-manager/extension-manager.style.module.scss"; +import { useRemoteTask } from "@/lib/utils/use-remote-task"; +import { getBackendUrl } from "@comflowy/common/config"; /** * Component for install missing widgets */ @@ -45,8 +47,8 @@ export const MissingWidgetsPopoverEntry = memo(() => { open={visible} className={styles.queueWrapper} onOk={handleOk} - initialWidth={300} - initialHeight={300} + initialWidth={600} + initialHeight={500} onCancel={handleCancel} footer={null} > @@ -87,6 +89,30 @@ function ExtensionItem(props: { extension: Extension }) { const {extension} = props; + const onInitAppState = useAppStore(st => st.onInit); + const onSyncFromYjsDoc = useAppStore(st => st.onSyncFromYjsDoc); + const updateErrorCheck = useAppStore(st => st.updateErrorCheck); + const { startTask, running } = useRemoteTask({ + api: getBackendUrl(`/api/install_extension`), + onMessage: async (msg) => { + console.log(msg); + if (msg.type === "SUCCESS") { + await onInitAppState(); + onSyncFromYjsDoc(); + updateErrorCheck(); + message.success(`${extension.title} installed successfully`); + } + } + }); + + const isLoading = running; + const installExtension = useCallback(() => { + startTask({ + name: "installExtension", + params: extension + }) + }, [extension]); + const title = (
@@ -101,7 +127,7 @@ function ExtensionItem(props: {
- +
) diff --git a/apps/electron-frontend/src/components/workflow-editor/reactflow-node/reactflow-node.tsx b/apps/electron-frontend/src/components/workflow-editor/reactflow-node/reactflow-node.tsx index 447bedb9..884dec71 100644 --- a/apps/electron-frontend/src/components/workflow-editor/reactflow-node/reactflow-node.tsx +++ b/apps/electron-frontend/src/components/workflow-editor/reactflow-node/reactflow-node.tsx @@ -386,7 +386,7 @@ function NodeError({ nodeError }: { nodeError?: ComfyUINodeError }) { setVisible(visible); }; - if (!nodeError) { + if (!nodeError || nodeError.errors.length === 0) { return null } @@ -419,10 +419,17 @@ function InstallMissingWidget(props: { }) { const extensionsNodeMap = useExtensionsState(st => st.extensionNodeMap); const {nodeError, node} = props; + const installWidget = useCallback((extension) => { + SlotGlobalEvent.emit({ + type: GlobalEvents.show_missing_widgets_modal, + data: null + }); + }, []); if (!nodeError) { return null; } + const widgetNotFoundError = nodeError.errors.find(err => err.type === ComfyUIErrorTypes.widget_not_found); if (!widgetNotFoundError) { @@ -437,18 +444,11 @@ function InstallMissingWidget(props: { console.log("extension", extension); } - const installWidget = useCallback((extension) => { - SlotGlobalEvent.emit({ - type: GlobalEvents.show_missing_widgets_modal, - data: null - }); - }, []); - return (
+ }}>Install "{extension.title}"
) } diff --git a/apps/electron-frontend/src/components/workflow-editor/reactflow-topleft-panel/reactflow-topleft-panel.tsx b/apps/electron-frontend/src/components/workflow-editor/reactflow-topleft-panel/reactflow-topleft-panel.tsx index 80ce8c1f..665c6d59 100644 --- a/apps/electron-frontend/src/components/workflow-editor/reactflow-topleft-panel/reactflow-topleft-panel.tsx +++ b/apps/electron-frontend/src/components/workflow-editor/reactflow-topleft-panel/reactflow-topleft-panel.tsx @@ -69,12 +69,16 @@ export function RefreshPageButton() { setVisible(visible); }; const onInit = useAppStore(st => st.onInit); + const onSyncFromYjsDoc = useAppStore(st => st.onSyncFromYjsDoc); + const updateErrorCheck = useAppStore(st => st.updateErrorCheck); const triggerSyncup = useCallback(async () => { if (triggered) { return; } triggered = true; await onInit(); + onSyncFromYjsDoc(); + updateErrorCheck(); message.success("Success"); triggered = false; }, []); diff --git a/apps/node/src/modules/comfy-extension-manager/installed-extensions.ts b/apps/node/src/modules/comfy-extension-manager/installed-extensions.ts index cf5ad935..cf950199 100644 --- a/apps/node/src/modules/comfy-extension-manager/installed-extensions.ts +++ b/apps/node/src/modules/comfy-extension-manager/installed-extensions.ts @@ -22,7 +22,7 @@ export async function findAllInstalledExtensions({ if (file.endsWith('.disabled')) { continue } - const extension = allExtensions.find(it => it.title === file); + const extension = findExtensionByTitle(allExtensions, file); if (extension) { ret.push(_.cloneDeep(extension)); } @@ -33,4 +33,15 @@ export async function findAllInstalledExtensions({ logger.info("findAllFrontendExtensions:", err); return []; } +} + +function findExtensionByTitle(extensions: Extension[], title: string): Extension | undefined { + return extensions.find(it => { + const install_type = it.install_type; + const reference = it.reference; + if (install_type === "git-clone") { + return reference.endsWith(title); + } + return it.title === title; + }); } \ No newline at end of file diff --git a/apps/node/src/modules/utils/logger.ts b/apps/node/src/modules/utils/logger.ts index 77b13e81..290f28db 100644 --- a/apps/node/src/modules/utils/logger.ts +++ b/apps/node/src/modules/utils/logger.ts @@ -33,9 +33,9 @@ const logger = winston.createLogger({ }); if (process.env.NODE_ENV !== 'production') { - logger.add(new winston.transports.Console({ - format: winston.format.simple(), - })); + // logger.add(new winston.transports.Console({ + // format: winston.format.simple(), + // })); } export default logger; \ No newline at end of file diff --git a/apps/node/src/routes/api/extension.ts b/apps/node/src/routes/api/extension.ts index 177f7252..04ae52f1 100644 --- a/apps/node/src/routes/api/extension.ts +++ b/apps/node/src/routes/api/extension.ts @@ -5,6 +5,7 @@ import { comfyExtensionManager } from '../../modules/comfy-extension-manager/com import { Extension } from '../../modules/comfy-extension-manager/types'; import { comfyUIProgressEvent, restartComfyUI } from 'src/modules/comfyui/bootstrap'; import logger from 'src/modules/utils/logger'; +import { checkAExtensionInstalled } from 'src/modules/comfy-extension-manager/check-extension-status'; /** * fetch all extensions @@ -27,6 +28,14 @@ export async function ApiRouteInstallExtension(req: Request, res: Response) { message: event.message || "" }) } + const extension = taskParams.params as Extension; + await checkAExtensionInstalled(extension) + if (extension.installed) { + newDispatcher({ + message: "Extension already installed" + }); + return true; + } await installExtension(newDispatcher, taskParams.params); await restartComfyUI(dispatcher); return true; diff --git a/packages/common/comfui-interfaces/comfy-error-types.ts b/packages/common/comfui-interfaces/comfy-error-types.ts index aa2dd6d5..1e82d867 100644 --- a/packages/common/comfui-interfaces/comfy-error-types.ts +++ b/packages/common/comfui-interfaces/comfy-error-types.ts @@ -58,7 +58,8 @@ // } export enum ComfyUIErrorTypes { widget_not_found = "widget_not_found", - value_not_in_list = "value_not_in_list" + value_not_in_list = "value_not_in_list", + image_not_in_list = "image_not_in_list" } export type ComfyUIError = { diff --git a/packages/common/store/app-state.ts b/packages/common/store/app-state.ts index 63504e53..cd7dd7bf 100644 --- a/packages/common/store/app-state.ts +++ b/packages/common/store/app-state.ts @@ -86,6 +86,7 @@ export interface AppState { resetWorkflowEvent: SlotEvent; // document mutation handler onSyncFromYjsDoc: () => void; + updateErrorCheck: () => void; onNodesChange: OnNodesChange onEdgesChange: OnEdgesChange onDeleteNodes: (changes: (Node | { id: string })[]) => void @@ -226,18 +227,21 @@ export const AppState = { return; } + // clean old errors + error.errors = error.errors.filter(err => { + return err.type !== ComfyUIErrorTypes.widget_not_found && err.type !== ComfyUIErrorTypes.image_not_in_list; + }); + // check widget exist if (!widget) { - if (!error.errors.find(err => err.type === ComfyUIErrorTypes.widget_not_found)) { - error.errors.push({ - type: ComfyUIErrorTypes.widget_not_found, - message: `Widget \`${sdnode.widget}\` not found`, - details: `${sdnode.widget}`, - extra_info: { - widget: sdnode.widget - } - }); - } + error.errors.push({ + type: ComfyUIErrorTypes.widget_not_found, + message: `Widget \`${sdnode.widget}\` not found`, + details: `${sdnode.widget}`, + extra_info: { + widget: sdnode.widget + } + }); findError = true; flowError!.node_errors[id] = error as any; } @@ -246,14 +250,11 @@ export const AppState = { const image = sdnode.fields.image; const options = widget.input.required.image[0] as [string]; if (options.indexOf(image) < 0) { - const errorInfo = { - type: ComfyUIErrorTypes.value_not_in_list, + error.errors.push({ + type: ComfyUIErrorTypes.image_not_in_list, message: `Image ${image} not in list`, details: `[ ${options.join(", ")} ]`, - } - if (!error.errors.find(err => err.type === ComfyUIErrorTypes.value_not_in_list && err.message === errorInfo.message)) { - error.errors.push(); - } + }); findError = true; flowError!.node_errors[id] = error; } @@ -620,6 +621,9 @@ export const useAppStore = create((set, get) => ({ set(AppState.attatchStaticCheckErrors(get())); }, + updateErrorCheck: () => { + set(AppState.attatchStaticCheckErrors(get())); + }, /** * reset workflow from another document * @param workflow From 5e81fe96461c378677414d0d8abfe09f3098c410 Mon Sep 17 00:00:00 2001 From: 6174 Date: Wed, 24 Jan 2024 21:11:39 +0800 Subject: [PATCH 15/37] bugfix --- .../workflow-editor/reactflow-node/reactflow-node.tsx | 2 +- packages/common/store/app-state.ts | 2 +- packages/common/store/extension-state.ts | 2 ++ 3 files changed, 4 insertions(+), 2 deletions(-) diff --git a/apps/electron-frontend/src/components/workflow-editor/reactflow-node/reactflow-node.tsx b/apps/electron-frontend/src/components/workflow-editor/reactflow-node/reactflow-node.tsx index 884dec71..630c818f 100644 --- a/apps/electron-frontend/src/components/workflow-editor/reactflow-node/reactflow-node.tsx +++ b/apps/electron-frontend/src/components/workflow-editor/reactflow-node/reactflow-node.tsx @@ -441,7 +441,7 @@ function InstallMissingWidget(props: { if (!extension) { return null } else { - console.log("extension", extension); + console.log("miss extension", extension, node); } return ( diff --git a/packages/common/store/app-state.ts b/packages/common/store/app-state.ts index cd7dd7bf..a167d5a8 100644 --- a/packages/common/store/app-state.ts +++ b/packages/common/store/app-state.ts @@ -372,7 +372,7 @@ export const useAppStore = create((set, get) => ({ display_name: node.value.widget }, node); unknownWidgets.add(node.value.widget); - console.log(`Unknown widget ${node.value.widget}`) + // console.log(`Unknown widget ${node.value.widget}`) } } diff --git a/packages/common/store/extension-state.ts b/packages/common/store/extension-state.ts index 4328c646..759ddc51 100644 --- a/packages/common/store/extension-state.ts +++ b/packages/common/store/extension-state.ts @@ -6,6 +6,7 @@ export type Extension = { author: string; description: string; installed: boolean; + reference: string; disabled: boolean; need_update: boolean; [_: string]: any @@ -50,5 +51,6 @@ export function transformModeMap(extensionNodeMap: Record, ext }) } } + // console.log("mapping", ret); return ret; } \ No newline at end of file From c00330b84c8a7e88dd0ebfe81520752dfeaf0c54 Mon Sep 17 00:00:00 2001 From: 6174 Date: Wed, 24 Jan 2024 21:19:50 +0800 Subject: [PATCH 16/37] git clone install custom nodes consider recursive case --- .../src/modules/comfy-extension-manager/install-extension.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/apps/node/src/modules/comfy-extension-manager/install-extension.ts b/apps/node/src/modules/comfy-extension-manager/install-extension.ts index 8333c367..cabec94d 100644 --- a/apps/node/src/modules/comfy-extension-manager/install-extension.ts +++ b/apps/node/src/modules/comfy-extension-manager/install-extension.ts @@ -154,7 +154,7 @@ async function gitCloneInstall(dispatcher: TaskEventDispatcher, files: string[]) if (fs.existsSync(repoPath)) { fsExtra.removeSync(repoPath); } - await runCommandWithPty(`git clone ${cleanUrl}`, dispatcher, { + await runCommandWithPty(`git clone ${cleanUrl} --recursive`, dispatcher, { cwd: EXTENTION_FOLDER, }); await executeInstallScript(dispatcher, cleanUrl, repoPath); From e519362d266b4bc8b40400246e466d0acc1af29f Mon Sep 17 00:00:00 2001 From: 6174 Date: Wed, 24 Jan 2024 21:33:27 +0800 Subject: [PATCH 17/37] update text style --- .../reactflow-missing-widgets.style.module.scss | 3 +++ 1 file changed, 3 insertions(+) diff --git a/apps/electron-frontend/src/components/workflow-editor/reactflow-missing-widgets/reactflow-missing-widgets.style.module.scss b/apps/electron-frontend/src/components/workflow-editor/reactflow-missing-widgets/reactflow-missing-widgets.style.module.scss index afdf48a8..107b8202 100644 --- a/apps/electron-frontend/src/components/workflow-editor/reactflow-missing-widgets/reactflow-missing-widgets.style.module.scss +++ b/apps/electron-frontend/src/components/workflow-editor/reactflow-missing-widgets/reactflow-missing-widgets.style.module.scss @@ -12,6 +12,9 @@ overflow: hidden; margin-bottom: 10px; } + .text .name { + max-width: 400px; + } } } } \ No newline at end of file From f223857c5cc961ff45a036eb56bc87ca31bb530d Mon Sep 17 00:00:00 2001 From: 6174 Date: Wed, 24 Jan 2024 22:20:34 +0800 Subject: [PATCH 18/37] click to install --- .../reactflow-missing-widgets.tsx | 20 +++++++++++++++++-- .../reactflow-node/reactflow-node.tsx | 6 ++++++ packages/common/utils/slot-event.ts | 3 ++- 3 files changed, 26 insertions(+), 3 deletions(-) diff --git a/apps/electron-frontend/src/components/workflow-editor/reactflow-missing-widgets/reactflow-missing-widgets.tsx b/apps/electron-frontend/src/components/workflow-editor/reactflow-missing-widgets/reactflow-missing-widgets.tsx index c3c0c96f..5b45bc62 100644 --- a/apps/electron-frontend/src/components/workflow-editor/reactflow-missing-widgets/reactflow-missing-widgets.tsx +++ b/apps/electron-frontend/src/components/workflow-editor/reactflow-missing-widgets/reactflow-missing-widgets.tsx @@ -1,4 +1,4 @@ -import { memo, useCallback, useEffect, useState } from "react"; +import { memo, useCallback, useEffect, useRef, useState } from "react"; import styles from "./reactflow-missing-widgets.style.module.scss"; import { DraggableModal } from "ui/antd/draggable-modal"; import { GlobalEvents, SlotGlobalEvent } from "@comflowy/common/utils/slot-event"; @@ -113,8 +113,24 @@ function ExtensionItem(props: { }) }, [extension]); + const ref = useRef(); + useEffect(() => { + const disposable = SlotGlobalEvent.on((event) => { + if (event.type === GlobalEvents.install_missing_widget) { + const extension2 = event.data as Extension; + if (extension2.title === extension.title) { + // ref.current.scrollIntoView({ behavior: 'auto' }) + installExtension(); + } + } + }); + return () => { + disposable.dispose(); + } + }, [extension, ref]); + const title = ( -
+
diff --git a/apps/electron-frontend/src/components/workflow-editor/reactflow-node/reactflow-node.tsx b/apps/electron-frontend/src/components/workflow-editor/reactflow-node/reactflow-node.tsx index 630c818f..6d4dd2f0 100644 --- a/apps/electron-frontend/src/components/workflow-editor/reactflow-node/reactflow-node.tsx +++ b/apps/electron-frontend/src/components/workflow-editor/reactflow-node/reactflow-node.tsx @@ -424,6 +424,12 @@ function InstallMissingWidget(props: { type: GlobalEvents.show_missing_widgets_modal, data: null }); + setTimeout(() => { + SlotGlobalEvent.emit({ + type: GlobalEvents.install_missing_widget, + data: extension + }); + }, 10); }, []); if (!nodeError) { diff --git a/packages/common/utils/slot-event.ts b/packages/common/utils/slot-event.ts index 854114a7..bb7b9ff0 100755 --- a/packages/common/utils/slot-event.ts +++ b/packages/common/utils/slot-event.ts @@ -132,7 +132,8 @@ export enum GlobalEvents { restart_comfyui = "restart_comfyui", initial_launch = "initial_launch", comfyui_process_error = "comfyui_process_error", - show_missing_widgets_modal = "show_missing_widgets_modal" + show_missing_widgets_modal = "show_missing_widgets_modal", + install_missing_widget = 'install_missing_widget' } export type GlobalEventKeys = keyof typeof GlobalEvents; From 7b2f81d4468f6520fa9b93da895b0280a36ec04d Mon Sep 17 00:00:00 2001 From: 6174 Date: Thu, 25 Jan 2024 16:04:12 +0800 Subject: [PATCH 19/37] replace run command with pty with runcommand --- .../src/modules/comfy-extension-manager/install-extension.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/apps/node/src/modules/comfy-extension-manager/install-extension.ts b/apps/node/src/modules/comfy-extension-manager/install-extension.ts index cabec94d..71c19213 100644 --- a/apps/node/src/modules/comfy-extension-manager/install-extension.ts +++ b/apps/node/src/modules/comfy-extension-manager/install-extension.ts @@ -55,7 +55,7 @@ export async function installExtension(dispatcher: TaskEventDispatcher, extensio dispatcher({ message: `Start installing pip packages ${extension.title}` }); - await runCommandWithPty(`${PIP_PATH} install ${extension.pip.join(" ")}`) + await runCommand(`${PIP_PATH} install ${extension.pip.join(" ")}`) } if (res) { @@ -154,7 +154,7 @@ async function gitCloneInstall(dispatcher: TaskEventDispatcher, files: string[]) if (fs.existsSync(repoPath)) { fsExtra.removeSync(repoPath); } - await runCommandWithPty(`git clone ${cleanUrl} --recursive`, dispatcher, { + await runCommand(`git clone ${cleanUrl} --recursive`, dispatcher, { cwd: EXTENTION_FOLDER, }); await executeInstallScript(dispatcher, cleanUrl, repoPath); From 3f9618c48f4586528b078db8bf5661770f5cfff8 Mon Sep 17 00:00:00 2001 From: 6174 Date: Thu, 25 Jan 2024 16:06:16 +0800 Subject: [PATCH 20/37] update --- .../modules/comfy-extension-manager/install-extension.ts | 6 +++--- apps/node/src/modules/comfyui/bootstrap.ts | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/apps/node/src/modules/comfy-extension-manager/install-extension.ts b/apps/node/src/modules/comfy-extension-manager/install-extension.ts index 71c19213..28b054a0 100644 --- a/apps/node/src/modules/comfy-extension-manager/install-extension.ts +++ b/apps/node/src/modules/comfy-extension-manager/install-extension.ts @@ -5,7 +5,7 @@ import * as unzipper from "unzipper"; import {downloadUrl} from "../utils/download-url"; import { isValidGitUrl } from "../utils/is-valid-git-url"; import { TaskEventDispatcher } from "../task-queue/task-queue"; -import { PIP_PATH, PYTHON_PATH, condaActivate, runCommand, runCommandWithPty } from "../utils/run-command"; +import { PIP_PATH, PYTHON_PATH, condaActivate, runCommand } from "../utils/run-command"; import { getAppTmpDir } from "../utils/get-appdata-dir"; import { checkIfInstalled } from "../comfyui/bootstrap"; import * as fsExtra from "fs-extra" @@ -178,14 +178,14 @@ async function executeInstallScript(dispatcher: TaskEventDispatcher, url: string dispatcher({ message: 'Install: pip packages' }); - await runCommandWithPty(`${PIP_PATH} install -r requirements.txt`, dispatcher, { + await runCommand(`${PIP_PATH} install -r requirements.txt`, dispatcher, { cwd: repoPath, }); } if (fs.existsSync(installScriptPath)) { logger.info('Install: install script'); - await runCommandWithPty(`${PYTHON_PATH} install.py`, dispatcher, { + await runCommand(`${PYTHON_PATH} install.py`, dispatcher, { cwd: repoPath }); } diff --git a/apps/node/src/modules/comfyui/bootstrap.ts b/apps/node/src/modules/comfyui/bootstrap.ts index 4f9a7ce9..93673595 100644 --- a/apps/node/src/modules/comfyui/bootstrap.ts +++ b/apps/node/src/modules/comfyui/bootstrap.ts @@ -448,7 +448,7 @@ export async function updateComfyUI(dispatcher: TaskEventDispatcher): Promise { + await runCommand(`git pull`, (event => { dispatcher(event); const cevent: ComfyUIProgressEventType = { type: "INFO", From 8aec8738d617e6d1fe906b2cad5a4383f32abc19 Mon Sep 17 00:00:00 2001 From: 6174 Date: Thu, 25 Jan 2024 16:14:08 +0800 Subject: [PATCH 21/37] auto close extension popover --- .../reactflow-missing-widgets.tsx | 50 +++++++++++-------- 1 file changed, 28 insertions(+), 22 deletions(-) diff --git a/apps/electron-frontend/src/components/workflow-editor/reactflow-missing-widgets/reactflow-missing-widgets.tsx b/apps/electron-frontend/src/components/workflow-editor/reactflow-missing-widgets/reactflow-missing-widgets.tsx index 5b45bc62..ac3362dc 100644 --- a/apps/electron-frontend/src/components/workflow-editor/reactflow-missing-widgets/reactflow-missing-widgets.tsx +++ b/apps/electron-frontend/src/components/workflow-editor/reactflow-missing-widgets/reactflow-missing-widgets.tsx @@ -21,11 +21,10 @@ export const MissingWidgetsPopoverEntry = memo(() => { }; const handleOk = e => { - console.log(e); setVisible(false); }; - const handleCancel = useCallback(e => { + const handleCancel = useCallback(() => { setVisible(false); }, [setVisible]); @@ -40,25 +39,6 @@ export const MissingWidgetsPopoverEntry = memo(() => { } }, []); - return ( -
- - - -
- ) -}); - -function MissingWidgetInstallHelper() { const unknownWidgets = useAppStore(st => st.unknownWidgets); const extensionsNodeMap = useExtensionsState(st => st.extensionNodeMap); @@ -70,15 +50,41 @@ function MissingWidgetInstallHelper() { } }); + const extensionsArr: Extension[] = []; extensions.forEach(extension => { extensionsArr.push(extension); }); + useEffect(() => { + if (extensionsArr.length === 0) { + handleCancel(); + } + }, [unknownWidgets]); + + return ( +
+ + + +
+ ) +}); + +function MissingWidgetInstallHelper({ extensions }: { extensions: Extension[]}) { return (
- {extensionsArr.map(extension => { + {extensions.map(extension => { return })}
From 9f0347818d8f772950c22b3cf709364afbb7622a Mon Sep 17 00:00:00 2001 From: 6174 Date: Thu, 25 Jan 2024 16:25:53 +0800 Subject: [PATCH 22/37] change restart comfyUI behavior --- .../comfy-extension-manager/remove-extension.ts | 2 +- apps/node/src/routes/api/extension.ts | 10 +++++----- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/apps/node/src/modules/comfy-extension-manager/remove-extension.ts b/apps/node/src/modules/comfy-extension-manager/remove-extension.ts index 7cf770ce..caf94a43 100644 --- a/apps/node/src/modules/comfy-extension-manager/remove-extension.ts +++ b/apps/node/src/modules/comfy-extension-manager/remove-extension.ts @@ -21,7 +21,7 @@ function getExtensionPath(item: Extension): string | void { const dirName = path.parse(url).name.replace('.git', ''); const dirPath = path.join(custom_nodes_path, dirName); return dirPath; - } + } if (item.install_type === 'copy' && item.files.length === 1) { return path.join(custom_nodes_path, item.files[0]); diff --git a/apps/node/src/routes/api/extension.ts b/apps/node/src/routes/api/extension.ts index 04ae52f1..139e3e98 100644 --- a/apps/node/src/routes/api/extension.ts +++ b/apps/node/src/routes/api/extension.ts @@ -37,7 +37,7 @@ export async function ApiRouteInstallExtension(req: Request, res: Response) { return true; } await installExtension(newDispatcher, taskParams.params); - await restartComfyUI(dispatcher); + restartComfyUI(dispatcher); return true; } }; @@ -108,10 +108,10 @@ export async function ApiRouteDisableExtensions(req: Request, res: Response) { const extensions = req.body.extensions as Extension[]; logger.info("extensions", extensions); await comfyExtensionManager.disableExtensions(extensions); - await restartComfyUI(); res.send({ success: true }); + restartComfyUI(); } catch (err: any) { logger.error(err.message + ":" + err.stack); res.send({ @@ -125,10 +125,10 @@ export async function ApiRouteEnableExtensions(req: Request, res: Response) { try { const extensions = req.body.extensions as Extension[]; await comfyExtensionManager.enableExtensions(extensions); - await restartComfyUI(); res.send({ success: true }); + restartComfyUI(); } catch (err: any) { logger.error(err.message + ":" + err.stack); res.send({ @@ -142,10 +142,10 @@ export async function ApiRouteRemoveExtensions(req: Request, res: Response) { try { const extensions = req.body.extensions as Extension[]; await comfyExtensionManager.removeExtensions(extensions); - await restartComfyUI(); res.send({ success: true }); + restartComfyUI(); } catch (err: any) { logger.error(err.message + ":" + err.stack); res.send({ @@ -159,10 +159,10 @@ export async function ApiRouteUpdateExtensions(req: Request, res: Response) { try { const extensions = req.body.extensions as Extension[]; await comfyExtensionManager.updateExtensions(extensions); - await restartComfyUI(); res.send({ success: true }); + restartComfyUI(); } catch (err: any) { logger.error(err.message + ":" + err.stack); res.send({ From 835e081d1a039c44ff320cf9395d3a329d2ee2dc Mon Sep 17 00:00:00 2001 From: 6174 Date: Thu, 25 Jan 2024 16:30:48 +0800 Subject: [PATCH 23/37] show process manager when install extension --- .../comfyui-process-manager/comfyui-process-manager.tsx | 9 ++++++++- .../extension-manager/remove-extension-button.tsx | 1 + .../workflow-editor/reactflow-node/reactflow-node.tsx | 4 ++++ packages/common/utils/slot-event.ts | 3 ++- 4 files changed, 15 insertions(+), 2 deletions(-) diff --git a/apps/electron-frontend/src/components/comfyui-process-manager/comfyui-process-manager.tsx b/apps/electron-frontend/src/components/comfyui-process-manager/comfyui-process-manager.tsx index d5f1b45c..15e2c6b3 100644 --- a/apps/electron-frontend/src/components/comfyui-process-manager/comfyui-process-manager.tsx +++ b/apps/electron-frontend/src/components/comfyui-process-manager/comfyui-process-manager.tsx @@ -139,10 +139,17 @@ const ComfyUIProcessManager = () => { restart(); } }); - + + const dispose3 = SlotGlobalEvent.on((ev) => { + if (ev.type === GlobalEvents.show_comfyprocess_manager) { + showModal(); + } + }); + return () => { dispose(); dispose2.dispose(); + dispose3.dispose(); } }, []) diff --git a/apps/electron-frontend/src/components/extension-manager/remove-extension-button.tsx b/apps/electron-frontend/src/components/extension-manager/remove-extension-button.tsx index b7ab22c1..270425c9 100644 --- a/apps/electron-frontend/src/components/extension-manager/remove-extension-button.tsx +++ b/apps/electron-frontend/src/components/extension-manager/remove-extension-button.tsx @@ -24,6 +24,7 @@ export function RemoveExtensionButton(props: {extension: Extension}) { const ret = await res.json(); if (ret.success) { message.success("Success"); + setRunning(false); await onInit(); } else { message.error(ret.error) diff --git a/apps/electron-frontend/src/components/workflow-editor/reactflow-node/reactflow-node.tsx b/apps/electron-frontend/src/components/workflow-editor/reactflow-node/reactflow-node.tsx index 6d4dd2f0..46891383 100644 --- a/apps/electron-frontend/src/components/workflow-editor/reactflow-node/reactflow-node.tsx +++ b/apps/electron-frontend/src/components/workflow-editor/reactflow-node/reactflow-node.tsx @@ -429,6 +429,10 @@ function InstallMissingWidget(props: { type: GlobalEvents.install_missing_widget, data: extension }); + SlotGlobalEvent.emit({ + type: GlobalEvents.show_comfyprocess_manager, + data: null + }); }, 10); }, []); diff --git a/packages/common/utils/slot-event.ts b/packages/common/utils/slot-event.ts index bb7b9ff0..0256b538 100755 --- a/packages/common/utils/slot-event.ts +++ b/packages/common/utils/slot-event.ts @@ -133,7 +133,8 @@ export enum GlobalEvents { initial_launch = "initial_launch", comfyui_process_error = "comfyui_process_error", show_missing_widgets_modal = "show_missing_widgets_modal", - install_missing_widget = 'install_missing_widget' + install_missing_widget = 'install_missing_widget', + show_comfyprocess_manager = 'show_comfyprocess_manager' } export type GlobalEventKeys = keyof typeof GlobalEvents; From e60f96b24d83f29b0f892a4526caedbff4c92ca8 Mon Sep 17 00:00:00 2001 From: 6174 Date: Thu, 25 Jan 2024 16:35:02 +0800 Subject: [PATCH 24/37] fast fetch update --- .../extension-manager/disable-extension-button.tsx | 5 ++++- .../extension-manager/install-extension-button.tsx | 7 +++++-- .../extension-manager/remove-extension-button.tsx | 5 ++++- .../extension-manager/update-extension-button.tsx | 5 ++++- 4 files changed, 17 insertions(+), 5 deletions(-) diff --git a/apps/electron-frontend/src/components/extension-manager/disable-extension-button.tsx b/apps/electron-frontend/src/components/extension-manager/disable-extension-button.tsx index 1dfbf5ed..e4050962 100644 --- a/apps/electron-frontend/src/components/extension-manager/disable-extension-button.tsx +++ b/apps/electron-frontend/src/components/extension-manager/disable-extension-button.tsx @@ -25,7 +25,10 @@ export function DisableExtensionButton(props: {extension: Extension}) { const ret = await res.json(); if (ret.success) { message.success("Success"); - await onInit(); + await onInit(false); + setTimeout(() => { + onInit() + }, 3000) } else { message.error(ret.error) } diff --git a/apps/electron-frontend/src/components/extension-manager/install-extension-button.tsx b/apps/electron-frontend/src/components/extension-manager/install-extension-button.tsx index c768450c..ff233ef8 100644 --- a/apps/electron-frontend/src/components/extension-manager/install-extension-button.tsx +++ b/apps/electron-frontend/src/components/extension-manager/install-extension-button.tsx @@ -9,11 +9,14 @@ export function InstallExtensionButton(props: {extension: Extension}) { const {onInit} = useExtensionsState() const {startTask, running, messages} = useRemoteTask({ api: getBackendUrl(`/api/install_extension`), - onMessage: (msg) => { + onMessage: async (msg) => { console.log(msg); if (msg.type === "SUCCESS") { message.success("Extension installed successfully"); - onInit(); + await onInit(false); + setTimeout(() => { + onInit() + }, 3000) } } }); diff --git a/apps/electron-frontend/src/components/extension-manager/remove-extension-button.tsx b/apps/electron-frontend/src/components/extension-manager/remove-extension-button.tsx index 270425c9..a706db08 100644 --- a/apps/electron-frontend/src/components/extension-manager/remove-extension-button.tsx +++ b/apps/electron-frontend/src/components/extension-manager/remove-extension-button.tsx @@ -25,7 +25,10 @@ export function RemoveExtensionButton(props: {extension: Extension}) { if (ret.success) { message.success("Success"); setRunning(false); - await onInit(); + await onInit(false); + setTimeout(() => { + onInit() + }, 3000) } else { message.error(ret.error) } diff --git a/apps/electron-frontend/src/components/extension-manager/update-extension-button.tsx b/apps/electron-frontend/src/components/extension-manager/update-extension-button.tsx index ffec6191..8f796a92 100644 --- a/apps/electron-frontend/src/components/extension-manager/update-extension-button.tsx +++ b/apps/electron-frontend/src/components/extension-manager/update-extension-button.tsx @@ -23,7 +23,10 @@ export function UpdateExtensionButton(props: {extension: Extension}) { const ret = await res.json(); if (ret.success) { message.success("Success"); - await onInit(); + await onInit(false); + setTimeout(() => { + onInit() + }, 3000) } else { message.error(ret.error) } From 4b89e0b392d26922542739ea49ff5d5bb1b19555 Mon Sep 17 00:00:00 2001 From: 6174 Date: Thu, 25 Jan 2024 16:40:58 +0800 Subject: [PATCH 25/37] update --- .../extension-manager/disable-extension-button.tsx | 5 +---- .../extension-manager/install-extension-button.tsx | 5 +---- .../extension-manager/remove-extension-button.tsx | 6 +----- .../extension-manager/update-extension-button.tsx | 5 +---- 4 files changed, 4 insertions(+), 17 deletions(-) diff --git a/apps/electron-frontend/src/components/extension-manager/disable-extension-button.tsx b/apps/electron-frontend/src/components/extension-manager/disable-extension-button.tsx index e4050962..8b851cab 100644 --- a/apps/electron-frontend/src/components/extension-manager/disable-extension-button.tsx +++ b/apps/electron-frontend/src/components/extension-manager/disable-extension-button.tsx @@ -24,11 +24,8 @@ export function DisableExtensionButton(props: {extension: Extension}) { }); const ret = await res.json(); if (ret.success) { + await onInit() message.success("Success"); - await onInit(false); - setTimeout(() => { - onInit() - }, 3000) } else { message.error(ret.error) } diff --git a/apps/electron-frontend/src/components/extension-manager/install-extension-button.tsx b/apps/electron-frontend/src/components/extension-manager/install-extension-button.tsx index ff233ef8..57d20b34 100644 --- a/apps/electron-frontend/src/components/extension-manager/install-extension-button.tsx +++ b/apps/electron-frontend/src/components/extension-manager/install-extension-button.tsx @@ -12,11 +12,8 @@ export function InstallExtensionButton(props: {extension: Extension}) { onMessage: async (msg) => { console.log(msg); if (msg.type === "SUCCESS") { + await onInit(); message.success("Extension installed successfully"); - await onInit(false); - setTimeout(() => { - onInit() - }, 3000) } } }); diff --git a/apps/electron-frontend/src/components/extension-manager/remove-extension-button.tsx b/apps/electron-frontend/src/components/extension-manager/remove-extension-button.tsx index a706db08..4a9cbbc9 100644 --- a/apps/electron-frontend/src/components/extension-manager/remove-extension-button.tsx +++ b/apps/electron-frontend/src/components/extension-manager/remove-extension-button.tsx @@ -23,12 +23,8 @@ export function RemoveExtensionButton(props: {extension: Extension}) { }); const ret = await res.json(); if (ret.success) { + await onInit(); message.success("Success"); - setRunning(false); - await onInit(false); - setTimeout(() => { - onInit() - }, 3000) } else { message.error(ret.error) } diff --git a/apps/electron-frontend/src/components/extension-manager/update-extension-button.tsx b/apps/electron-frontend/src/components/extension-manager/update-extension-button.tsx index 8f796a92..0cdcc361 100644 --- a/apps/electron-frontend/src/components/extension-manager/update-extension-button.tsx +++ b/apps/electron-frontend/src/components/extension-manager/update-extension-button.tsx @@ -22,11 +22,8 @@ export function UpdateExtensionButton(props: {extension: Extension}) { }); const ret = await res.json(); if (ret.success) { + await onInit(); message.success("Success"); - await onInit(false); - setTimeout(() => { - onInit() - }, 3000) } else { message.error(ret.error) } From 937b4ba4a5b495d887a47089575f145a83582aaf Mon Sep 17 00:00:00 2001 From: 6174 Date: Thu, 25 Jan 2024 17:08:22 +0800 Subject: [PATCH 26/37] extension actions --- .../extension-manager/disable-extension-button.tsx | 2 +- .../components/extension-manager/remove-extension-button.tsx | 2 +- .../components/extension-manager/update-extension-button.tsx | 2 +- apps/node/src/modules/comfyui/bootstrap.ts | 1 - apps/node/src/routes/api/extension.ts | 5 +++-- 5 files changed, 6 insertions(+), 6 deletions(-) diff --git a/apps/electron-frontend/src/components/extension-manager/disable-extension-button.tsx b/apps/electron-frontend/src/components/extension-manager/disable-extension-button.tsx index 8b851cab..ccacb6d0 100644 --- a/apps/electron-frontend/src/components/extension-manager/disable-extension-button.tsx +++ b/apps/electron-frontend/src/components/extension-manager/disable-extension-button.tsx @@ -33,7 +33,7 @@ export function DisableExtensionButton(props: {extension: Extension}) { message.error("Unexpected error: ", err); } setRunning(false); - }, [extension]); + }, [extension, onInit]); if (!extension.installed) { return null diff --git a/apps/electron-frontend/src/components/extension-manager/remove-extension-button.tsx b/apps/electron-frontend/src/components/extension-manager/remove-extension-button.tsx index 4a9cbbc9..41a9cf54 100644 --- a/apps/electron-frontend/src/components/extension-manager/remove-extension-button.tsx +++ b/apps/electron-frontend/src/components/extension-manager/remove-extension-button.tsx @@ -32,7 +32,7 @@ export function RemoveExtensionButton(props: {extension: Extension}) { message.error("Unexpected error: ", err); } setRunning(false); - }, [extension]); + }, [extension, onInit]); if (!extension.installed) { return null diff --git a/apps/electron-frontend/src/components/extension-manager/update-extension-button.tsx b/apps/electron-frontend/src/components/extension-manager/update-extension-button.tsx index 0cdcc361..6b9d046f 100644 --- a/apps/electron-frontend/src/components/extension-manager/update-extension-button.tsx +++ b/apps/electron-frontend/src/components/extension-manager/update-extension-button.tsx @@ -31,7 +31,7 @@ export function UpdateExtensionButton(props: {extension: Extension}) { message.error("Unexpected error: ", err); } setRunning(false); - }, [extension]); + }, [extension, onInit]); if (!extension.need_update || extension.disabled) { return null diff --git a/apps/node/src/modules/comfyui/bootstrap.ts b/apps/node/src/modules/comfyui/bootstrap.ts index 93673595..3876a564 100644 --- a/apps/node/src/modules/comfyui/bootstrap.ts +++ b/apps/node/src/modules/comfyui/bootstrap.ts @@ -394,7 +394,6 @@ export async function startComfyUI(dispatcher: TaskEventDispatcher): Promise Date: Thu, 25 Jan 2024 17:31:22 +0800 Subject: [PATCH 27/37] need await comfyUI restart, otherwise concurrent cimfyui api call will failed --- .../reactflow-missing-widgets.tsx | 1 - apps/node/src/routes/api/extension.ts | 11 +++++------ 2 files changed, 5 insertions(+), 7 deletions(-) diff --git a/apps/electron-frontend/src/components/workflow-editor/reactflow-missing-widgets/reactflow-missing-widgets.tsx b/apps/electron-frontend/src/components/workflow-editor/reactflow-missing-widgets/reactflow-missing-widgets.tsx index ac3362dc..54bf15f2 100644 --- a/apps/electron-frontend/src/components/workflow-editor/reactflow-missing-widgets/reactflow-missing-widgets.tsx +++ b/apps/electron-frontend/src/components/workflow-editor/reactflow-missing-widgets/reactflow-missing-widgets.tsx @@ -50,7 +50,6 @@ export const MissingWidgetsPopoverEntry = memo(() => { } }); - const extensionsArr: Extension[] = []; extensions.forEach(extension => { extensionsArr.push(extension); diff --git a/apps/node/src/routes/api/extension.ts b/apps/node/src/routes/api/extension.ts index 13ce9c42..4d6edd24 100644 --- a/apps/node/src/routes/api/extension.ts +++ b/apps/node/src/routes/api/extension.ts @@ -37,7 +37,7 @@ export async function ApiRouteInstallExtension(req: Request, res: Response) { return true; } await installExtension(newDispatcher, taskParams.params); - restartComfyUI(dispatcher); + await restartComfyUI(dispatcher); return true; } }; @@ -69,7 +69,6 @@ export async function ApiRouteGetExtensions(req: Request, res: Response) { const update_check = req.query.update_check; const extensions = await comfyExtensionManager.getAllExtensions(!!update_check); const extensionNodeMap = await comfyExtensionManager.getExtensionNodeMap(); - // const extensionNodeList = await comfyExtensionManager.getExtensionNodes() res.send({ success: true, data: { @@ -109,10 +108,10 @@ export async function ApiRouteDisableExtensions(req: Request, res: Response) { const extensions = req.body.extensions as Extension[]; logger.info("extensions", extensions); await comfyExtensionManager.disableExtensions(extensions); + await restartComfyUI(); res.send({ success: true }); - restartComfyUI(); } catch (err: any) { logger.error(err.message + ":" + err.stack); res.send({ @@ -126,10 +125,10 @@ export async function ApiRouteEnableExtensions(req: Request, res: Response) { try { const extensions = req.body.extensions as Extension[]; await comfyExtensionManager.enableExtensions(extensions); + await restartComfyUI(); res.send({ success: true }); - restartComfyUI(); } catch (err: any) { logger.error(err.message + ":" + err.stack); res.send({ @@ -143,10 +142,10 @@ export async function ApiRouteRemoveExtensions(req: Request, res: Response) { try { const extensions = req.body.extensions as Extension[]; await comfyExtensionManager.removeExtensions(extensions); + await restartComfyUI(); res.send({ success: true }); - restartComfyUI(); } catch (err: any) { logger.error(err.message + ":" + err.stack); res.send({ @@ -160,10 +159,10 @@ export async function ApiRouteUpdateExtensions(req: Request, res: Response) { try { const extensions = req.body.extensions as Extension[]; await comfyExtensionManager.updateExtensions(extensions); + await restartComfyUI(); res.send({ success: true }); - restartComfyUI(); } catch (err: any) { logger.error(err.message + ":" + err.stack); res.send({ From a1f71e71f5abeba209df44deca91f42c246ba704 Mon Sep 17 00:00:00 2001 From: 6174 Date: Thu, 25 Jan 2024 17:40:48 +0800 Subject: [PATCH 28/37] only change local state --- .../disable-extension-button.tsx | 7 ++++--- .../remove-extension-button.tsx | 7 ++++--- packages/common/store/extension-state.ts | 18 ++++++++++++++++++ 3 files changed, 26 insertions(+), 6 deletions(-) diff --git a/apps/electron-frontend/src/components/extension-manager/disable-extension-button.tsx b/apps/electron-frontend/src/components/extension-manager/disable-extension-button.tsx index ccacb6d0..b1f677c7 100644 --- a/apps/electron-frontend/src/components/extension-manager/disable-extension-button.tsx +++ b/apps/electron-frontend/src/components/extension-manager/disable-extension-button.tsx @@ -9,7 +9,8 @@ export function DisableExtensionButton(props: {extension: Extension}) { const [running, setRunning] = useState(false); const disable_api = getBackendUrl("/api/disable_extensions"); const enable_api = getBackendUrl("/api/enable_extensions"); - const {onInit} = useExtensionsState() + const onInit = useExtensionsState(st => st.onInit); + const onDisableExtension = useExtensionsState(st => st.onDisableExtension); const diableExtension = useCallback(async (disable: boolean) => { try { setRunning(true); @@ -24,7 +25,7 @@ export function DisableExtensionButton(props: {extension: Extension}) { }); const ret = await res.json(); if (ret.success) { - await onInit() + onDisableExtension(extension, disable); message.success("Success"); } else { message.error(ret.error) @@ -33,7 +34,7 @@ export function DisableExtensionButton(props: {extension: Extension}) { message.error("Unexpected error: ", err); } setRunning(false); - }, [extension, onInit]); + }, [extension, onInit, onDisableExtension]); if (!extension.installed) { return null diff --git a/apps/electron-frontend/src/components/extension-manager/remove-extension-button.tsx b/apps/electron-frontend/src/components/extension-manager/remove-extension-button.tsx index 41a9cf54..d5657e64 100644 --- a/apps/electron-frontend/src/components/extension-manager/remove-extension-button.tsx +++ b/apps/electron-frontend/src/components/extension-manager/remove-extension-button.tsx @@ -6,7 +6,8 @@ import { useCallback, useState } from "react"; export function RemoveExtensionButton(props: {extension: Extension}) { const {extension} = props; const disabled = extension.disabled - const {onInit} = useExtensionsState() + const onInit = useExtensionsState(st => st.onInit); + const onRemoveExtension = useExtensionsState(st => st.removeExtension); const [running, setRunning] = useState(false); const api = getBackendUrl("/api/remove_extensions"); const removeExtension = useCallback(async () => { @@ -23,7 +24,7 @@ export function RemoveExtensionButton(props: {extension: Extension}) { }); const ret = await res.json(); if (ret.success) { - await onInit(); + onRemoveExtension(extension); message.success("Success"); } else { message.error(ret.error) @@ -32,7 +33,7 @@ export function RemoveExtensionButton(props: {extension: Extension}) { message.error("Unexpected error: ", err); } setRunning(false); - }, [extension, onInit]); + }, [extension, onInit, onRemoveExtension]); if (!extension.installed) { return null diff --git a/packages/common/store/extension-state.ts b/packages/common/store/extension-state.ts index 759ddc51..2fd3ba36 100644 --- a/packages/common/store/extension-state.ts +++ b/packages/common/store/extension-state.ts @@ -20,6 +20,8 @@ export type ExtensionsState = { export type ExtensionsAction = { onInit: (doUpdateCheck?: boolean) => Promise; + removeExtension: (extension: Extension) => void; + onDisableExtension: (extension: Extension, disabled: boolean) => void; } export const useExtensionsState = create((set, get) => ({ @@ -38,6 +40,22 @@ export const useExtensionsState = create((se console.log("extension infos", ret); } }, + removeExtension: (extension: Extension) => { + set({ + extensions: get().extensions.filter(it => it.title !== extension.title) + }) + }, + onDisableExtension: (extension: Extension, disabled: boolean) => { + const newExtensions = get().extensions.map(ext => { + if (ext.title === extension.title) { + ext.disabled = disabled; + } + return ext; + }); + set({ + extensions: newExtensions + }) + } })); export function transformModeMap(extensionNodeMap: Record, extensions: Extension[]): Record { From 5fbb81787ab63a07815fb6fca2a9cd19ea85d43a Mon Sep 17 00:00:00 2001 From: 6174 Date: Thu, 25 Jan 2024 20:00:51 +0800 Subject: [PATCH 29/37] optimize comfyui-process-manager --- apps/electron-frontend/package.json | 6 ++ .../comfyui-process-manager.tsx | 28 ++++++- .../src/components/layout/layout.tsx | 2 - .../workflow-editor/workflow-editor.tsx | 2 - apps/electron-frontend/src/pages/_app.tsx | 2 + pnpm-lock.yaml | 77 ++++++++++++++++++- 6 files changed, 108 insertions(+), 9 deletions(-) diff --git a/apps/electron-frontend/package.json b/apps/electron-frontend/package.json index b81b01bc..6356fd7c 100755 --- a/apps/electron-frontend/package.json +++ b/apps/electron-frontend/package.json @@ -30,7 +30,13 @@ "reactflow": "^11.10.1", "ui": "workspace:*", "xterm": "^5.3.0", + "xterm-addon-canvas": "^0.5.0", "xterm-addon-fit": "^0.8.0", + "xterm-addon-image": "^0.5.0", + "xterm-addon-search": "^0.13.0", + "xterm-addon-serialize": "^0.11.0", + "xterm-addon-unicode11": "^0.6.0", + "xterm-addon-webgl": "^0.16.0", "y-indexeddb": "^9.0.12", "yjs": "^13.6.10", "zustand": "^4.4.6" diff --git a/apps/electron-frontend/src/components/comfyui-process-manager/comfyui-process-manager.tsx b/apps/electron-frontend/src/components/comfyui-process-manager/comfyui-process-manager.tsx index 15e2c6b3..a67dd85d 100644 --- a/apps/electron-frontend/src/components/comfyui-process-manager/comfyui-process-manager.tsx +++ b/apps/electron-frontend/src/components/comfyui-process-manager/comfyui-process-manager.tsx @@ -52,9 +52,29 @@ const ComfyUIProcessManager = () => { await new Promise(resolve => setTimeout(resolve, 300)); const {Terminal} = await import('xterm') const {FitAddon} = await import ('xterm-addon-fit'); + const {CanvasAddon} = await import ('xterm-addon-canvas'); + const {ImageAddon} = await import ('xterm-addon-image'); + const {SearchAddon} = await import ('xterm-addon-search'); + const {SerializeAddon} = await import ('xterm-addon-serialize'); + const {Unicode11Addon} = await import ('xterm-addon-unicode11'); + const {WebglAddon} = await import ('xterm-addon-webgl'); const fitAddon = new FitAddon(); - term.current = new Terminal(); + const canvasAddon = new CanvasAddon(); + const imageAddon = new ImageAddon(); + const searchAddon = new SearchAddon(); + const serializeAddon = new SerializeAddon(); + const unicode11Addon = new Unicode11Addon(); + const webglAddon = new WebglAddon(); + term.current = new Terminal({ + allowProposedApi: true + }); term.current.loadAddon(fitAddon); + term.current.loadAddon(canvasAddon); + term.current.loadAddon(imageAddon); + term.current.loadAddon(searchAddon); + term.current.loadAddon(serializeAddon); + term.current.loadAddon(unicode11Addon); + term.current.loadAddon(webglAddon); term.current.open(termRef.current); fitAddon.fit(); const messages = useComfyUIProcessManagerState.getState().messages; @@ -70,7 +90,11 @@ const ComfyUIProcessManager = () => { resizeObserver.observe(termRef.current); return () => { - term.current.dispose(); + try { + term.current && term.current.dispose(); + } catch(err) { + console.log(err); + } }; } if (visible) { diff --git a/apps/electron-frontend/src/components/layout/layout.tsx b/apps/electron-frontend/src/components/layout/layout.tsx index 8333f6df..3c3a2fb0 100755 --- a/apps/electron-frontend/src/components/layout/layout.tsx +++ b/apps/electron-frontend/src/components/layout/layout.tsx @@ -10,7 +10,6 @@ import styles from "./layout.style.module.scss"; import { useRouter } from 'next/router' import LogoIcon from 'ui/icons/logo' import { BulbIcon, ExtensionIcon, ModelIcon, WorkflowIcon } from 'ui/icons' -import { AsyncComfyUIProcessManager } from '../comfyui-process-manager/comfyui-process-manager-async' import { useDashboardState } from '@comflowy/common/store/dashboard-state' import { useAppStore } from '@comflowy/common/store' import Bootstrap from '../bootstrap/bootstrap' @@ -27,7 +26,6 @@ const Layout = ({ children, title = 'This is the default title' }: Props) => { return ( <> - {!bootstraped ? ( ) : ( diff --git a/apps/electron-frontend/src/components/workflow-editor/workflow-editor.tsx b/apps/electron-frontend/src/components/workflow-editor/workflow-editor.tsx index 9a0e945f..8fab5096 100755 --- a/apps/electron-frontend/src/components/workflow-editor/workflow-editor.tsx +++ b/apps/electron-frontend/src/components/workflow-editor/workflow-editor.tsx @@ -12,7 +12,6 @@ import ReactflowTopRightPanel from './reactflow-topright-panel/reactflow-toprigh import { useRouter } from 'next/router'; import { PersistedFullWorkflow, PersistedWorkflowDocument, PersistedWorkflowNode, documentDatabaseInstance } from '@comflowy/common/storage'; import { shallow } from 'zustand/shallow'; -import { AsyncComfyUIProcessManager } from '../comfyui-process-manager/comfyui-process-manager-async'; import ContextMenu from './reactflow-context-menu/reactflow-context-menu'; import { JSONDBClient } from '@comflowy/common/jsondb/jsondb.client'; import { copyNodes, pasteNodes } from './reactflow-clipboard'; @@ -419,7 +418,6 @@ export default function WorkflowEditor() { )} {menu && } - { widgetTreeContext && } diff --git a/apps/electron-frontend/src/pages/_app.tsx b/apps/electron-frontend/src/pages/_app.tsx index 67fceb32..03175f36 100755 --- a/apps/electron-frontend/src/pages/_app.tsx +++ b/apps/electron-frontend/src/pages/_app.tsx @@ -6,6 +6,7 @@ import "../styles/global.scss"; import {useDashboardState} from "@comflowy/common/store/dashboard-state"; import { DraggableModalProvider } from "ui/antd/draggable-modal"; import { JSONDBClient } from "@comflowy/common/jsondb/jsondb.client"; +import { AsyncComfyUIProcessManager } from "@/components/comfyui-process-manager/comfyui-process-manager-async"; const App = ({ Component, pageProps }: AppProps) => { const JSXCO = Component as any; @@ -18,6 +19,7 @@ const App = ({ Component, pageProps }: AppProps) => { return ( + diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 866c0d38..4194d808 100755 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -49,6 +49,9 @@ importers: electron-log: specifier: ^5.0.1 version: 5.0.1 + electron-updater: + specifier: ^6.1.7 + version: 6.1.7 express: specifier: ^4.18.2 version: 4.18.2 @@ -140,9 +143,6 @@ importers: electron-squirrel-startup: specifier: ^1.0.0 version: 1.0.0 - electron-updater: - specifier: ^6.1.7 - version: 6.1.7 esbuild: specifier: ^0.19.8 version: 0.19.8 @@ -236,9 +236,27 @@ importers: xterm: specifier: ^5.3.0 version: 5.3.0 + xterm-addon-canvas: + specifier: ^0.5.0 + version: 0.5.0(xterm@5.3.0) xterm-addon-fit: specifier: ^0.8.0 version: 0.8.0(xterm@5.3.0) + xterm-addon-image: + specifier: ^0.5.0 + version: 0.5.0(xterm@5.3.0) + xterm-addon-search: + specifier: ^0.13.0 + version: 0.13.0(xterm@5.3.0) + xterm-addon-serialize: + specifier: ^0.11.0 + version: 0.11.0(xterm@5.3.0) + xterm-addon-unicode11: + specifier: ^0.6.0 + version: 0.6.0(xterm@5.3.0) + xterm-addon-webgl: + specifier: ^0.16.0 + version: 0.16.0(xterm@5.3.0) y-indexeddb: specifier: ^9.0.12 version: 9.0.12(yjs@13.6.10) @@ -4725,6 +4743,7 @@ packages: sax: 1.3.0 transitivePeerDependencies: - supports-color + dev: false /builder-util@23.6.0: resolution: {integrity: sha512-QiQHweYsh8o+U/KNCZFSvISRnvRctb8m/2rB2I1JdByzvNKxPeFLlHFRPQRXab6aYeXc18j9LpsDLJ3sGQmWTQ==} @@ -5891,6 +5910,7 @@ packages: tiny-typed-emitter: 2.1.0 transitivePeerDependencies: - supports-color + dev: false /electron@27.1.2: resolution: {integrity: sha512-Dy6BUuGLiIJv+zfsXwr78TV2TNppi24rXF4PIIS+OjDblEKdkI9r1iM8JUd3/x3sbGUy5mdLMSPhvmu//IhkgA==} @@ -8877,6 +8897,7 @@ packages: /lodash.escaperegexp@4.1.2: resolution: {integrity: sha512-TM9YBvyC84ZxE3rgfefxUWiQKLilstD6k7PTGt6wfbtXF8ixIJLOL3VYyV/z+ZiPLsVxAsKAFVwWlWeb2Y8Yyw==} + dev: false /lodash.get@4.4.2: resolution: {integrity: sha512-z+Uw/vLuy6gQe8cfaFWD7p0wVv8fJl3mbzXh33RS+0oW2wvUqiRXiQ69gLWSLpgB5/6sU+r6BlQR0MBILadqTQ==} @@ -8895,6 +8916,7 @@ packages: /lodash.isequal@4.5.0: resolution: {integrity: sha512-pDo3lu8Jhfjqls6GkMgpahsF9kCyayhgykjyLMNFTKWrpVdAQtYyB4muAMWozBB4ig/dtWAmsMxLEI8wuz+DYQ==} + dev: false /lodash.isinteger@4.0.4: resolution: {integrity: sha512-DBwtEWN2caHQ9/imiNeEA5ys1JoRtRfY3d7V9wkqtbycnAmTvRRmbHKDV4a0EYc678/dia0jrte4tjYwVBaZUA==} @@ -11844,6 +11866,7 @@ packages: /tiny-typed-emitter@2.1.0: resolution: {integrity: sha512-qVtvMxeXbVej0cQWKqVSSAHmKZEHAvxdF8HEUBFWts8h+xEo5m/lEiPakuyZ3BnCBjOD8i24kzNOiOLLgsSxhA==} + dev: false /tinycolor2@1.6.0: resolution: {integrity: sha512-XPaBkWQJdsf3pLKJV9p4qN/S+fm2Oj8AIPo1BTUhg5oxkvm9+SVEGFdhyOz7tTdUTfvxMiAs4sp6/eZO2Ew+pw==} @@ -12707,6 +12730,14 @@ packages: engines: {node: '>=8.0'} dev: true + /xterm-addon-canvas@0.5.0(xterm@5.3.0): + resolution: {integrity: sha512-QOo/eZCMrCleAgMimfdbaZCgmQRWOml63Ued6RwQ+UTPvQj3Av9QKx3xksmyYrDGRO/AVRXa9oNuzlYvLdmoLQ==} + peerDependencies: + xterm: ^5.0.0 + dependencies: + xterm: 5.3.0 + dev: false + /xterm-addon-fit@0.8.0(xterm@5.3.0): resolution: {integrity: sha512-yj3Np7XlvxxhYF/EJ7p3KHaMt6OdwQ+HDu573Vx1lRXsVxOcnVJs51RgjZOouIZOczTsskaS+CpXspK81/DLqw==} peerDependencies: @@ -12715,6 +12746,46 @@ packages: xterm: 5.3.0 dev: false + /xterm-addon-image@0.5.0(xterm@5.3.0): + resolution: {integrity: sha512-bWXUBeDzhisYh0clVKx4JgQrZjpn+/QRMRwNsfnRpjCMhgmZ+SL3Bivktd7q03O4uKMMcAOe6bSmppwP9/um0Q==} + peerDependencies: + xterm: ^5.2.0 + dependencies: + xterm: 5.3.0 + dev: false + + /xterm-addon-search@0.13.0(xterm@5.3.0): + resolution: {integrity: sha512-sDUwG4CnqxUjSEFh676DlS3gsh3XYCzAvBPSvJ5OPgF3MRL3iHLPfsb06doRicLC2xXNpeG2cWk8x1qpESWJMA==} + peerDependencies: + xterm: ^5.0.0 + dependencies: + xterm: 5.3.0 + dev: false + + /xterm-addon-serialize@0.11.0(xterm@5.3.0): + resolution: {integrity: sha512-2CNDnmLdLkNWfsxNFkGsI5FE9W/BbsMzeOrbu59yNqH9L6k1gmL+Ab6VXxEp2NQUJSzaiqi6t0nFR5k5EDkVIg==} + peerDependencies: + xterm: ^5.0.0 + dependencies: + xterm: 5.3.0 + dev: false + + /xterm-addon-unicode11@0.6.0(xterm@5.3.0): + resolution: {integrity: sha512-5pkb8YoS/deRtNqQRw8t640mu+Ga8B2MG3RXGQu0bwgcfr8XiXIRI880TWM49ICAHhTmnOLPzIIBIjEnCq7k2A==} + peerDependencies: + xterm: ^5.0.0 + dependencies: + xterm: 5.3.0 + dev: false + + /xterm-addon-webgl@0.16.0(xterm@5.3.0): + resolution: {integrity: sha512-E8cq1AiqNOv0M/FghPT+zPAEnvIQRDbAbkb04rRYSxUym69elPWVJ4sv22FCLBqM/3LcrmBLl/pELnBebVFKgA==} + peerDependencies: + xterm: ^5.0.0 + dependencies: + xterm: 5.3.0 + dev: false + /xterm@5.3.0: resolution: {integrity: sha512-8QqjlekLUFTrU6x7xck1MsPzPA571K5zNqWm0M0oroYEWVOptZ0+ubQSkQ3uxIEhcIHRujJy6emDWX4A7qyFzg==} dev: false From 66a4d03bf41fa4061675867b9113cb16edfbcf1a Mon Sep 17 00:00:00 2001 From: 6174 Date: Thu, 25 Jan 2024 21:06:07 +0800 Subject: [PATCH 30/37] remove restart button , every action already restart comfyui --- .../src/components/extension-manager/extension-manager.tsx | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/apps/electron-frontend/src/components/extension-manager/extension-manager.tsx b/apps/electron-frontend/src/components/extension-manager/extension-manager.tsx index 98614475..4adc4607 100644 --- a/apps/electron-frontend/src/components/extension-manager/extension-manager.tsx +++ b/apps/electron-frontend/src/components/extension-manager/extension-manager.tsx @@ -37,13 +37,13 @@ function ExtensionManager() { }}>

Installed Extensions

-
+ {/*
-
+
*/}

Extensions already installed on your device

From aa52f75c320a97bbe1741babb0838cac0e6ff59b Mon Sep 17 00:00:00 2001 From: 6174 Date: Thu, 25 Jan 2024 21:20:39 +0800 Subject: [PATCH 31/37] add placeholder for textarea --- .../workflow-editor/reactflow-input/reactflow-input.tsx | 1 + 1 file changed, 1 insertion(+) diff --git a/apps/electron-frontend/src/components/workflow-editor/reactflow-input/reactflow-input.tsx b/apps/electron-frontend/src/components/workflow-editor/reactflow-input/reactflow-input.tsx index f252af43..d9fd8369 100644 --- a/apps/electron-frontend/src/components/workflow-editor/reactflow-input/reactflow-input.tsx +++ b/apps/electron-frontend/src/components/workflow-editor/reactflow-input/reactflow-input.tsx @@ -63,6 +63,7 @@ function InputComponent({ value, name, input, onChange }: InputProps): JSX.Eleme return ( onChange(ev.target.value)} From ef1c4c772b3f13f22563878e3230505372e42112 Mon Sep 17 00:00:00 2001 From: 6174 Date: Fri, 26 Jan 2024 11:38:29 +0800 Subject: [PATCH 32/37] Context Menu Style --- .../context-menu-item-change-color.tsx | 25 +++------ .../context-menu-item-change-input.tsx | 3 +- .../context-menu-item-change-title.tsx | 5 +- .../reactflow-context-menu.module.scss | 35 +++++++++++- .../reactflow-context-menu.tsx | 20 +++---- .../reactflow-node/reactflow-node.tsx | 2 +- .../comfui-interfaces/comfy-node-types.ts | 53 ++++++++++++++----- packages/common/store/app-state.ts | 1 + packages/ui/icons/copy-icon.tsx | 4 +- packages/ui/icons/index.tsx | 34 +++++++----- 10 files changed, 122 insertions(+), 60 deletions(-) diff --git a/apps/electron-frontend/src/components/workflow-editor/reactflow-context-menu/context-menu-item-change-color.tsx b/apps/electron-frontend/src/components/workflow-editor/reactflow-context-menu/context-menu-item-change-color.tsx index 1c5822a8..18c783fb 100644 --- a/apps/electron-frontend/src/components/workflow-editor/reactflow-context-menu/context-menu-item-change-color.tsx +++ b/apps/electron-frontend/src/components/workflow-editor/reactflow-context-menu/context-menu-item-change-color.tsx @@ -29,9 +29,12 @@ const ChangeColorMenuItem = (props: NodeMenuProps) => { const content = (
-

Change Color

-
- +
+ ) + + return ( +
+ {SDNODE_COLORS.map((colorOption, index) => { return (
{ })}
- ) - - return ( - -
Change Color
-
); }; + + export default ChangeColorMenuItem; \ No newline at end of file diff --git a/apps/electron-frontend/src/components/workflow-editor/reactflow-context-menu/context-menu-item-change-input.tsx b/apps/electron-frontend/src/components/workflow-editor/reactflow-context-menu/context-menu-item-change-input.tsx index 6ac9a920..f9aa3ed0 100644 --- a/apps/electron-frontend/src/components/workflow-editor/reactflow-context-menu/context-menu-item-change-input.tsx +++ b/apps/electron-frontend/src/components/workflow-editor/reactflow-context-menu/context-menu-item-change-input.tsx @@ -4,6 +4,7 @@ import { NodeMenuProps } from './types'; import { useAppStore } from '@comflowy/common/store'; import styles from "./reactflow-context-menu.module.scss"; import { FlowPropsKey, Input, InputType } from '@comflowy/common/comfui-interfaces'; +import { EditIcon } from 'ui/icons'; type InputArrayItem = { property: string; type: any; disabled: boolean; enable: boolean }; type InputArray = InputArrayItem[]; @@ -98,7 +99,7 @@ const ChangeInputMenuItem = (props: NodeMenuProps) => { placement='right' onOpenChange={handleVisibleChange} > -
Change Input
+
Convert to input
); }; diff --git a/apps/electron-frontend/src/components/workflow-editor/reactflow-context-menu/context-menu-item-change-title.tsx b/apps/electron-frontend/src/components/workflow-editor/reactflow-context-menu/context-menu-item-change-title.tsx index dc05b01d..a2a024a6 100644 --- a/apps/electron-frontend/src/components/workflow-editor/reactflow-context-menu/context-menu-item-change-title.tsx +++ b/apps/electron-frontend/src/components/workflow-editor/reactflow-context-menu/context-menu-item-change-title.tsx @@ -2,6 +2,7 @@ import React, { useCallback, useState } from 'react'; import { Popover, Input, Space, Button } from 'antd'; import { NodeMenuProps } from './types'; import { useAppStore } from '@comflowy/common/store'; +import { RenameIcon } from 'ui/icons'; const ChangeTitleMenuItem = (props: NodeMenuProps) => { @@ -43,7 +44,9 @@ const ChangeTitleMenuItem = (props: NodeMenuProps) => { placement='right' onOpenChange={handleVisibleChange} > -
Change Title
+
+ Rename +
); }; diff --git a/apps/electron-frontend/src/components/workflow-editor/reactflow-context-menu/reactflow-context-menu.module.scss b/apps/electron-frontend/src/components/workflow-editor/reactflow-context-menu/reactflow-context-menu.module.scss index efaf6ffb..2ee6265f 100644 --- a/apps/electron-frontend/src/components/workflow-editor/reactflow-context-menu/reactflow-context-menu.module.scss +++ b/apps/electron-frontend/src/components/workflow-editor/reactflow-context-menu/reactflow-context-menu.module.scss @@ -7,7 +7,19 @@ border: 1px solid #2c2c33; :global { .node-info { - padding: 10px 16px; + padding: 10px; + overflow: hidden; + color: #FFF; + text-overflow: ellipsis; + white-space: nowrap; + font-family: SF Pro Text; + font-size: 10px; + font-style: normal; + font-weight: 400; + line-height: 15.456px; + /* 154.56% */ + letter-spacing: 0.3px; + opacity: .2; } .ant-menu { background-color: transparent; @@ -15,15 +27,33 @@ box-shadow: none; border: none; border-inline-end: none !important; + padding: 0 4px; .ant-menu-item, .ant-menu-submenu .ant-menu-submenu-title{ - padding: 0 10px; + padding: 0 4px; height: 24px; line-height: 24px; font-size: 12px; + margin-bottom: 10px; + } + .ant-menu-item:not(.ant-menu-item-selected):hover{ + background-color: var(--actionHoverColor) !important; } .ant-menu-submenu .ant-menu-submenu-arrow { inset-inline-end: 6px; } + .ant-menu-item-divider { + margin: 0px 10px 10px; + background-color: var(--borderColor); + opacity: .3; + } + + .menu-item-title { + display: flex; + align-items: center; + svg { + margin-right: 6px; + } + } } } } @@ -42,6 +72,7 @@ } } .change-color { + padding: 4px 10px; .color-option{ transition: var(--transition); &:hover { diff --git a/apps/electron-frontend/src/components/workflow-editor/reactflow-context-menu/reactflow-context-menu.tsx b/apps/electron-frontend/src/components/workflow-editor/reactflow-context-menu/reactflow-context-menu.tsx index 73a5b223..6eab5d2a 100644 --- a/apps/electron-frontend/src/components/workflow-editor/reactflow-context-menu/reactflow-context-menu.tsx +++ b/apps/electron-frontend/src/components/workflow-editor/reactflow-context-menu/reactflow-context-menu.tsx @@ -10,6 +10,7 @@ import { NodeMenuProps } from './types'; import ChangeColorMenuItem from './context-menu-item-change-color'; import ChangeInputMenuItem from './context-menu-item-change-input'; import { useAppStore } from '@comflowy/common/store'; +import { CopyIcon, DeleteIcon } from 'ui/icons'; interface ContextMenuProps { nodes: Node[]; @@ -71,11 +72,13 @@ function NodesMenu(props: { } }; const items: MenuItem[] = [ - getMenuItem("Duplicate", 'MENU_ITEM_DUPLICATE_NODE', null, null), - getMenuItem("Delte", 'MENU_ITEM_DELETE_NODE', null, null), + getMenuItem(
Duplicate
, 'MENU_ITEM_DUPLICATE_NODE', null, null), + getMenuItem(
Remove
, 'MENU_ITEM_DELETE_NODE', null, null), ]; return ( -
+
) @@ -118,9 +121,8 @@ function NodeMenu(props: NodeMenuProps) { const hasInputs = node.inputs && node.inputs.length > 0; const items: MenuItem[] = [ - {type: "divider"}, + getMenuItem(
Duplicate
, 'MENU_ITEM_DUPLICATE_NODE', null, null), getMenuItem((), 'MENU_ITEM_CHANGE_TITLE', null, null), - getMenuItem(, 'MENU_ITEM_CHANGE_COLOR', null, null), { type: "divider" }, ]; @@ -129,15 +131,15 @@ function NodeMenu(props: NodeMenuProps) { items.push({ type: "divider" }) } - items.push(getMenuItem("Duplicate", 'MENU_ITEM_DUPLICATE_NODE', null, null)); - items.push(getMenuItem("Delete", 'MENU_ITEM_DELETE_NODE', null, null)); + items.push(getMenuItem(
Remove
, 'MENU_ITEM_DELETE_NODE', null, null)); return (
- Type: {widget.name} + {widget.name}
- + +
) } diff --git a/apps/electron-frontend/src/components/workflow-editor/reactflow-node/reactflow-node.tsx b/apps/electron-frontend/src/components/workflow-editor/reactflow-node/reactflow-node.tsx index 46891383..4cb56fe2 100644 --- a/apps/electron-frontend/src/components/workflow-editor/reactflow-node/reactflow-node.tsx +++ b/apps/electron-frontend/src/components/workflow-editor/reactflow-node/reactflow-node.tsx @@ -182,8 +182,8 @@ export const NodeComponent = memo(({ } }); - let nodeBgColor = node.data.value.bgcolor || SDNODE_DEFAULT_COLOR.bgcolor; let nodeColor = node.data.value.color || SDNODE_DEFAULT_COLOR.color; + let nodeBgColor = node.data.value.bgcolor || SDNODE_DEFAULT_COLOR.bgcolor; if (isPositive) { nodeBgColor = "#212923"; diff --git a/packages/common/comfui-interfaces/comfy-node-types.ts b/packages/common/comfui-interfaces/comfy-node-types.ts index 2fe055e5..260eb348 100755 --- a/packages/common/comfui-interfaces/comfy-node-types.ts +++ b/packages/common/comfui-interfaces/comfy-node-types.ts @@ -24,27 +24,52 @@ export interface SDNode { export type SDNodeColorOption = { color: string, - bgcolor: string, + bgcolor?: string, label?: string, } export const SDNODE_COLORS: SDNodeColorOption[] = [ -{ + { + color: '#67A166', + bgcolor: '#212A23', + label: 'Green', + }, { + color: '#2ABDAE', + bgcolor: '#21292A', + label: 'Primary', + }, { + color: '#2AAFF7', + bgcolor: '#21262A', + label: 'Blue', + }, { + color: '#6F62FA', + bgcolor: '#22212A', + label: 'Purple', + }, { + color: '#F26344', + bgcolor: '#271F1F', + label: 'Red', + }, { + color: '#F4BD50', + bgcolor: '#2A2621', + label: 'Yellow', + }, { + color: '#939393', + bgcolor: '#26262A', + label: 'Gray', + }, + { + color: "#2E303B", + bgcolor: "#26272F", + label: 'Default', + }, +] + +export const SDNODE_DEFAULT_COLOR = { color: "#2E303B", bgcolor: "#26272F", label: 'Default', -}, -{ - color: '#5B4B2D', - bgcolor: '#473A23', - label: 'Brown', -}, { - color: '#4B2D4B', - bgcolor: '#2D1F2D', - label: 'Red', -}] - -export const SDNODE_DEFAULT_COLOR = SDNODE_COLORS[0]; +}; export interface PreviewImage { filename: string; diff --git a/packages/common/store/app-state.ts b/packages/common/store/app-state.ts index a167d5a8..52848d13 100644 --- a/packages/common/store/app-state.ts +++ b/packages/common/store/app-state.ts @@ -577,6 +577,7 @@ export const useAppStore = create((set, get) => ({ id: "node-" + uuid(), selected: true, position: moved, + dimensions: node?.data.dimensions, value: item } }) diff --git a/packages/ui/icons/copy-icon.tsx b/packages/ui/icons/copy-icon.tsx index b461e616..268f8efd 100755 --- a/packages/ui/icons/copy-icon.tsx +++ b/packages/ui/icons/copy-icon.tsx @@ -3,8 +3,8 @@ import * as React from "react" function SvgComponent(props: any) { return ( + + + ) +} + +export function EditIcon() { + return ( + + + + ) } export function ReloadIcon() { @@ -827,17 +844,8 @@ export function GridIcon() { export function DeleteIcon() { return ( - - + + ); } From 177fd9e63d5a1ca64410f918d93271e2f36d08d0 Mon Sep 17 00:00:00 2001 From: 6174 Date: Fri, 26 Jan 2024 11:43:37 +0800 Subject: [PATCH 33/37] fix #157 --- .../layout/layout.style.module.scss | 2 + .../src/components/layout/layout.tsx | 37 ++++++++++++------- 2 files changed, 26 insertions(+), 13 deletions(-) diff --git a/apps/electron-frontend/src/components/layout/layout.style.module.scss b/apps/electron-frontend/src/components/layout/layout.style.module.scss index 189b3429..c6e9d9ff 100644 --- a/apps/electron-frontend/src/components/layout/layout.style.module.scss +++ b/apps/electron-frontend/src/components/layout/layout.style.module.scss @@ -53,6 +53,8 @@ box-sizing: border-box; display: flex; transition: var(--transition); + user-select: none; + cursor: pointer; .icon { display: flex; justify-content: center; diff --git a/apps/electron-frontend/src/components/layout/layout.tsx b/apps/electron-frontend/src/components/layout/layout.tsx index 3c3a2fb0..1116ea25 100755 --- a/apps/electron-frontend/src/components/layout/layout.tsx +++ b/apps/electron-frontend/src/components/layout/layout.tsx @@ -1,4 +1,4 @@ -import React, { ReactNode, useEffect } from 'react' +import React, { ReactNode, useCallback, useEffect } from 'react' import Link from 'next/link' import Head from 'next/head' @@ -50,6 +50,9 @@ const Layout = ({ children, title = 'This is the default title' }: Props) => { const WorkspaceNav = () => { const route = useRouter(); const path = route.pathname; + const changeRoute = useCallback((url) => { + route.push(url); + }, [route]) return (
@@ -58,37 +61,45 @@ const WorkspaceNav = () => {
MENU
-
+
{ + changeRoute("/") + }}>
- + My workflows - +
-
+
{ + changeRoute("/templates") + }}>
- + Templates - +
-
+
{ + changeRoute("/models") + }}>
- + Models - +
-
+
{ + changeRoute("/extensions") + }}>
- + Extensions - +
From 2da74f0678ae59f969c37849286aeebf33ac4ffc Mon Sep 17 00:00:00 2001 From: 6174 Date: Fri, 26 Jan 2024 11:45:55 +0800 Subject: [PATCH 34/37] fix #158 --- .../src/components/my-workflows/my-workflows.style.module.scss | 2 +- .../src/components/templates/templates.style.module.scss | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/apps/electron-frontend/src/components/my-workflows/my-workflows.style.module.scss b/apps/electron-frontend/src/components/my-workflows/my-workflows.style.module.scss index 922b0db9..fde98d1e 100644 --- a/apps/electron-frontend/src/components/my-workflows/my-workflows.style.module.scss +++ b/apps/electron-frontend/src/components/my-workflows/my-workflows.style.module.scss @@ -32,7 +32,7 @@ display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); grid-gap: 10px; - padding: 10px; + padding: 10px 10px 10px 0; } .workflow-list-item { diff --git a/apps/electron-frontend/src/components/templates/templates.style.module.scss b/apps/electron-frontend/src/components/templates/templates.style.module.scss index a263e6a3..018dbc33 100644 --- a/apps/electron-frontend/src/components/templates/templates.style.module.scss +++ b/apps/electron-frontend/src/components/templates/templates.style.module.scss @@ -7,7 +7,7 @@ display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); grid-gap: 10px; - padding: 10px; + padding: 10px 10px 10px 0; } .template-card { From 6765686df8b639f6830640b6a804634916c22cec Mon Sep 17 00:00:00 2001 From: 6174 Date: Fri, 26 Jan 2024 11:47:30 +0800 Subject: [PATCH 35/37] change default avaliable models --- .../src/components/model-manager/model-manager.tsx | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/apps/electron-frontend/src/components/model-manager/model-manager.tsx b/apps/electron-frontend/src/components/model-manager/model-manager.tsx index ec5d327d..81562772 100644 --- a/apps/electron-frontend/src/components/model-manager/model-manager.tsx +++ b/apps/electron-frontend/src/components/model-manager/model-manager.tsx @@ -42,13 +42,13 @@ const ModelManagement = () => {
- - - - + + + +
); From cb87a413be1332df507fcb47f09af11ff2c4c06c Mon Sep 17 00:00:00 2001 From: 6174 Date: Fri, 26 Jan 2024 19:08:06 +0800 Subject: [PATCH 36/37] Update workflow --- .../templates/data/Batch-image-workflow.json | 508 +------------ .../data/Canny-ControlNet-workflow.json | 595 +-------------- .../Hi-res-fix-latent-upscale-workflow.json | 512 +------------ .../templates/data/Inpainting-workflow.json | 450 +---------- .../templates/data/LCM-LoRA-workflow.json | 438 +---------- .../templates/data/LoRA-workflow.json | 468 +----------- .../templates/data/Outpainting-workflow.json | 508 +------------ .../data/Pose-ControlNet-workflow.json | 649 +--------------- .../data/SDXL-prompt-styler-workflow.json | 443 +---------- .../data/Scribble-ControlNet-workflow.json | 507 +------------ .../data/Simple-img2img-workflow.json | 432 +---------- .../templates/data/Style-model-workflow.json | 599 +-------------- ...Upscale-pixel-and-Hi-res-fix-workflow.json | 715 +----------------- .../Upscale-pixel-by-algorithm-workflow.json | 134 +--- .../data/Upscale-pixel-by-model-workflow.json | 175 +---- .../templates/data/default-workflow.json | 367 +-------- .../templates/data/unCLIP-model-workflow.json | 538 +------------ .../reactflow-node/reactflow-node.tsx | 2 +- .../reactflow-topleft-panel.tsx | 21 +- 19 files changed, 37 insertions(+), 8024 deletions(-) diff --git a/apps/electron-frontend/src/components/templates/data/Batch-image-workflow.json b/apps/electron-frontend/src/components/templates/data/Batch-image-workflow.json index fe13fb4a..c81ec8a5 100644 --- a/apps/electron-frontend/src/components/templates/data/Batch-image-workflow.json +++ b/apps/electron-frontend/src/components/templates/data/Batch-image-workflow.json @@ -1,507 +1 @@ -{ - "last_node_id": 12, - "last_link_id": 13, - "nodes": [ - { - "id": 7, - "type": "CLIPTextEncode", - "pos": [ - 413, - 389 - ], - "size": { - "0": 425.27801513671875, - "1": 180.6060791015625 - }, - "flags": {}, - "order": 3, - "mode": 0, - "inputs": [ - { - "name": "clip", - "type": "CLIP", - "link": 5 - } - ], - "outputs": [ - { - "name": "CONDITIONING", - "type": "CONDITIONING", - "links": [ - 6 - ], - "slot_index": 0 - } - ], - "properties": { - "Node name for S&R": "CLIPTextEncode" - }, - "widgets_values": [ - "text, watermark" - ] - }, - { - "id": 8, - "type": "VAEDecode", - "pos": [ - 1209, - 188 - ], - "size": { - "0": 210, - "1": 46 - }, - "flags": {}, - "order": 5, - "mode": 0, - "inputs": [ - { - "name": "samples", - "type": "LATENT", - "link": 7 - }, - { - "name": "vae", - "type": "VAE", - "link": 8 - } - ], - "outputs": [ - { - "name": "IMAGE", - "type": "IMAGE", - "links": [ - 9 - ], - "slot_index": 0 - } - ], - "properties": { - "Node name for S&R": "VAEDecode" - } - }, - { - "id": 9, - "type": "SaveImage", - "pos": [ - 1451, - 189 - ], - "size": [ - 210, - 270 - ], - "flags": {}, - "order": 7, - "mode": 0, - "inputs": [ - { - "name": "images", - "type": "IMAGE", - "link": 9 - } - ], - "properties": {}, - "widgets_values": [ - "ComfyUI" - ] - }, - { - "id": 5, - "type": "EmptyLatentImage", - "pos": [ - 473, - 609 - ], - "size": { - "0": 315, - "1": 106 - }, - "flags": {}, - "order": 0, - "mode": 0, - "outputs": [ - { - "name": "LATENT", - "type": "LATENT", - "links": [ - 2 - ], - "slot_index": 0 - } - ], - "properties": { - "Node name for S&R": "EmptyLatentImage" - }, - "widgets_values": [ - 512, - 512, - 4 - ] - }, - { - "id": 6, - "type": "CLIPTextEncode", - "pos": [ - 415, - 186 - ], - "size": { - "0": 422.84503173828125, - "1": 164.31304931640625 - }, - "flags": {}, - "order": 2, - "mode": 0, - "inputs": [ - { - "name": "clip", - "type": "CLIP", - "link": 3 - } - ], - "outputs": [ - { - "name": "CONDITIONING", - "type": "CONDITIONING", - "links": [ - 4 - ], - "slot_index": 0 - } - ], - "properties": { - "Node name for S&R": "CLIPTextEncode" - }, - "widgets_values": [ - "Cat,standing on the castle" - ] - }, - { - "id": 4, - "type": "CheckpointLoaderSimple", - "pos": [ - 26, - 474 - ], - "size": { - "0": 315, - "1": 98 - }, - "flags": {}, - "order": 1, - "mode": 0, - "outputs": [ - { - "name": "MODEL", - "type": "MODEL", - "links": [ - 1 - ], - "slot_index": 0 - }, - { - "name": "CLIP", - "type": "CLIP", - "links": [ - 3, - 5 - ], - "slot_index": 1 - }, - { - "name": "VAE", - "type": "VAE", - "links": [ - 8, - 13 - ], - "slot_index": 2 - } - ], - "properties": { - "Node name for S&R": "CheckpointLoaderSimple" - }, - "widgets_values": [ - "SDXL-v1.0-base.safetensors" - ] - }, - { - "id": 11, - "type": "VAEDecode", - "pos": [ - 1566, - 535 - ], - "size": { - "0": 210, - "1": 46 - }, - "flags": {}, - "order": 8, - "mode": 0, - "inputs": [ - { - "name": "samples", - "type": "LATENT", - "link": 10 - }, - { - "name": "vae", - "type": "VAE", - "link": 13 - } - ], - "outputs": [ - { - "name": "IMAGE", - "type": "IMAGE", - "links": [ - 12 - ], - "shape": 3, - "slot_index": 0 - } - ], - "properties": { - "Node name for S&R": "VAEDecode" - } - }, - { - "id": 12, - "type": "SaveImage", - "pos": [ - 1823, - 537 - ], - "size": [ - 315, - 270 - ], - "flags": {}, - "order": 9, - "mode": 0, - "inputs": [ - { - "name": "images", - "type": "IMAGE", - "link": 12 - } - ], - "properties": {}, - "widgets_values": [ - "ComfyUI" - ] - }, - { - "id": 10, - "type": "LatentFromBatch", - "pos": [ - 1210, - 532 - ], - "size": { - "0": 315, - "1": 82 - }, - "flags": {}, - "order": 6, - "mode": 0, - "inputs": [ - { - "name": "samples", - "type": "LATENT", - "link": 11 - } - ], - "outputs": [ - { - "name": "LATENT", - "type": "LATENT", - "links": [ - 10 - ], - "shape": 3, - "slot_index": 0 - } - ], - "properties": { - "Node name for S&R": "LatentFromBatch" - }, - "widgets_values": [ - 2, - 1 - ] - }, - { - "id": 3, - "type": "KSampler", - "pos": [ - 863, - 186 - ], - "size": { - "0": 315, - "1": 262 - }, - "flags": {}, - "order": 4, - "mode": 0, - "inputs": [ - { - "name": "model", - "type": "MODEL", - "link": 1 - }, - { - "name": "positive", - "type": "CONDITIONING", - "link": 4 - }, - { - "name": "negative", - "type": "CONDITIONING", - "link": 6 - }, - { - "name": "latent_image", - "type": "LATENT", - "link": 2 - } - ], - "outputs": [ - { - "name": "LATENT", - "type": "LATENT", - "links": [ - 7, - 11 - ], - "slot_index": 0 - } - ], - "properties": { - "Node name for S&R": "KSampler" - }, - "widgets_values": [ - 369501923869898, - "fixed", - 20, - 8, - "dpmpp_2m", - "karras", - 1 - ] - } - ], - "links": [ - [ - 1, - 4, - 0, - 3, - 0, - "MODEL" - ], - [ - 2, - 5, - 0, - 3, - 3, - "LATENT" - ], - [ - 3, - 4, - 1, - 6, - 0, - "CLIP" - ], - [ - 4, - 6, - 0, - 3, - 1, - "CONDITIONING" - ], - [ - 5, - 4, - 1, - 7, - 0, - "CLIP" - ], - [ - 6, - 7, - 0, - 3, - 2, - "CONDITIONING" - ], - [ - 7, - 3, - 0, - 8, - 0, - "LATENT" - ], - [ - 8, - 4, - 2, - 8, - 1, - "VAE" - ], - [ - 9, - 8, - 0, - 9, - 0, - "IMAGE" - ], - [ - 10, - 10, - 0, - 11, - 0, - "LATENT" - ], - [ - 11, - 3, - 0, - 10, - 0, - "LATENT" - ], - [ - 12, - 11, - 0, - 12, - 0, - "IMAGE" - ], - [ - 13, - 4, - 2, - 11, - 1, - "VAE" - ] - ], - "groups": [], - "config": {}, - "extra": {}, - "version": 0.4 -} \ No newline at end of file +{"id":"abf9b0f9-6a08-47b9-937b-53173392b74e","title":"Batch image workflow","nodes":[{"id":"3","type":"KSampler","properties":{"Node name for S&R":"KSampler"},"pos":[863,186],"size":[315,413],"inputs":[{"name":"model","type":"MODEL","link":1},{"name":"positive","type":"CONDITIONING","link":4},{"name":"negative","type":"CONDITIONING","link":6},{"name":"latent_image","type":"LATENT","link":2}],"outputs":[{"name":"LATENT","type":"LATENT","links":[7,11],"slot_index":0}],"widgets_values":[369501923869898,"fixed",20,8,"dpmpp_2m","karras",1],"order":0,"mode":0},{"id":"4","type":"CheckpointLoaderSimple","properties":{"Node name for S&R":"CheckpointLoaderSimple"},"pos":[26,474],"size":[315,161],"inputs":[],"outputs":[{"name":"MODEL","type":"MODEL","links":[1],"slot_index":0},{"name":"CLIP","type":"CLIP","links":[3,5],"slot_index":1},{"name":"VAE","type":"VAE","links":[8,13],"slot_index":2}],"widgets_values":["SDXL-v1.0-base.safetensors"],"order":0,"mode":0},{"id":"5","type":"EmptyLatentImage","properties":{"Node name for S&R":"EmptyLatentImage"},"pos":[473,609],"size":[315,189],"inputs":[],"outputs":[{"name":"LATENT","type":"LATENT","links":[2],"slot_index":0}],"widgets_values":[512,512,4],"order":0,"mode":0},{"id":"6","type":"CLIPTextEncode","properties":{"Node name for S&R":"CLIPTextEncode"},"pos":[399.27614213197967,85.76040609137053],"size":[423,221],"inputs":[{"name":"clip","type":"CLIP","link":3}],"outputs":[{"name":"CONDITIONING","type":"CONDITIONING","links":[4],"slot_index":0}],"widgets_values":["Cat,standing on the castle"],"order":0,"mode":0},{"id":"7","type":"CLIPTextEncode","properties":{"Node name for S&R":"CLIPTextEncode"},"pos":[399.24162436548227,335.9319796954315],"size":[425,221],"inputs":[{"name":"clip","type":"CLIP","link":5}],"outputs":[{"name":"CONDITIONING","type":"CONDITIONING","links":[6],"slot_index":0}],"widgets_values":["text, watermark"],"order":0,"mode":0},{"id":"8","type":"VAEDecode","properties":{"Node name for S&R":"VAEDecode"},"pos":[1209,188],"size":[210,99],"inputs":[{"name":"samples","type":"LATENT","link":7},{"name":"vae","type":"VAE","link":8}],"outputs":[{"name":"IMAGE","type":"IMAGE","links":[9],"slot_index":0}],"widgets_values":[],"order":0,"mode":0},{"id":"9","type":"SaveImage","properties":{},"pos":[1451,189],"size":[210,270],"inputs":[{"name":"images","type":"IMAGE","link":9}],"outputs":[],"widgets_values":["ComfyUI"],"order":0,"mode":0},{"id":"10","type":"LatentFromBatch","properties":{"Node name for S&R":"LatentFromBatch"},"pos":[1210,532],"size":[315,151],"inputs":[{"name":"samples","type":"LATENT","link":11}],"outputs":[{"name":"LATENT","type":"LATENT","links":[10],"shape":3,"slot_index":0}],"widgets_values":[2,1],"order":0,"mode":0},{"id":"11","type":"VAEDecode","properties":{"Node name for S&R":"VAEDecode"},"pos":[1566,535],"size":[210,99],"inputs":[{"name":"samples","type":"LATENT","link":10},{"name":"vae","type":"VAE","link":13}],"outputs":[{"name":"IMAGE","type":"IMAGE","links":[12],"shape":3,"slot_index":0}],"widgets_values":[],"order":0,"mode":0},{"id":"12","type":"SaveImage","properties":{},"pos":[1823,537],"size":[315,270],"inputs":[{"name":"images","type":"IMAGE","link":12}],"outputs":[],"widgets_values":["ComfyUI"],"order":0,"mode":0}],"links":[["1","4",0,"3",0,"MODEL"],["2","5",0,"3",3,"LATENT"],["3","4",1,"6",0,"CLIP"],["4","6",0,"3",1,"CONDITIONING"],["5","4",1,"7",0,"CLIP"],["6","7",0,"3",2,"CONDITIONING"],["7","3",0,"8",0,"LATENT"],["8","4",2,"8",1,"VAE"],["9","8",0,"9",0,"IMAGE"],["10","10",0,"11",0,"LATENT"],["11","3",0,"10",0,"LATENT"],["12","11",0,"12",0,"IMAGE"],["13","4",2,"11",1,"VAE"]],"groups":[],"version":0,"extra":{"comflowy_version":"0.0.4-alpha"}} \ No newline at end of file diff --git a/apps/electron-frontend/src/components/templates/data/Canny-ControlNet-workflow.json b/apps/electron-frontend/src/components/templates/data/Canny-ControlNet-workflow.json index 0599484e..454bff41 100644 --- a/apps/electron-frontend/src/components/templates/data/Canny-ControlNet-workflow.json +++ b/apps/electron-frontend/src/components/templates/data/Canny-ControlNet-workflow.json @@ -1,594 +1 @@ -{ - "last_node_id": 17, - "last_link_id": 19, - "nodes": [ - { - "id": 7, - "type": "CLIPTextEncode", - "pos": [ - 430, - 270 - ], - "size": { - "0": 370, - "1": 160 - }, - "flags": {}, - "order": 6, - "mode": 0, - "inputs": [ - { - "name": "clip", - "type": "CLIP", - "link": 5 - } - ], - "outputs": [ - { - "name": "CONDITIONING", - "type": "CONDITIONING", - "links": [ - 6 - ], - "slot_index": 0 - } - ], - "title": "CLIP Text Encode (Negative)", - "properties": { - "Node name for S&R": "CLIPTextEncode" - }, - "widgets_values": [ - "blurry, illustration, horror, rendering, cosplay" - ] - }, - { - "id": 5, - "type": "EmptyLatentImage", - "pos": [ - 580, - 490 - ], - "size": { - "0": 220, - "1": 106 - }, - "flags": {}, - "order": 0, - "mode": 0, - "outputs": [ - { - "name": "LATENT", - "type": "LATENT", - "links": [ - 2 - ], - "slot_index": 0 - } - ], - "properties": { - "Node name for S&R": "EmptyLatentImage" - }, - "widgets_values": [ - 512, - 512, - 1 - ] - }, - { - "id": 17, - "type": "PreviewImage", - "pos": [ - 770, - 770 - ], - "size": [ - 210, - 246 - ], - "flags": {}, - "order": 7, - "mode": 0, - "inputs": [ - { - "name": "images", - "type": "IMAGE", - "link": 18 - } - ], - "properties": { - "Node name for S&R": "PreviewImage" - } - }, - { - "id": 12, - "type": "LoadImage", - "pos": [ - 290, - 770 - ], - "size": [ - 210, - 314 - ], - "flags": {}, - "order": 1, - "mode": 0, - "outputs": [ - { - "name": "IMAGE", - "type": "IMAGE", - "links": [ - 13 - ], - "shape": 3, - "slot_index": 0 - }, - { - "name": "MASK", - "type": "MASK", - "links": null, - "shape": 3 - } - ], - "properties": { - "Node name for S&R": "LoadImage" - }, - "widgets_values": [ - "cwf_portrait.jpg", - "image" - ] - }, - { - "id": 8, - "type": "VAEDecode", - "pos": [ - 1290, - 190 - ], - "size": { - "0": 140, - "1": 60 - }, - "flags": {}, - "order": 10, - "mode": 0, - "inputs": [ - { - "name": "samples", - "type": "LATENT", - "link": 7 - }, - { - "name": "vae", - "type": "VAE", - "link": 19 - } - ], - "outputs": [ - { - "name": "IMAGE", - "type": "IMAGE", - "links": [ - 9 - ], - "slot_index": 0 - } - ], - "properties": { - "Node name for S&R": "VAEDecode" - } - }, - { - "id": 16, - "type": "ControlNetApply", - "pos": [ - 880, - 610 - ], - "size": { - "0": 211.60000610351562, - "1": 100 - }, - "flags": {}, - "order": 8, - "mode": 0, - "inputs": [ - { - "name": "conditioning", - "type": "CONDITIONING", - "link": 16 - }, - { - "name": "control_net", - "type": "CONTROL_NET", - "link": 15 - }, - { - "name": "image", - "type": "IMAGE", - "link": 14 - } - ], - "outputs": [ - { - "name": "CONDITIONING", - "type": "CONDITIONING", - "links": [ - 17 - ], - "shape": 3, - "slot_index": 0 - } - ], - "properties": { - "Node name for S&R": "ControlNetApply" - }, - "widgets_values": [ - 0.8499999999999999 - ] - }, - { - "id": 3, - "type": "KSampler", - "pos": [ - 950, - 190 - ], - "size": { - "0": 300, - "1": 262 - }, - "flags": {}, - "order": 9, - "mode": 0, - "inputs": [ - { - "name": "model", - "type": "MODEL", - "link": 1 - }, - { - "name": "positive", - "type": "CONDITIONING", - "link": 17 - }, - { - "name": "negative", - "type": "CONDITIONING", - "link": 6 - }, - { - "name": "latent_image", - "type": "LATENT", - "link": 2 - } - ], - "outputs": [ - { - "name": "LATENT", - "type": "LATENT", - "links": [ - 7 - ], - "slot_index": 0 - } - ], - "properties": { - "Node name for S&R": "KSampler" - }, - "widgets_values": [ - 636250194499629, - "fixed", - 25, - 7, - "dpmpp_2m", - "karras", - 1 - ] - }, - { - "id": 4, - "type": "CheckpointLoaderSimple", - "pos": [ - 20, - 190 - ], - "size": { - "0": 340, - "1": 100 - }, - "flags": {}, - "order": 2, - "mode": 0, - "outputs": [ - { - "name": "MODEL", - "type": "MODEL", - "links": [ - 1 - ], - "slot_index": 0 - }, - { - "name": "CLIP", - "type": "CLIP", - "links": [ - 3, - 5 - ], - "slot_index": 1 - }, - { - "name": "VAE", - "type": "VAE", - "links": [ - 19 - ], - "slot_index": 2 - } - ], - "properties": { - "Node name for S&R": "CheckpointLoaderSimple" - }, - "widgets_values": [ - "dreamshaper_8.safetensors" - ] - }, - { - "id": 9, - "type": "SaveImage", - "pos": [ - 1470, - 190 - ], - "size": { - "0": 410, - "1": 460 - }, - "flags": {}, - "order": 11, - "mode": 0, - "inputs": [ - { - "name": "images", - "type": "IMAGE", - "link": 9 - } - ], - "properties": {}, - "widgets_values": [ - "Result" - ] - }, - { - "id": 6, - "type": "CLIPTextEncode", - "pos": [ - 430, - 50 - ], - "size": { - "0": 370, - "1": 160 - }, - "flags": {}, - "order": 5, - "mode": 0, - "inputs": [ - { - "name": "clip", - "type": "CLIP", - "link": 3 - } - ], - "outputs": [ - { - "name": "CONDITIONING", - "type": "CONDITIONING", - "links": [ - 16 - ], - "slot_index": 0 - } - ], - "title": "CLIP Text Encode (Positive)", - "properties": { - "Node name for S&R": "CLIPTextEncode" - }, - "widgets_values": [ - "a portrait photo of a female elf from Lord of the Rings, (Liv Tyler:1.1), (Cate Blanchett:0.9)\n\nhigh resolution, highly detailed, 4k, cinematic, dramatic lighting" - ] - }, - { - "id": 14, - "type": "ControlNetLoader", - "pos": [ - 348, - 638 - ], - "size": [ - 452.7665875244136, - 67.40708251953072 - ], - "flags": {}, - "order": 3, - "mode": 0, - "outputs": [ - { - "name": "CONTROL_NET", - "type": "CONTROL_NET", - "links": [ - 15 - ], - "shape": 3, - "slot_index": 0 - } - ], - "properties": { - "Node name for S&R": "ControlNetLoader" - }, - "widgets_values": [ - "control_v11p_sd15_canny_fp16.safetensors" - ] - }, - { - "id": 13, - "type": "Canny", - "pos": [ - 530, - 770 - ], - "size": { - "0": 210, - "1": 82 - }, - "flags": {}, - "order": 4, - "mode": 0, - "inputs": [ - { - "name": "image", - "type": "IMAGE", - "link": 13 - } - ], - "outputs": [ - { - "name": "IMAGE", - "type": "IMAGE", - "links": [ - 14, - 18 - ], - "shape": 3, - "slot_index": 0 - } - ], - "properties": { - "Node name for S&R": "Canny" - }, - "widgets_values": [ - 0.29999999999999993, - 0.7 - ] - } - ], - "links": [ - [ - 1, - 4, - 0, - 3, - 0, - "MODEL" - ], - [ - 2, - 5, - 0, - 3, - 3, - "LATENT" - ], - [ - 3, - 4, - 1, - 6, - 0, - "CLIP" - ], - [ - 5, - 4, - 1, - 7, - 0, - "CLIP" - ], - [ - 6, - 7, - 0, - 3, - 2, - "CONDITIONING" - ], - [ - 7, - 3, - 0, - 8, - 0, - "LATENT" - ], - [ - 9, - 8, - 0, - 9, - 0, - "IMAGE" - ], - [ - 13, - 12, - 0, - 13, - 0, - "IMAGE" - ], - [ - 14, - 13, - 0, - 16, - 2, - "IMAGE" - ], - [ - 15, - 14, - 0, - 16, - 1, - "CONTROL_NET" - ], - [ - 16, - 6, - 0, - 16, - 0, - "CONDITIONING" - ], - [ - 17, - 16, - 0, - 3, - 1, - "CONDITIONING" - ], - [ - 18, - 13, - 0, - 17, - 0, - "IMAGE" - ], - [ - 19, - 4, - 2, - 8, - 1, - "VAE" - ] - ], - "groups": [], - "config": {}, - "extra": {}, - "version": 0.4 -} \ No newline at end of file +{"id":"b6ea4f06-ebb8-4067-84a7-cd021bc38c6c","title":"Canny ControlNet workflow","nodes":[{"id":"3","type":"KSampler","properties":{"Node name for S&R":"KSampler"},"pos":[1116.1725888324875,193.46192893401013],"size":[300,413],"inputs":[{"name":"model","type":"MODEL","link":1},{"name":"positive","type":"CONDITIONING","link":17},{"name":"negative","type":"CONDITIONING","link":6},{"name":"latent_image","type":"LATENT","link":2}],"outputs":[{"name":"LATENT","type":"LATENT","links":[7],"slot_index":0}],"widgets_values":[636250194499629,"fixed",25,7,"dpmpp_2m","karras",1],"order":0,"mode":0},{"id":"4","type":"CheckpointLoaderSimple","properties":{"Node name for S&R":"CheckpointLoaderSimple"},"pos":[-173.86802030456852,-154.46192893401025],"size":[340,161],"inputs":[],"outputs":[{"name":"MODEL","type":"MODEL","links":[1],"slot_index":0},{"name":"CLIP","type":"CLIP","links":[3,5],"slot_index":1},{"name":"VAE","type":"VAE","links":[19],"slot_index":2}],"widgets_values":["dreamshaper_8.safetensors"],"order":0,"mode":0},{"id":"5","type":"EmptyLatentImage","properties":{"Node name for S&R":"EmptyLatentImage"},"pos":[837.9137055837564,436.3401015228426],"size":[220,189],"inputs":[],"outputs":[{"name":"LATENT","type":"LATENT","links":[2],"slot_index":0}],"widgets_values":[512,512,1],"order":0,"mode":0},{"id":"6","type":"CLIPTextEncode","title":"CLIP Text Encode (Positive)","properties":{"Node name for S&R":"CLIPTextEncode"},"pos":[428.2690355329948,-322.1573604060914],"size":[370,221],"inputs":[{"name":"clip","type":"CLIP","link":3}],"outputs":[{"name":"CONDITIONING","type":"CONDITIONING","links":[16],"slot_index":0}],"widgets_values":["a portrait photo of a female elf from Lord of the Rings, (Liv Tyler:1.1), (Cate Blanchett:0.9)\n\nhigh resolution, highly detailed, 4k, cinematic, dramatic lighting"],"order":0,"mode":0},{"id":"7","type":"CLIPTextEncode","title":"CLIP Text Encode (Negative)","properties":{"Node name for S&R":"CLIPTextEncode"},"pos":[689.6446700507614,185.18274111675123],"size":[370,221],"inputs":[{"name":"clip","type":"CLIP","link":5}],"outputs":[{"name":"CONDITIONING","type":"CONDITIONING","links":[6],"slot_index":0}],"widgets_values":["blurry, illustration, horror, rendering, cosplay"],"order":0,"mode":0},{"id":"8","type":"VAEDecode","properties":{"Node name for S&R":"VAEDecode"},"pos":[1456.1725888324872,193.46192893401016],"size":[140,99],"inputs":[{"name":"samples","type":"LATENT","link":7},{"name":"vae","type":"VAE","link":19}],"outputs":[{"name":"IMAGE","type":"IMAGE","links":[9],"slot_index":0}],"widgets_values":[],"order":0,"mode":0},{"id":"9","type":"SaveImage","properties":{},"pos":[1677.7157360406093,190],"size":[410,460],"inputs":[{"name":"images","type":"IMAGE","link":9}],"outputs":[],"widgets_values":["Result"],"order":0,"mode":0},{"id":"12","type":"LoadImage","properties":{"Node name for S&R":"LoadImage"},"pos":[-42.34517766497464,81.07614213197967],"size":[210,345],"inputs":[],"outputs":[{"name":"IMAGE","type":"IMAGE","links":[13],"shape":3,"slot_index":0},{"name":"MASK","type":"MASK","links":null,"shape":3}],"widgets_values":["cwf_portrait.jpg",null],"order":0,"mode":0},{"id":"13","type":"Canny","properties":{"Node name for S&R":"Canny"},"pos":[206.30964467005066,82.4609137055836],"size":[210,151],"inputs":[{"name":"image","type":"IMAGE","link":13}],"outputs":[{"name":"IMAGE","type":"IMAGE","links":[14,18],"shape":3,"slot_index":0}],"widgets_values":[0.29999999999999993,0.7],"order":0,"mode":0},{"id":"14","type":"ControlNetLoader","properties":{"Node name for S&R":"ControlNetLoader"},"pos":[349.73096446700504,-76.88832487309655],"size":[453,113],"inputs":[],"outputs":[{"name":"CONTROL_NET","type":"CONTROL_NET","links":[15],"shape":3,"slot_index":0}],"widgets_values":["control_v11p_sd15_canny_fp16.safetensors"],"order":0,"mode":0},{"id":"16","type":"ControlNetApply","properties":{"Node name for S&R":"ControlNetApply"},"pos":[838.4568527918781,-6.223350253807119],"size":[212,161],"inputs":[{"name":"conditioning","type":"CONDITIONING","link":16},{"name":"control_net","type":"CONTROL_NET","link":15},{"name":"image","type":"IMAGE","link":14}],"outputs":[{"name":"CONDITIONING","type":"CONDITIONING","links":[17],"shape":3,"slot_index":0}],"widgets_values":[0.8499999999999999],"order":0,"mode":0},{"id":"17","type":"PreviewImage","properties":{"Node name for S&R":"PreviewImage"},"pos":[451.50253807106594,89.73096446700497],"size":[210,246],"inputs":[{"name":"images","type":"IMAGE","link":18}],"outputs":[],"widgets_values":[],"order":0,"mode":0}],"links":[["1","4",0,"3",0,"MODEL"],["2","5",0,"3",3,"LATENT"],["3","4",1,"6",0,"CLIP"],["5","4",1,"7",0,"CLIP"],["6","7",0,"3",2,"CONDITIONING"],["7","3",0,"8",0,"LATENT"],["9","8",0,"9",0,"IMAGE"],["13","12",0,"13",0,"IMAGE"],["14","13",0,"16",2,"IMAGE"],["15","14",0,"16",1,"CONTROL_NET"],["16","6",0,"16",0,"CONDITIONING"],["17","16",0,"3",1,"CONDITIONING"],["18","13",0,"17",0,"IMAGE"],["19","4",2,"8",1,"VAE"]],"groups":[],"version":0,"extra":{"comflowy_version":"0.0.4-alpha"}} \ No newline at end of file diff --git a/apps/electron-frontend/src/components/templates/data/Hi-res-fix-latent-upscale-workflow.json b/apps/electron-frontend/src/components/templates/data/Hi-res-fix-latent-upscale-workflow.json index f05e1ce5..427281fa 100644 --- a/apps/electron-frontend/src/components/templates/data/Hi-res-fix-latent-upscale-workflow.json +++ b/apps/electron-frontend/src/components/templates/data/Hi-res-fix-latent-upscale-workflow.json @@ -1,511 +1 @@ -{ - "last_node_id": 11, - "last_link_id": 15, - "nodes": [ - { - "id": 5, - "type": "EmptyLatentImage", - "pos": [ - 473, - 609 - ], - "size": { - "0": 315, - "1": 106 - }, - "flags": {}, - "order": 0, - "mode": 0, - "outputs": [ - { - "name": "LATENT", - "type": "LATENT", - "links": [ - 2 - ], - "slot_index": 0 - } - ], - "properties": { - "Node name for S&R": "EmptyLatentImage" - }, - "widgets_values": [ - 512, - 512, - 1 - ] - }, - { - "id": 3, - "type": "KSampler", - "pos": [ - 863, - 186 - ], - "size": { - "0": 315, - "1": 262 - }, - "flags": {}, - "order": 4, - "mode": 0, - "inputs": [ - { - "name": "model", - "type": "MODEL", - "link": 1 - }, - { - "name": "positive", - "type": "CONDITIONING", - "link": 4 - }, - { - "name": "negative", - "type": "CONDITIONING", - "link": 6 - }, - { - "name": "latent_image", - "type": "LATENT", - "link": 2 - } - ], - "outputs": [ - { - "name": "LATENT", - "type": "LATENT", - "links": [ - 10 - ], - "slot_index": 0 - } - ], - "properties": { - "Node name for S&R": "KSampler" - }, - "widgets_values": [ - 156680208700286, - "randomize", - 20, - 8, - "dpmpp_2m", - "karras", - 1 - ] - }, - { - "id": 6, - "type": "CLIPTextEncode", - "pos": [ - 415, - 186 - ], - "size": { - "0": 422.84503173828125, - "1": 164.31304931640625 - }, - "flags": {}, - "order": 2, - "mode": 0, - "inputs": [ - { - "name": "clip", - "type": "CLIP", - "link": 3 - } - ], - "outputs": [ - { - "name": "CONDITIONING", - "type": "CONDITIONING", - "links": [ - 4, - 12 - ], - "slot_index": 0 - } - ], - "properties": { - "Node name for S&R": "CLIPTextEncode" - }, - "widgets_values": [ - "Cat, standing on the castle" - ] - }, - { - "id": 7, - "type": "CLIPTextEncode", - "pos": [ - 413, - 389 - ], - "size": { - "0": 425.27801513671875, - "1": 180.6060791015625 - }, - "flags": {}, - "order": 3, - "mode": 0, - "inputs": [ - { - "name": "clip", - "type": "CLIP", - "link": 5 - } - ], - "outputs": [ - { - "name": "CONDITIONING", - "type": "CONDITIONING", - "links": [ - 6, - 13 - ], - "slot_index": 0 - } - ], - "properties": { - "Node name for S&R": "CLIPTextEncode" - }, - "widgets_values": [ - "text, watermark" - ] - }, - { - "id": 4, - "type": "CheckpointLoaderSimple", - "pos": [ - 26, - 474 - ], - "size": { - "0": 315, - "1": 98 - }, - "flags": {}, - "order": 1, - "mode": 0, - "outputs": [ - { - "name": "MODEL", - "type": "MODEL", - "links": [ - 1, - 14 - ], - "slot_index": 0 - }, - { - "name": "CLIP", - "type": "CLIP", - "links": [ - 3, - 5 - ], - "slot_index": 1 - }, - { - "name": "VAE", - "type": "VAE", - "links": [ - 8 - ], - "slot_index": 2 - } - ], - "properties": { - "Node name for S&R": "CheckpointLoaderSimple" - }, - "widgets_values": [ - "sd_xl_refiner_1.0.safetensors" - ] - }, - { - "id": 10, - "type": "LatentUpscale", - "pos": [ - 1223, - 191 - ], - "size": { - "0": 315, - "1": 130 - }, - "flags": {}, - "order": 5, - "mode": 0, - "inputs": [ - { - "name": "samples", - "type": "LATENT", - "link": 10 - } - ], - "outputs": [ - { - "name": "LATENT", - "type": "LATENT", - "links": [ - 11 - ], - "shape": 3, - "slot_index": 0 - } - ], - "properties": { - "Node name for S&R": "LatentUpscale" - }, - "widgets_values": [ - "nearest-exact", - 1024, - 1024, - "disabled" - ] - }, - { - "id": 11, - "type": "KSampler", - "pos": [ - 1593, - 177 - ], - "size": { - "0": 315, - "1": 262 - }, - "flags": {}, - "order": 6, - "mode": 0, - "inputs": [ - { - "name": "model", - "type": "MODEL", - "link": 14 - }, - { - "name": "positive", - "type": "CONDITIONING", - "link": 12 - }, - { - "name": "negative", - "type": "CONDITIONING", - "link": 13 - }, - { - "name": "latent_image", - "type": "LATENT", - "link": 11 - } - ], - "outputs": [ - { - "name": "LATENT", - "type": "LATENT", - "links": [ - 15 - ], - "shape": 3, - "slot_index": 0 - } - ], - "properties": { - "Node name for S&R": "KSampler" - }, - "widgets_values": [ - 0, - "randomize", - 20, - 8, - "dpmpp_2m", - "karras", - 0.5 - ] - }, - { - "id": 8, - "type": "VAEDecode", - "pos": [ - 1968, - 177 - ], - "size": { - "0": 210, - "1": 46 - }, - "flags": {}, - "order": 7, - "mode": 0, - "inputs": [ - { - "name": "samples", - "type": "LATENT", - "link": 15 - }, - { - "name": "vae", - "type": "VAE", - "link": 8 - } - ], - "outputs": [ - { - "name": "IMAGE", - "type": "IMAGE", - "links": [ - 9 - ], - "slot_index": 0 - } - ], - "properties": { - "Node name for S&R": "VAEDecode" - } - }, - { - "id": 9, - "type": "SaveImage", - "pos": [ - 2246, - 178 - ], - "size": { - "0": 210, - "1": 58 - }, - "flags": {}, - "order": 8, - "mode": 0, - "inputs": [ - { - "name": "images", - "type": "IMAGE", - "link": 9 - } - ], - "properties": {}, - "widgets_values": [ - "ComfyUI" - ] - } - ], - "links": [ - [ - 1, - 4, - 0, - 3, - 0, - "MODEL" - ], - [ - 2, - 5, - 0, - 3, - 3, - "LATENT" - ], - [ - 3, - 4, - 1, - 6, - 0, - "CLIP" - ], - [ - 4, - 6, - 0, - 3, - 1, - "CONDITIONING" - ], - [ - 5, - 4, - 1, - 7, - 0, - "CLIP" - ], - [ - 6, - 7, - 0, - 3, - 2, - "CONDITIONING" - ], - [ - 8, - 4, - 2, - 8, - 1, - "VAE" - ], - [ - 9, - 8, - 0, - 9, - 0, - "IMAGE" - ], - [ - 10, - 3, - 0, - 10, - 0, - "LATENT" - ], - [ - 11, - 10, - 0, - 11, - 3, - "LATENT" - ], - [ - 12, - 6, - 0, - 11, - 1, - "CONDITIONING" - ], - [ - 13, - 7, - 0, - 11, - 2, - "CONDITIONING" - ], - [ - 14, - 4, - 0, - 11, - 0, - "MODEL" - ], - [ - 15, - 11, - 0, - 8, - 0, - "LATENT" - ] - ], - "groups": [], - "config": {}, - "extra": {}, - "version": 0.4 -} \ No newline at end of file +{"id":"9ca45931-28ce-4a84-8709-2a84655f544e","title":"Hi-res fix latent upscale workflow","nodes":[{"id":"3","type":"KSampler","properties":{"Node name for S&R":"KSampler"},"pos":[863,186],"size":[315,413],"inputs":[{"name":"model","type":"MODEL","link":1},{"name":"positive","type":"CONDITIONING","link":4},{"name":"negative","type":"CONDITIONING","link":6},{"name":"latent_image","type":"LATENT","link":2}],"outputs":[{"name":"LATENT","type":"LATENT","links":[10],"slot_index":0}],"widgets_values":[156680208700286,"randomize",20,8,"dpmpp_2m","karras",1],"order":0,"mode":0},{"id":"4","type":"CheckpointLoaderSimple","properties":{"Node name for S&R":"CheckpointLoaderSimple"},"pos":[-42.776773296244784,386.634909596662],"size":[315,161],"inputs":[],"outputs":[{"name":"MODEL","type":"MODEL","links":[1,14],"slot_index":0},{"name":"CLIP","type":"CLIP","links":[3,5],"slot_index":1},{"name":"VAE","type":"VAE","links":[8],"slot_index":2}],"widgets_values":["sd_xl_refiner_1.0.safetensors"],"order":0,"mode":0},{"id":"5","type":"EmptyLatentImage","properties":{"Node name for S&R":"EmptyLatentImage"},"pos":[486.0118219749653,571.8233657858136],"size":[315,189],"inputs":[],"outputs":[{"name":"LATENT","type":"LATENT","links":[2],"slot_index":0}],"widgets_values":[512,512,1],"order":0,"mode":0},{"id":"6","type":"CLIPTextEncode","properties":{"Node name for S&R":"CLIPTextEncode"},"pos":[385.2586926286509,61.45827538247568],"size":[423,221],"inputs":[{"name":"clip","type":"CLIP","link":3}],"outputs":[{"name":"CONDITIONING","type":"CONDITIONING","links":[4,12],"slot_index":0}],"widgets_values":["Cat, standing on the castle"],"order":0,"mode":0},{"id":"7","type":"CLIPTextEncode","properties":{"Node name for S&R":"CLIPTextEncode"},"pos":[381.3998609179415,309.0702364394993],"size":[425,221],"inputs":[{"name":"clip","type":"CLIP","link":5}],"outputs":[{"name":"CONDITIONING","type":"CONDITIONING","links":[6,13],"slot_index":0}],"widgets_values":["text, watermark"],"order":0,"mode":0},{"id":"8","type":"VAEDecode","properties":{"Node name for S&R":"VAEDecode"},"pos":[1968,177],"size":[210,99],"inputs":[{"name":"samples","type":"LATENT","link":15},{"name":"vae","type":"VAE","link":8}],"outputs":[{"name":"IMAGE","type":"IMAGE","links":[9],"slot_index":0}],"widgets_values":[],"order":0,"mode":0},{"id":"9","type":"SaveImage","properties":{},"pos":[2246,178],"size":[240,363],"inputs":[{"name":"images","type":"IMAGE","link":9}],"outputs":[],"widgets_values":["ComfyUI"],"order":0,"mode":0},{"id":"10","type":"LatentUpscale","properties":{"Node name for S&R":"LatentUpscale"},"pos":[1223,183.56467315716273],"size":[315,227],"inputs":[{"name":"samples","type":"LATENT","link":10}],"outputs":[{"name":"LATENT","type":"LATENT","links":[11],"shape":3,"slot_index":0}],"widgets_values":["nearest-exact",1024,1024,"disabled"],"order":0,"mode":0},{"id":"11","type":"KSampler","properties":{"Node name for S&R":"KSampler"},"pos":[1591.1411682892908,186.2941585535466],"size":[315,413],"inputs":[{"name":"model","type":"MODEL","link":14},{"name":"positive","type":"CONDITIONING","link":12},{"name":"negative","type":"CONDITIONING","link":13},{"name":"latent_image","type":"LATENT","link":11}],"outputs":[{"name":"LATENT","type":"LATENT","links":[15],"shape":3,"slot_index":0}],"widgets_values":[0,"randomize",20,8,"dpmpp_2m","karras",0.5],"order":0,"mode":0}],"links":[["1","4",0,"3",0,"MODEL"],["2","5",0,"3",3,"LATENT"],["3","4",1,"6",0,"CLIP"],["4","6",0,"3",1,"CONDITIONING"],["5","4",1,"7",0,"CLIP"],["6","7",0,"3",2,"CONDITIONING"],["8","4",2,"8",1,"VAE"],["9","8",0,"9",0,"IMAGE"],["10","3",0,"10",0,"LATENT"],["11","10",0,"11",3,"LATENT"],["12","6",0,"11",1,"CONDITIONING"],["13","7",0,"11",2,"CONDITIONING"],["14","4",0,"11",0,"MODEL"],["15","11",0,"8",0,"LATENT"]],"groups":[],"version":0,"extra":{"comflowy_version":"0.0.4-alpha"}} \ No newline at end of file diff --git a/apps/electron-frontend/src/components/templates/data/Inpainting-workflow.json b/apps/electron-frontend/src/components/templates/data/Inpainting-workflow.json index 8d29748f..911104f6 100644 --- a/apps/electron-frontend/src/components/templates/data/Inpainting-workflow.json +++ b/apps/electron-frontend/src/components/templates/data/Inpainting-workflow.json @@ -1,449 +1 @@ -{ - "last_node_id": 11, - "last_link_id": 13, - "nodes": [ - { - "id": 8, - "type": "VAEDecode", - "pos": [ - 1209, - 188 - ], - "size": { - "0": 210, - "1": 46 - }, - "flags": {}, - "order": 6, - "mode": 0, - "inputs": [ - { - "name": "samples", - "type": "LATENT", - "link": 7 - }, - { - "name": "vae", - "type": "VAE", - "link": 8 - } - ], - "outputs": [ - { - "name": "IMAGE", - "type": "IMAGE", - "links": [ - 9 - ], - "slot_index": 0 - } - ], - "properties": { - "Node name for S&R": "VAEDecode" - } - }, - { - "id": 9, - "type": "SaveImage", - "pos": [ - 1451, - 189 - ], - "size": { - "0": 210, - "1": 58 - }, - "flags": {}, - "order": 7, - "mode": 0, - "inputs": [ - { - "name": "images", - "type": "IMAGE", - "link": 9 - } - ], - "properties": {}, - "widgets_values": [ - "ComfyUI" - ] - }, - { - "id": 6, - "type": "CLIPTextEncode", - "pos": [ - 415, - 186 - ], - "size": { - "0": 422.84503173828125, - "1": 164.31304931640625 - }, - "flags": {}, - "order": 2, - "mode": 0, - "inputs": [ - { - "name": "clip", - "type": "CLIP", - "link": 3 - } - ], - "outputs": [ - { - "name": "CONDITIONING", - "type": "CONDITIONING", - "links": [ - 4 - ], - "slot_index": 0 - } - ], - "properties": { - "Node name for S&R": "CLIPTextEncode" - }, - "widgets_values": [ - "red hair" - ] - }, - { - "id": 4, - "type": "CheckpointLoaderSimple", - "pos": [ - 26, - 474 - ], - "size": { - "0": 315, - "1": 98 - }, - "flags": {}, - "order": 0, - "mode": 0, - "outputs": [ - { - "name": "MODEL", - "type": "MODEL", - "links": [ - 1 - ], - "slot_index": 0 - }, - { - "name": "CLIP", - "type": "CLIP", - "links": [ - 3, - 5 - ], - "slot_index": 1 - }, - { - "name": "VAE", - "type": "VAE", - "links": [ - 8, - 13 - ], - "slot_index": 2 - } - ], - "properties": { - "Node name for S&R": "CheckpointLoaderSimple" - }, - "widgets_values": [ - "DreamShaper-v8.0-Inpainting.safetensors" - ] - }, - { - "id": 11, - "type": "LoadImage", - "pos": [ - 114, - 694 - ], - "size": [ - 315, - 314.00000381469727 - ], - "flags": {}, - "order": 1, - "mode": 0, - "outputs": [ - { - "name": "IMAGE", - "type": "IMAGE", - "links": [ - 11 - ], - "shape": 3, - "slot_index": 0 - }, - { - "name": "MASK", - "type": "MASK", - "links": [ - 12 - ], - "shape": 3, - "slot_index": 1 - } - ], - "properties": { - "Node name for S&R": "LoadImage" - }, - "widgets_values": [ - "SCR-20231213-qaoj.jpeg", - "image" - ] - }, - { - "id": 10, - "type": "VAEEncodeForInpaint", - "pos": [ - 511, - 673 - ], - "size": { - "0": 315, - "1": 98 - }, - "flags": {}, - "order": 4, - "mode": 0, - "inputs": [ - { - "name": "pixels", - "type": "IMAGE", - "link": 11 - }, - { - "name": "vae", - "type": "VAE", - "link": 13 - }, - { - "name": "mask", - "type": "MASK", - "link": 12 - } - ], - "outputs": [ - { - "name": "LATENT", - "type": "LATENT", - "links": [ - 10 - ], - "shape": 3, - "slot_index": 0 - } - ], - "properties": { - "Node name for S&R": "VAEEncodeForInpaint" - }, - "widgets_values": [ - 8 - ] - }, - { - "id": 3, - "type": "KSampler", - "pos": [ - 863, - 186 - ], - "size": { - "0": 315, - "1": 262 - }, - "flags": {}, - "order": 5, - "mode": 0, - "inputs": [ - { - "name": "model", - "type": "MODEL", - "link": 1 - }, - { - "name": "positive", - "type": "CONDITIONING", - "link": 4 - }, - { - "name": "negative", - "type": "CONDITIONING", - "link": 6 - }, - { - "name": "latent_image", - "type": "LATENT", - "link": 10 - } - ], - "outputs": [ - { - "name": "LATENT", - "type": "LATENT", - "links": [ - 7 - ], - "slot_index": 0 - } - ], - "properties": { - "Node name for S&R": "KSampler" - }, - "widgets_values": [ - 156680208700286, - "randomize", - 20, - 8, - "dpmpp_2m", - "karras", - 0.85 - ] - }, - { - "id": 7, - "type": "CLIPTextEncode", - "pos": [ - 413, - 389 - ], - "size": { - "0": 425.27801513671875, - "1": 180.6060791015625 - }, - "flags": {}, - "order": 3, - "mode": 0, - "inputs": [ - { - "name": "clip", - "type": "CLIP", - "link": 5 - } - ], - "outputs": [ - { - "name": "CONDITIONING", - "type": "CONDITIONING", - "links": [ - 6 - ], - "slot_index": 0 - } - ], - "properties": { - "Node name for S&R": "CLIPTextEncode" - }, - "widgets_values": [ - "blurry, illustration, naked, horror, distorted, wrong hands" - ] - } - ], - "links": [ - [ - 1, - 4, - 0, - 3, - 0, - "MODEL" - ], - [ - 3, - 4, - 1, - 6, - 0, - "CLIP" - ], - [ - 4, - 6, - 0, - 3, - 1, - "CONDITIONING" - ], - [ - 5, - 4, - 1, - 7, - 0, - "CLIP" - ], - [ - 6, - 7, - 0, - 3, - 2, - "CONDITIONING" - ], - [ - 7, - 3, - 0, - 8, - 0, - "LATENT" - ], - [ - 8, - 4, - 2, - 8, - 1, - "VAE" - ], - [ - 9, - 8, - 0, - 9, - 0, - "IMAGE" - ], - [ - 10, - 10, - 0, - 3, - 3, - "LATENT" - ], - [ - 11, - 11, - 0, - 10, - 0, - "IMAGE" - ], - [ - 12, - 11, - 1, - 10, - 2, - "MASK" - ], - [ - 13, - 4, - 2, - 10, - 1, - "VAE" - ] - ], - "groups": [], - "config": {}, - "extra": {}, - "version": 0.4 -} \ No newline at end of file +{"id":"f9ef8d91-db53-4917-ae7e-107678de7a9a","title":"Inpainting workflow","nodes":[{"id":"3","type":"KSampler","properties":{"Node name for S&R":"KSampler"},"pos":[863,186],"size":[315,413],"inputs":[{"name":"model","type":"MODEL","link":1},{"name":"positive","type":"CONDITIONING","link":4},{"name":"negative","type":"CONDITIONING","link":6},{"name":"latent_image","type":"LATENT","link":10}],"outputs":[{"name":"LATENT","type":"LATENT","links":[7],"slot_index":0}],"widgets_values":[156680208700286,"randomize",20,8,"dpmpp_2m","karras",0.85],"order":0,"mode":0},{"id":"4","type":"CheckpointLoaderSimple","properties":{"Node name for S&R":"CheckpointLoaderSimple"},"pos":[-27.255076142131998,419.2233502538071],"size":[377,170],"inputs":[],"outputs":[{"name":"MODEL","type":"MODEL","links":[1],"slot_index":0},{"name":"CLIP","type":"CLIP","links":[3,5],"slot_index":1},{"name":"VAE","type":"VAE","links":[8,13],"slot_index":2}],"widgets_values":["DreamShaper-v8.0-Inpainting.safetensors"],"order":0,"mode":0},{"id":"6","type":"CLIPTextEncode","properties":{"Node name for S&R":"CLIPTextEncode"},"pos":[407.39213197969536,129.70177664974617],"size":[423,221],"inputs":[{"name":"clip","type":"CLIP","link":3}],"outputs":[{"name":"CONDITIONING","type":"CONDITIONING","links":[4],"slot_index":0}],"widgets_values":["red hair"],"order":0,"mode":0},{"id":"7","type":"CLIPTextEncode","properties":{"Node name for S&R":"CLIPTextEncode"},"pos":[408.4352791878173,372.26269035533],"size":[425,221],"inputs":[{"name":"clip","type":"CLIP","link":5}],"outputs":[{"name":"CONDITIONING","type":"CONDITIONING","links":[6],"slot_index":0}],"widgets_values":["blurry, illustration, naked, horror, distorted, wrong hands"],"order":0,"mode":0},{"id":"8","type":"VAEDecode","properties":{"Node name for S&R":"VAEDecode"},"pos":[1209,188],"size":[210,99],"inputs":[{"name":"samples","type":"LATENT","link":7},{"name":"vae","type":"VAE","link":8}],"outputs":[{"name":"IMAGE","type":"IMAGE","links":[9],"slot_index":0}],"widgets_values":[],"order":0,"mode":0},{"id":"9","type":"SaveImage","properties":{},"pos":[1451,189],"size":[210,113],"inputs":[{"name":"images","type":"IMAGE","link":9}],"outputs":[],"widgets_values":["ComfyUI"],"order":0,"mode":0},{"id":"10","type":"VAEEncodeForInpaint","properties":{"Node name for S&R":"VAEEncodeForInpaint"},"pos":[517.0862944162436,653.2195431472081],"size":[315,161],"inputs":[{"name":"pixels","type":"IMAGE","link":11},{"name":"vae","type":"VAE","link":13},{"name":"mask","type":"MASK","link":12}],"outputs":[{"name":"LATENT","type":"LATENT","links":[10],"shape":3,"slot_index":0}],"widgets_values":[8],"order":0,"mode":0},{"id":"11","type":"LoadImage","properties":{"Node name for S&R":"LoadImage"},"pos":[167.255076142132,655.960659898477],"size":[315,345],"inputs":[],"outputs":[{"name":"IMAGE","type":"IMAGE","links":[11],"shape":3,"slot_index":0},{"name":"MASK","type":"MASK","links":[12],"shape":3,"slot_index":1}],"widgets_values":["Rectangle 4135.png",null],"order":0,"mode":0}],"links":[["1","4",0,"3",0,"MODEL"],["3","4",1,"6",0,"CLIP"],["4","6",0,"3",1,"CONDITIONING"],["5","4",1,"7",0,"CLIP"],["6","7",0,"3",2,"CONDITIONING"],["7","3",0,"8",0,"LATENT"],["8","4",2,"8",1,"VAE"],["9","8",0,"9",0,"IMAGE"],["10","10",0,"3",3,"LATENT"],["11","11",0,"10",0,"IMAGE"],["12","11",1,"10",2,"MASK"],["13","4",2,"10",1,"VAE"]],"groups":[],"version":0,"extra":{"comflowy_version":"0.0.4-alpha"}} \ No newline at end of file diff --git a/apps/electron-frontend/src/components/templates/data/LCM-LoRA-workflow.json b/apps/electron-frontend/src/components/templates/data/LCM-LoRA-workflow.json index b20c2844..8a8f0e7b 100644 --- a/apps/electron-frontend/src/components/templates/data/LCM-LoRA-workflow.json +++ b/apps/electron-frontend/src/components/templates/data/LCM-LoRA-workflow.json @@ -1,437 +1 @@ -{ - "last_node_id": 13, - "last_link_id": 16, - "nodes": [ - { - "id": 8, - "type": "VAEDecode", - "pos": [ - 1209, - 188 - ], - "size": { - "0": 210, - "1": 46 - }, - "flags": {}, - "order": 6, - "mode": 0, - "inputs": [ - { - "name": "samples", - "type": "LATENT", - "link": 7 - }, - { - "name": "vae", - "type": "VAE", - "link": 16 - } - ], - "outputs": [ - { - "name": "IMAGE", - "type": "IMAGE", - "links": [ - 9 - ], - "slot_index": 0 - } - ], - "properties": { - "Node name for S&R": "VAEDecode" - } - }, - { - "id": 9, - "type": "SaveImage", - "pos": [ - 1451, - 189 - ], - "size": [ - 210, - 270 - ], - "flags": {}, - "order": 7, - "mode": 0, - "inputs": [ - { - "name": "images", - "type": "IMAGE", - "link": 9 - } - ], - "properties": {}, - "widgets_values": [ - "ComfyUI" - ] - }, - { - "id": 7, - "type": "CLIPTextEncode", - "pos": [ - 386, - 395 - ], - "size": { - "0": 425.27801513671875, - "1": 180.6060791015625 - }, - "flags": {}, - "order": 4, - "mode": 0, - "inputs": [ - { - "name": "clip", - "type": "CLIP", - "link": 14 - } - ], - "outputs": [ - { - "name": "CONDITIONING", - "type": "CONDITIONING", - "links": [ - 6 - ], - "slot_index": 0 - } - ], - "properties": { - "Node name for S&R": "CLIPTextEncode" - }, - "widgets_values": [ - "text, watermark" - ] - }, - { - "id": 12, - "type": "LoraLoader", - "pos": [ - -26, - 203 - ], - "size": { - "0": 315, - "1": 126 - }, - "flags": {}, - "order": 2, - "mode": 0, - "inputs": [ - { - "name": "model", - "type": "MODEL", - "link": 10 - }, - { - "name": "clip", - "type": "CLIP", - "link": 12 - } - ], - "outputs": [ - { - "name": "MODEL", - "type": "MODEL", - "links": [ - 11 - ], - "shape": 3, - "slot_index": 0 - }, - { - "name": "CLIP", - "type": "CLIP", - "links": [ - 13, - 14 - ], - "shape": 3, - "slot_index": 1 - } - ], - "properties": { - "Node name for S&R": "LoraLoader" - }, - "widgets_values": [ - "SDXL-LCM-LoRA.safetensors", - 1, - 1 - ] - }, - { - "id": 6, - "type": "CLIPTextEncode", - "pos": [ - 392, - 186 - ], - "size": { - "0": 422.84503173828125, - "1": 164.31304931640625 - }, - "flags": {}, - "order": 3, - "mode": 0, - "inputs": [ - { - "name": "clip", - "type": "CLIP", - "link": 13 - } - ], - "outputs": [ - { - "name": "CONDITIONING", - "type": "CONDITIONING", - "links": [ - 4 - ], - "slot_index": 0 - } - ], - "properties": { - "Node name for S&R": "CLIPTextEncode" - }, - "widgets_values": [ - "cat, standing on the castle" - ] - }, - { - "id": 3, - "type": "KSampler", - "pos": [ - 863, - 186 - ], - "size": { - "0": 315, - "1": 262 - }, - "flags": {}, - "order": 5, - "mode": 0, - "inputs": [ - { - "name": "model", - "type": "MODEL", - "link": 11 - }, - { - "name": "positive", - "type": "CONDITIONING", - "link": 4 - }, - { - "name": "negative", - "type": "CONDITIONING", - "link": 6 - }, - { - "name": "latent_image", - "type": "LATENT", - "link": 2 - } - ], - "outputs": [ - { - "name": "LATENT", - "type": "LATENT", - "links": [ - 7 - ], - "slot_index": 0 - } - ], - "properties": { - "Node name for S&R": "KSampler" - }, - "widgets_values": [ - 1054042089559169, - "randomize", - 5, - 1.8, - "lcm", - "sgm_uniform", - 1 - ] - }, - { - "id": 5, - "type": "EmptyLatentImage", - "pos": [ - 472, - 701 - ], - "size": { - "0": 315, - "1": 106 - }, - "flags": {}, - "order": 0, - "mode": 0, - "outputs": [ - { - "name": "LATENT", - "type": "LATENT", - "links": [ - 2 - ], - "slot_index": 0 - } - ], - "properties": { - "Node name for S&R": "EmptyLatentImage" - }, - "widgets_values": [ - 1024, - 1024, - 1 - ] - }, - { - "id": 4, - "type": "CheckpointLoaderSimple", - "pos": [ - -411, - 202 - ], - "size": { - "0": 315, - "1": 98 - }, - "flags": {}, - "order": 1, - "mode": 0, - "outputs": [ - { - "name": "MODEL", - "type": "MODEL", - "links": [ - 10 - ], - "slot_index": 0 - }, - { - "name": "CLIP", - "type": "CLIP", - "links": [ - 12 - ], - "slot_index": 1 - }, - { - "name": "VAE", - "type": "VAE", - "links": [ - 16 - ], - "slot_index": 2 - } - ], - "properties": { - "Node name for S&R": "CheckpointLoaderSimple" - }, - "widgets_values": [ - "SDXL-v1.0-base.safetensors" - ] - } - ], - "links": [ - [ - 2, - 5, - 0, - 3, - 3, - "LATENT" - ], - [ - 4, - 6, - 0, - 3, - 1, - "CONDITIONING" - ], - [ - 6, - 7, - 0, - 3, - 2, - "CONDITIONING" - ], - [ - 7, - 3, - 0, - 8, - 0, - "LATENT" - ], - [ - 9, - 8, - 0, - 9, - 0, - "IMAGE" - ], - [ - 10, - 4, - 0, - 12, - 0, - "MODEL" - ], - [ - 11, - 12, - 0, - 3, - 0, - "MODEL" - ], - [ - 12, - 4, - 1, - 12, - 1, - "CLIP" - ], - [ - 13, - 12, - 1, - 6, - 0, - "CLIP" - ], - [ - 14, - 12, - 1, - 7, - 0, - "CLIP" - ], - [ - 16, - 4, - 2, - 8, - 1, - "VAE" - ] - ], - "groups": [], - "config": {}, - "extra": {}, - "version": 0.4 -} \ No newline at end of file +{"id":"17ace548-d59c-4fcd-8ac7-6aca20e085b2","title":"LCM LoRA workflow","nodes":[{"id":"3","type":"KSampler","properties":{"Node name for S&R":"KSampler"},"pos":[863,186],"size":[315,413],"inputs":[{"name":"model","type":"MODEL","link":11},{"name":"positive","type":"CONDITIONING","link":4},{"name":"negative","type":"CONDITIONING","link":6},{"name":"latent_image","type":"LATENT","link":2}],"outputs":[{"name":"LATENT","type":"LATENT","links":[7],"slot_index":0}],"widgets_values":[1054042089559169,"randomize",5,1.8,"lcm","sgm_uniform",1],"order":0,"mode":0},{"id":"4","type":"CheckpointLoaderSimple","properties":{"Node name for S&R":"CheckpointLoaderSimple"},"pos":[-411,202],"size":[315,161],"inputs":[],"outputs":[{"name":"MODEL","type":"MODEL","links":[10],"slot_index":0},{"name":"CLIP","type":"CLIP","links":[12],"slot_index":1},{"name":"VAE","type":"VAE","links":[16],"slot_index":2}],"widgets_values":["sd_xl_base_1.0.safetensors"],"order":0,"mode":0},{"id":"5","type":"EmptyLatentImage","properties":{"Node name for S&R":"EmptyLatentImage"},"pos":[494.1897079276773,661.375521557719],"size":[315,189],"inputs":[],"outputs":[{"name":"LATENT","type":"LATENT","links":[2],"slot_index":0}],"widgets_values":[1024,1024,1],"order":0,"mode":0},{"id":"6","type":"CLIPTextEncode","properties":{"Node name for S&R":"CLIPTextEncode"},"pos":[385.6600834492351,135.2806675938804],"size":[423,221],"inputs":[{"name":"clip","type":"CLIP","link":13}],"outputs":[{"name":"CONDITIONING","type":"CONDITIONING","links":[4],"slot_index":0}],"widgets_values":["cat, standing on the castle"],"order":0,"mode":0},{"id":"7","type":"CLIPTextEncode","properties":{"Node name for S&R":"CLIPTextEncode"},"pos":[386,395],"size":[425,221],"inputs":[{"name":"clip","type":"CLIP","link":14}],"outputs":[{"name":"CONDITIONING","type":"CONDITIONING","links":[6],"slot_index":0}],"widgets_values":["text, watermark"],"order":0,"mode":0},{"id":"8","type":"VAEDecode","properties":{"Node name for S&R":"VAEDecode"},"pos":[1209,188],"size":[210,99],"inputs":[{"name":"samples","type":"LATENT","link":7},{"name":"vae","type":"VAE","link":16}],"outputs":[{"name":"IMAGE","type":"IMAGE","links":[9],"slot_index":0}],"widgets_values":[],"order":0,"mode":0},{"id":"9","type":"SaveImage","properties":{},"pos":[1451,189],"size":[210,313],"inputs":[{"name":"images","type":"IMAGE","link":9}],"outputs":[],"widgets_values":["ComfyUI"],"order":0,"mode":0},{"id":"12","type":"LoraLoader","properties":{"Node name for S&R":"LoraLoader"},"pos":[-26,203],"size":[315,213],"inputs":[{"name":"model","type":"MODEL","link":10},{"name":"clip","type":"CLIP","link":12}],"outputs":[{"name":"MODEL","type":"MODEL","links":[11],"shape":3,"slot_index":0},{"name":"CLIP","type":"CLIP","links":[13,14],"shape":3,"slot_index":1}],"widgets_values":["lcm/SDXL/pytorch_lora_weights.safetensors",1,1],"order":0,"mode":0}],"links":[["2","5",0,"3",3,"LATENT"],["4","6",0,"3",1,"CONDITIONING"],["6","7",0,"3",2,"CONDITIONING"],["7","3",0,"8",0,"LATENT"],["9","8",0,"9",0,"IMAGE"],["10","4",0,"12",0,"MODEL"],["11","12",0,"3",0,"MODEL"],["12","4",1,"12",1,"CLIP"],["13","12",1,"6",0,"CLIP"],["14","12",1,"7",0,"CLIP"],["16","4",2,"8",1,"VAE"]],"groups":[],"version":0,"extra":{"comflowy_version":"0.0.4-alpha"}} \ No newline at end of file diff --git a/apps/electron-frontend/src/components/templates/data/LoRA-workflow.json b/apps/electron-frontend/src/components/templates/data/LoRA-workflow.json index c28d1df0..cdd8cc37 100644 --- a/apps/electron-frontend/src/components/templates/data/LoRA-workflow.json +++ b/apps/electron-frontend/src/components/templates/data/LoRA-workflow.json @@ -1,467 +1 @@ -{ - "last_node_id": 13, - "last_link_id": 15, - "nodes": [ - { - "id": 8, - "type": "VAEDecode", - "pos": [ - 1209, - 188 - ], - "size": { - "0": 210, - "1": 46 - }, - "flags": {}, - "order": 7, - "mode": 0, - "inputs": [ - { - "name": "samples", - "type": "LATENT", - "link": 7 - }, - { - "name": "vae", - "type": "VAE", - "link": 15 - } - ], - "outputs": [ - { - "name": "IMAGE", - "type": "IMAGE", - "links": [ - 9 - ], - "slot_index": 0 - } - ], - "properties": { - "Node name for S&R": "VAEDecode" - } - }, - { - "id": 9, - "type": "SaveImage", - "pos": [ - 1451, - 189 - ], - "size": [ - 210, - 270 - ], - "flags": {}, - "order": 8, - "mode": 0, - "inputs": [ - { - "name": "images", - "type": "IMAGE", - "link": 9 - } - ], - "properties": {}, - "widgets_values": [ - "ComfyUI" - ] - }, - { - "id": 5, - "type": "EmptyLatentImage", - "pos": [ - 472, - 701 - ], - "size": { - "0": 315, - "1": 106 - }, - "flags": {}, - "order": 0, - "mode": 0, - "outputs": [ - { - "name": "LATENT", - "type": "LATENT", - "links": [ - 2 - ], - "slot_index": 0 - } - ], - "properties": { - "Node name for S&R": "EmptyLatentImage" - }, - "widgets_values": [ - 512, - 512, - 1 - ] - }, - { - "id": 7, - "type": "CLIPTextEncode", - "pos": [ - 386, - 395 - ], - "size": { - "0": 425.27801513671875, - "1": 180.6060791015625 - }, - "flags": {}, - "order": 5, - "mode": 0, - "inputs": [ - { - "name": "clip", - "type": "CLIP", - "link": 14 - } - ], - "outputs": [ - { - "name": "CONDITIONING", - "type": "CONDITIONING", - "links": [ - 6 - ], - "slot_index": 0 - } - ], - "properties": { - "Node name for S&R": "CLIPTextEncode" - }, - "widgets_values": [ - "text, watermark" - ] - }, - { - "id": 13, - "type": "VAELoader", - "pos": [ - 866, - 505 - ], - "size": { - "0": 315, - "1": 58 - }, - "flags": {}, - "order": 1, - "mode": 0, - "outputs": [ - { - "name": "VAE", - "type": "VAE", - "links": [ - 15 - ], - "shape": 3, - "slot_index": 0 - } - ], - "properties": { - "Node name for S&R": "VAELoader" - }, - "widgets_values": [ - "OrangeMixs-VAE.pt" - ] - }, - { - "id": 4, - "type": "CheckpointLoaderSimple", - "pos": [ - -411, - 202 - ], - "size": { - "0": 315, - "1": 98 - }, - "flags": {}, - "order": 2, - "mode": 0, - "outputs": [ - { - "name": "MODEL", - "type": "MODEL", - "links": [ - 10 - ], - "slot_index": 0 - }, - { - "name": "CLIP", - "type": "CLIP", - "links": [ - 12 - ], - "slot_index": 1 - }, - { - "name": "VAE", - "type": "VAE", - "links": [], - "slot_index": 2 - } - ], - "properties": { - "Node name for S&R": "CheckpointLoaderSimple" - }, - "widgets_values": [ - "AnythingElse-V4.0.safetensors" - ] - }, - { - "id": 12, - "type": "LoraLoader", - "pos": [ - -26, - 203 - ], - "size": { - "0": 315, - "1": 126 - }, - "flags": {}, - "order": 3, - "mode": 0, - "inputs": [ - { - "name": "model", - "type": "MODEL", - "link": 10 - }, - { - "name": "clip", - "type": "CLIP", - "link": 12 - } - ], - "outputs": [ - { - "name": "MODEL", - "type": "MODEL", - "links": [ - 11 - ], - "shape": 3, - "slot_index": 0 - }, - { - "name": "CLIP", - "type": "CLIP", - "links": [ - 13, - 14 - ], - "shape": 3, - "slot_index": 1 - } - ], - "properties": { - "Node name for S&R": "LoraLoader" - }, - "widgets_values": [ - "Anime-Lineart-LoRA-v3.0.safetensors", - 1, - 1 - ] - }, - { - "id": 3, - "type": "KSampler", - "pos": [ - 863, - 186 - ], - "size": { - "0": 315, - "1": 262 - }, - "flags": {}, - "order": 6, - "mode": 0, - "inputs": [ - { - "name": "model", - "type": "MODEL", - "link": 11 - }, - { - "name": "positive", - "type": "CONDITIONING", - "link": 4 - }, - { - "name": "negative", - "type": "CONDITIONING", - "link": 6 - }, - { - "name": "latent_image", - "type": "LATENT", - "link": 2 - } - ], - "outputs": [ - { - "name": "LATENT", - "type": "LATENT", - "links": [ - 7 - ], - "slot_index": 0 - } - ], - "properties": { - "Node name for S&R": "KSampler" - }, - "widgets_values": [ - 506015807837182, - "randomize", - 20, - 7, - "dpmpp_2m", - "karras", - 1 - ] - }, - { - "id": 6, - "type": "CLIPTextEncode", - "pos": [ - 392, - 186 - ], - "size": { - "0": 422.84503173828125, - "1": 164.31304931640625 - }, - "flags": {}, - "order": 4, - "mode": 0, - "inputs": [ - { - "name": "clip", - "type": "CLIP", - "link": 13 - } - ], - "outputs": [ - { - "name": "CONDITIONING", - "type": "CONDITIONING", - "links": [ - 4 - ], - "slot_index": 0 - } - ], - "properties": { - "Node name for S&R": "CLIPTextEncode" - }, - "widgets_values": [ - "masterpiece, best quality, 1girl, solo, long_hair,\nlooking_at_viewer, smile, bangs, skirt, shirt, long_sleeves, hat,\ndress, bow, holding, closed_mouth, flower, frills, hair_flower,\npetals, bouquet, holding_flower, center_frills, bonnet,\nholding_bouquet, flower field, flower field, lineart, monochrome," - ] - } - ], - "links": [ - [ - 2, - 5, - 0, - 3, - 3, - "LATENT" - ], - [ - 4, - 6, - 0, - 3, - 1, - "CONDITIONING" - ], - [ - 6, - 7, - 0, - 3, - 2, - "CONDITIONING" - ], - [ - 7, - 3, - 0, - 8, - 0, - "LATENT" - ], - [ - 9, - 8, - 0, - 9, - 0, - "IMAGE" - ], - [ - 10, - 4, - 0, - 12, - 0, - "MODEL" - ], - [ - 11, - 12, - 0, - 3, - 0, - "MODEL" - ], - [ - 12, - 4, - 1, - 12, - 1, - "CLIP" - ], - [ - 13, - 12, - 1, - 6, - 0, - "CLIP" - ], - [ - 14, - 12, - 1, - 7, - 0, - "CLIP" - ], - [ - 15, - 13, - 0, - 8, - 1, - "VAE" - ] - ], - "groups": [], - "config": {}, - "extra": {}, - "version": 0.4 -} \ No newline at end of file +{"id":"2d009605-c966-4e51-b041-6d6fd8ac147d","title":"LoRA workflow","nodes":[{"id":"3","type":"KSampler","properties":{"Node name for S&R":"KSampler"},"pos":[863,186],"size":[315,413],"inputs":[{"name":"model","type":"MODEL","link":11},{"name":"positive","type":"CONDITIONING","link":4},{"name":"negative","type":"CONDITIONING","link":6},{"name":"latent_image","type":"LATENT","link":2}],"outputs":[{"name":"LATENT","type":"LATENT","links":[7],"slot_index":0}],"widgets_values":[506015807837182,"randomize",20,7,"dpmpp_2m","karras",1],"order":0,"mode":0},{"id":"4","type":"CheckpointLoaderSimple","properties":{"Node name for S&R":"CheckpointLoaderSimple"},"pos":[-411,202],"size":[315,161],"inputs":[],"outputs":[{"name":"MODEL","type":"MODEL","links":[10],"slot_index":0},{"name":"CLIP","type":"CLIP","links":[12],"slot_index":1},{"name":"VAE","type":"VAE","links":[],"slot_index":2}],"widgets_values":["anythingelseV4_v45.safetensors"],"order":0,"mode":0},{"id":"5","type":"EmptyLatentImage","properties":{"Node name for S&R":"EmptyLatentImage"},"pos":[491.01974965229476,667.715438108484],"size":[315,189],"inputs":[],"outputs":[{"name":"LATENT","type":"LATENT","links":[2],"slot_index":0}],"widgets_values":[512,512,1],"order":0,"mode":0},{"id":"6","type":"CLIPTextEncode","properties":{"Node name for S&R":"CLIPTextEncode"},"pos":[384.0751043115439,95.65618915159942],"size":[423,263],"inputs":[{"name":"clip","type":"CLIP","link":13}],"outputs":[{"name":"CONDITIONING","type":"CONDITIONING","links":[4],"slot_index":0}],"widgets_values":["masterpiece, best quality, 1girl, solo, long_hair,\nlooking_at_viewer, smile, bangs, skirt, shirt, long_sleeves, hat,\ndress, bow, holding, closed_mouth, flower, frills, hair_flower,\npetals, bouquet, holding_flower, center_frills, bonnet,\nholding_bouquet, flower field, flower field, lineart, monochrome,"],"order":0,"mode":0},{"id":"7","type":"CLIPTextEncode","properties":{"Node name for S&R":"CLIPTextEncode"},"pos":[386,395],"size":[425,221],"inputs":[{"name":"clip","type":"CLIP","link":14}],"outputs":[{"name":"CONDITIONING","type":"CONDITIONING","links":[6],"slot_index":0}],"widgets_values":["text, watermark"],"order":0,"mode":0},{"id":"8","type":"VAEDecode","properties":{"Node name for S&R":"VAEDecode"},"pos":[1209,188],"size":[210,99],"inputs":[{"name":"samples","type":"LATENT","link":7},{"name":"vae","type":"VAE","link":15}],"outputs":[{"name":"IMAGE","type":"IMAGE","links":[9],"slot_index":0}],"widgets_values":[],"order":0,"mode":0},{"id":"9","type":"SaveImage","properties":{},"pos":[1451,189],"size":[210,313],"inputs":[{"name":"images","type":"IMAGE","link":9}],"outputs":[],"widgets_values":["ComfyUI"],"order":0,"mode":0},{"id":"12","type":"LoraLoader","properties":{"Node name for S&R":"LoraLoader"},"pos":[-26,203],"size":[315,213],"inputs":[{"name":"model","type":"MODEL","link":10},{"name":"clip","type":"CLIP","link":12}],"outputs":[{"name":"MODEL","type":"MODEL","links":[11],"shape":3,"slot_index":0},{"name":"CLIP","type":"CLIP","links":[13,14],"shape":3,"slot_index":1}],"widgets_values":["animeoutlineV4_16.safetensors",1,1],"order":0,"mode":0},{"id":"13","type":"VAELoader","properties":{"Node name for S&R":"VAELoader"},"pos":[869.1699582753824,642.8931849791377],"size":[315,113],"inputs":[],"outputs":[{"name":"VAE","type":"VAE","links":[15],"shape":3,"slot_index":0}],"widgets_values":["orangemix.vae.pt"],"order":0,"mode":0}],"links":[["2","5",0,"3",3,"LATENT"],["4","6",0,"3",1,"CONDITIONING"],["6","7",0,"3",2,"CONDITIONING"],["7","3",0,"8",0,"LATENT"],["9","8",0,"9",0,"IMAGE"],["10","4",0,"12",0,"MODEL"],["11","12",0,"3",0,"MODEL"],["12","4",1,"12",1,"CLIP"],["13","12",1,"6",0,"CLIP"],["14","12",1,"7",0,"CLIP"],["15","13",0,"8",1,"VAE"]],"groups":[],"version":0,"extra":{"comflowy_version":"0.0.4-alpha"}} \ No newline at end of file diff --git a/apps/electron-frontend/src/components/templates/data/Outpainting-workflow.json b/apps/electron-frontend/src/components/templates/data/Outpainting-workflow.json index b5fd2804..e0611963 100644 --- a/apps/electron-frontend/src/components/templates/data/Outpainting-workflow.json +++ b/apps/electron-frontend/src/components/templates/data/Outpainting-workflow.json @@ -1,507 +1 @@ -{ - "last_node_id": 13, - "last_link_id": 17, - "nodes": [ - { - "id": 4, - "type": "CheckpointLoaderSimple", - "pos": [ - 26, - 474 - ], - "size": { - "0": 315, - "1": 98 - }, - "flags": {}, - "order": 0, - "mode": 0, - "outputs": [ - { - "name": "MODEL", - "type": "MODEL", - "links": [ - 1 - ], - "slot_index": 0 - }, - { - "name": "CLIP", - "type": "CLIP", - "links": [ - 3, - 5 - ], - "slot_index": 1 - }, - { - "name": "VAE", - "type": "VAE", - "links": [ - 8, - 13 - ], - "slot_index": 2 - } - ], - "properties": { - "Node name for S&R": "CheckpointLoaderSimple" - }, - "widgets_values": [ - "DreamShaper-v8.0-Inpainting.safetensors" - ] - }, - { - "id": 3, - "type": "KSampler", - "pos": [ - 863, - 186 - ], - "size": { - "0": 315, - "1": 262 - }, - "flags": {}, - "order": 6, - "mode": 0, - "inputs": [ - { - "name": "model", - "type": "MODEL", - "link": 1 - }, - { - "name": "positive", - "type": "CONDITIONING", - "link": 4 - }, - { - "name": "negative", - "type": "CONDITIONING", - "link": 6 - }, - { - "name": "latent_image", - "type": "LATENT", - "link": 10 - } - ], - "outputs": [ - { - "name": "LATENT", - "type": "LATENT", - "links": [ - 7 - ], - "slot_index": 0 - } - ], - "properties": { - "Node name for S&R": "KSampler" - }, - "widgets_values": [ - 750333344894128, - "randomize", - 20, - 8, - "dpmpp_2m", - "karras", - 0.85 - ] - }, - { - "id": 7, - "type": "CLIPTextEncode", - "pos": [ - 413, - 389 - ], - "size": { - "0": 425.27801513671875, - "1": 180.6060791015625 - }, - "flags": {}, - "order": 3, - "mode": 0, - "inputs": [ - { - "name": "clip", - "type": "CLIP", - "link": 5 - } - ], - "outputs": [ - { - "name": "CONDITIONING", - "type": "CONDITIONING", - "links": [ - 6 - ], - "slot_index": 0 - } - ], - "properties": { - "Node name for S&R": "CLIPTextEncode" - }, - "widgets_values": [ - "blurry, illustration, naked, horror, distorted, wrong hands" - ] - }, - { - "id": 12, - "type": "ImagePadForOutpaint", - "pos": [ - 97, - 733 - ], - "size": { - "0": 315, - "1": 174 - }, - "flags": {}, - "order": 4, - "mode": 0, - "inputs": [ - { - "name": "image", - "type": "IMAGE", - "link": 14 - } - ], - "outputs": [ - { - "name": "IMAGE", - "type": "IMAGE", - "links": [ - 16 - ], - "shape": 3, - "slot_index": 0 - }, - { - "name": "MASK", - "type": "MASK", - "links": [ - 15 - ], - "shape": 3, - "slot_index": 1 - } - ], - "properties": { - "Node name for S&R": "ImagePadForOutpaint" - }, - "widgets_values": [ - 256, - 0, - 0, - 256, - 100 - ] - }, - { - "id": 10, - "type": "VAEEncodeForInpaint", - "pos": [ - 511, - 673 - ], - "size": { - "0": 315, - "1": 98 - }, - "flags": {}, - "order": 5, - "mode": 0, - "inputs": [ - { - "name": "pixels", - "type": "IMAGE", - "link": 16 - }, - { - "name": "vae", - "type": "VAE", - "link": 13 - }, - { - "name": "mask", - "type": "MASK", - "link": 15 - } - ], - "outputs": [ - { - "name": "LATENT", - "type": "LATENT", - "links": [ - 10 - ], - "shape": 3, - "slot_index": 0 - } - ], - "properties": { - "Node name for S&R": "VAEEncodeForInpaint" - }, - "widgets_values": [ - 16 - ] - }, - { - "id": 6, - "type": "CLIPTextEncode", - "pos": [ - 415, - 186 - ], - "size": { - "0": 422.84503173828125, - "1": 164.31304931640625 - }, - "flags": {}, - "order": 2, - "mode": 0, - "inputs": [ - { - "name": "clip", - "type": "CLIP", - "link": 3 - } - ], - "outputs": [ - { - "name": "CONDITIONING", - "type": "CONDITIONING", - "links": [ - 4 - ], - "slot_index": 0 - } - ], - "properties": { - "Node name for S&R": "CLIPTextEncode" - }, - "widgets_values": [ - "a fantastic colorful alien landscape with mountains and valleys with galaxy in the sky" - ] - }, - { - "id": 11, - "type": "LoadImage", - "pos": [ - -305, - 819 - ], - "size": [ - 315, - 314.00000381469727 - ], - "flags": {}, - "order": 1, - "mode": 0, - "outputs": [ - { - "name": "IMAGE", - "type": "IMAGE", - "links": [ - 14 - ], - "shape": 3, - "slot_index": 0 - }, - { - "name": "MASK", - "type": "MASK", - "links": [], - "shape": 3, - "slot_index": 1 - } - ], - "properties": { - "Node name for S&R": "LoadImage" - }, - "widgets_values": [ - "SCR-20231213-qaoj.jpeg", - "image" - ] - }, - { - "id": 8, - "type": "VAEDecode", - "pos": [ - 1209, - 188 - ], - "size": { - "0": 210, - "1": 46 - }, - "flags": {}, - "order": 7, - "mode": 0, - "inputs": [ - { - "name": "samples", - "type": "LATENT", - "link": 7 - }, - { - "name": "vae", - "type": "VAE", - "link": 8 - } - ], - "outputs": [ - { - "name": "IMAGE", - "type": "IMAGE", - "links": [ - 17 - ], - "slot_index": 0 - } - ], - "properties": { - "Node name for S&R": "VAEDecode" - } - }, - { - "id": 13, - "type": "SaveImage", - "pos": [ - 1465, - 185 - ], - "size": { - "0": 315, - "1": 58 - }, - "flags": {}, - "order": 8, - "mode": 0, - "inputs": [ - { - "name": "images", - "type": "IMAGE", - "link": 17 - } - ], - "properties": {}, - "widgets_values": [ - "ComfyUI" - ] - } - ], - "links": [ - [ - 1, - 4, - 0, - 3, - 0, - "MODEL" - ], - [ - 3, - 4, - 1, - 6, - 0, - "CLIP" - ], - [ - 4, - 6, - 0, - 3, - 1, - "CONDITIONING" - ], - [ - 5, - 4, - 1, - 7, - 0, - "CLIP" - ], - [ - 6, - 7, - 0, - 3, - 2, - "CONDITIONING" - ], - [ - 7, - 3, - 0, - 8, - 0, - "LATENT" - ], - [ - 8, - 4, - 2, - 8, - 1, - "VAE" - ], - [ - 10, - 10, - 0, - 3, - 3, - "LATENT" - ], - [ - 13, - 4, - 2, - 10, - 1, - "VAE" - ], - [ - 14, - 11, - 0, - 12, - 0, - "IMAGE" - ], - [ - 15, - 12, - 1, - 10, - 2, - "MASK" - ], - [ - 16, - 12, - 0, - 10, - 0, - "IMAGE" - ], - [ - 17, - 8, - 0, - 13, - 0, - "IMAGE" - ] - ], - "groups": [], - "config": {}, - "extra": {}, - "version": 0.4 -} \ No newline at end of file +{"id":"8c3cab96-fb1f-4198-aa1e-b3ec01de835b","title":"Outpainting workflow","nodes":[{"id":"3","type":"KSampler","properties":{"Node name for S&R":"KSampler"},"pos":[863,186],"size":[315,413],"inputs":[{"name":"model","type":"MODEL","link":1},{"name":"positive","type":"CONDITIONING","link":4},{"name":"negative","type":"CONDITIONING","link":6},{"name":"latent_image","type":"LATENT","link":10}],"outputs":[{"name":"LATENT","type":"LATENT","links":[7],"slot_index":0}],"widgets_values":[750333344894128,"randomize",20,8,"dpmpp_2m","karras",0.85],"order":0,"mode":0},{"id":"4","type":"CheckpointLoaderSimple","properties":{"Node name for S&R":"CheckpointLoaderSimple"},"pos":[8.536802030456869,458.47715736040607],"size":[315,161],"inputs":[],"outputs":[{"name":"MODEL","type":"MODEL","links":[1],"slot_index":0},{"name":"CLIP","type":"CLIP","links":[3,5],"slot_index":1},{"name":"VAE","type":"VAE","links":[8,13],"slot_index":2}],"widgets_values":["DreamShaper-v8.0-Inpainting.safetensors"],"order":0,"mode":0},{"id":"6","type":"CLIPTextEncode","properties":{"Node name for S&R":"CLIPTextEncode"},"pos":[403.35786802030464,125.84898477157358],"size":[423,221],"inputs":[{"name":"clip","type":"CLIP","link":3}],"outputs":[{"name":"CONDITIONING","type":"CONDITIONING","links":[4],"slot_index":0}],"widgets_values":["a fantastic colorful alien landscape with mountains and valleys with galaxy in the sky"],"order":0,"mode":0},{"id":"7","type":"CLIPTextEncode","properties":{"Node name for S&R":"CLIPTextEncode"},"pos":[403.2982233502538,379.2982233502538],"size":[425,221],"inputs":[{"name":"clip","type":"CLIP","link":5}],"outputs":[{"name":"CONDITIONING","type":"CONDITIONING","links":[6],"slot_index":0}],"widgets_values":["blurry, illustration, naked, horror, distorted, wrong hands"],"order":0,"mode":0},{"id":"8","type":"VAEDecode","properties":{"Node name for S&R":"VAEDecode"},"pos":[1209,188],"size":[210,99],"inputs":[{"name":"samples","type":"LATENT","link":7},{"name":"vae","type":"VAE","link":8}],"outputs":[{"name":"IMAGE","type":"IMAGE","links":[17],"slot_index":0}],"widgets_values":[],"order":0,"mode":0},{"id":"10","type":"VAEEncodeForInpaint","properties":{"Node name for S&R":"VAEEncodeForInpaint"},"pos":[511,673],"size":[315,161],"inputs":[{"name":"pixels","type":"IMAGE","link":16},{"name":"vae","type":"VAE","link":13},{"name":"mask","type":"MASK","link":15}],"outputs":[{"name":"LATENT","type":"LATENT","links":[10],"shape":3,"slot_index":0}],"widgets_values":[16],"order":0,"mode":0},{"id":"11","type":"LoadImage","properties":{"Node name for S&R":"LoadImage"},"pos":[-305,819],"size":[313,482],"inputs":[],"outputs":[{"name":"IMAGE","type":"IMAGE","links":[14],"shape":3,"slot_index":0},{"name":"MASK","type":"MASK","links":[],"shape":3,"slot_index":1}],"widgets_values":["ComfyUI_00297_.png",null],"order":0,"mode":0},{"id":"12","type":"ImagePadForOutpaint","properties":{"Node name for S&R":"ImagePadForOutpaint"},"pos":[97,733],"size":[315,289],"inputs":[{"name":"image","type":"IMAGE","link":14}],"outputs":[{"name":"IMAGE","type":"IMAGE","links":[16],"shape":3,"slot_index":0},{"name":"MASK","type":"MASK","links":[15],"shape":3,"slot_index":1}],"widgets_values":[256,0,0,256,100],"order":0,"mode":0},{"id":"13","type":"SaveImage","properties":{},"pos":[1465,185],"size":[315,113],"inputs":[{"name":"images","type":"IMAGE","link":17}],"outputs":[],"widgets_values":["ComfyUI"],"order":0,"mode":0}],"links":[["1","4",0,"3",0,"MODEL"],["3","4",1,"6",0,"CLIP"],["4","6",0,"3",1,"CONDITIONING"],["5","4",1,"7",0,"CLIP"],["6","7",0,"3",2,"CONDITIONING"],["7","3",0,"8",0,"LATENT"],["8","4",2,"8",1,"VAE"],["10","10",0,"3",3,"LATENT"],["13","4",2,"10",1,"VAE"],["14","11",0,"12",0,"IMAGE"],["15","12",1,"10",2,"MASK"],["16","12",0,"10",0,"IMAGE"],["17","8",0,"13",0,"IMAGE"]],"groups":[],"version":0,"extra":{"comflowy_version":"0.0.4-alpha"}} \ No newline at end of file diff --git a/apps/electron-frontend/src/components/templates/data/Pose-ControlNet-workflow.json b/apps/electron-frontend/src/components/templates/data/Pose-ControlNet-workflow.json index 9cd231b6..960344e1 100644 --- a/apps/electron-frontend/src/components/templates/data/Pose-ControlNet-workflow.json +++ b/apps/electron-frontend/src/components/templates/data/Pose-ControlNet-workflow.json @@ -1,648 +1 @@ -{ - "last_node_id": 28, - "last_link_id": 49, - "nodes": [ - { - "id": 4, - "type": "CheckpointLoaderSimple", - "pos": [ - -165, - 43 - ], - "size": { - "0": 340, - "1": 100 - }, - "flags": {}, - "order": 0, - "mode": 0, - "outputs": [ - { - "name": "MODEL", - "type": "MODEL", - "links": [ - 1 - ], - "slot_index": 0 - }, - { - "name": "CLIP", - "type": "CLIP", - "links": [ - 3, - 5 - ], - "slot_index": 1 - }, - { - "name": "VAE", - "type": "VAE", - "links": [ - 48 - ], - "slot_index": 2 - } - ], - "properties": { - "Node name for S&R": "CheckpointLoaderSimple" - }, - "widgets_values": [ - "DreamShaper-v8.0.safetensors" - ] - }, - { - "id": 7, - "type": "CLIPTextEncode", - "pos": [ - 785, - 259 - ], - "size": { - "0": 370, - "1": 160 - }, - "flags": {}, - "order": 5, - "mode": 0, - "inputs": [ - { - "name": "clip", - "type": "CLIP", - "link": 5 - } - ], - "outputs": [ - { - "name": "CONDITIONING", - "type": "CONDITIONING", - "links": [ - 6 - ], - "slot_index": 0 - } - ], - "title": "CLIP Text Encode (Negative)", - "properties": { - "Node name for S&R": "CLIPTextEncode" - }, - "widgets_values": [ - "blurry, painting, drawing, photography, distorted, horror" - ] - }, - { - "id": 6, - "type": "CLIPTextEncode", - "pos": [ - 272, - 38 - ], - "size": { - "0": 370, - "1": 160 - }, - "flags": {}, - "order": 4, - "mode": 0, - "inputs": [ - { - "name": "clip", - "type": "CLIP", - "link": 3 - } - ], - "outputs": [ - { - "name": "CONDITIONING", - "type": "CONDITIONING", - "links": [ - 16 - ], - "slot_index": 0 - } - ], - "title": "CLIP Text Encode (Positive)", - "properties": { - "Node name for S&R": "CLIPTextEncode" - }, - "widgets_values": [ - "masterpiece detailed illustration of a sci-fi battle robot dancing on the street of on an alien planet" - ] - }, - { - "id": 5, - "type": "EmptyLatentImage", - "pos": [ - 929, - 481 - ], - "size": { - "0": 220, - "1": 106 - }, - "flags": {}, - "order": 1, - "mode": 0, - "outputs": [ - { - "name": "LATENT", - "type": "LATENT", - "links": [ - 2 - ], - "slot_index": 0 - } - ], - "properties": { - "Node name for S&R": "EmptyLatentImage" - }, - "widgets_values": [ - 512, - 512, - 1 - ] - }, - { - "id": 14, - "type": "ControlNetLoader", - "pos": [ - 275, - 253 - ], - "size": { - "0": 364.6043701171875, - "1": 85.67654418945312 - }, - "flags": {}, - "order": 2, - "mode": 0, - "outputs": [ - { - "name": "CONTROL_NET", - "type": "CONTROL_NET", - "links": [ - 15 - ], - "shape": 3, - "slot_index": 0 - } - ], - "properties": { - "Node name for S&R": "ControlNetLoader" - }, - "widgets_values": [ - "SD-v1.5-ControlNet-Openpose-fp16.safetensors" - ] - }, - { - "id": 28, - "type": "DWPreprocessor", - "pos": [ - 107, - 451 - ], - "size": { - "0": 307.5301513671875, - "1": 242.49685668945312 - }, - "flags": {}, - "order": 6, - "mode": 0, - "inputs": [ - { - "name": "image", - "type": "IMAGE", - "link": 45 - } - ], - "outputs": [ - { - "name": "IMAGE", - "type": "IMAGE", - "links": [ - 46, - 47 - ], - "shape": 3, - "slot_index": 0 - } - ], - "properties": { - "Node name for S&R": "DWPreprocessor" - }, - "widgets_values": [ - "disable", - "enable", - "disable", - 512, - "yolox_l.onnx", - "dw-ll_ucoco_384.onnx" - ] - }, - { - "id": 24, - "type": "ImageScale", - "pos": [ - 509, - 430 - ], - "size": { - "0": 210, - "1": 130 - }, - "flags": {}, - "order": 7, - "mode": 0, - "inputs": [ - { - "name": "image", - "type": "IMAGE", - "link": 46 - } - ], - "outputs": [ - { - "name": "IMAGE", - "type": "IMAGE", - "links": [ - 49 - ], - "shape": 3, - "slot_index": 0 - } - ], - "properties": { - "Node name for S&R": "ImageScale" - }, - "widgets_values": [ - "nearest-exact", - 512, - 512, - "disabled" - ] - }, - { - "id": 17, - "type": "PreviewImage", - "pos": [ - 512, - 619 - ], - "size": { - "0": 204.3481903076172, - "1": 246 - }, - "flags": {}, - "order": 8, - "mode": 0, - "inputs": [ - { - "name": "images", - "type": "IMAGE", - "link": 47 - } - ], - "properties": { - "Node name for S&R": "PreviewImage" - } - }, - { - "id": 12, - "type": "LoadImage", - "pos": [ - -163, - 472 - ], - "size": { - "0": 210, - "1": 314 - }, - "flags": {}, - "order": 3, - "mode": 0, - "outputs": [ - { - "name": "IMAGE", - "type": "IMAGE", - "links": [ - 45 - ], - "shape": 3, - "slot_index": 0 - }, - { - "name": "MASK", - "type": "MASK", - "links": null, - "shape": 3 - } - ], - "properties": { - "Node name for S&R": "LoadImage" - }, - "widgets_values": [ - "cwf_dance.jpg", - "image" - ] - }, - { - "id": 16, - "type": "ControlNetApply", - "pos": [ - 778, - 76 - ], - "size": { - "0": 211.60000610351562, - "1": 100 - }, - "flags": {}, - "order": 9, - "mode": 0, - "inputs": [ - { - "name": "conditioning", - "type": "CONDITIONING", - "link": 16 - }, - { - "name": "control_net", - "type": "CONTROL_NET", - "link": 15 - }, - { - "name": "image", - "type": "IMAGE", - "link": 49 - } - ], - "outputs": [ - { - "name": "CONDITIONING", - "type": "CONDITIONING", - "links": [ - 17 - ], - "shape": 3, - "slot_index": 0 - } - ], - "properties": { - "Node name for S&R": "ControlNetApply" - }, - "widgets_values": [ - 0.8999999999999999 - ] - }, - { - "id": 3, - "type": "KSampler", - "pos": [ - 1205, - 174 - ], - "size": { - "0": 300, - "1": 262 - }, - "flags": {}, - "order": 10, - "mode": 0, - "inputs": [ - { - "name": "model", - "type": "MODEL", - "link": 1 - }, - { - "name": "positive", - "type": "CONDITIONING", - "link": 17 - }, - { - "name": "negative", - "type": "CONDITIONING", - "link": 6 - }, - { - "name": "latent_image", - "type": "LATENT", - "link": 2 - } - ], - "outputs": [ - { - "name": "LATENT", - "type": "LATENT", - "links": [ - 7 - ], - "slot_index": 0 - } - ], - "properties": { - "Node name for S&R": "KSampler" - }, - "widgets_values": [ - 757125948756855, - "randomize", - 20, - 7, - "dpmpp_2m", - "karras", - 1 - ] - }, - { - "id": 8, - "type": "VAEDecode", - "pos": [ - 1540, - 165 - ], - "size": { - "0": 140, - "1": 60 - }, - "flags": {}, - "order": 11, - "mode": 0, - "inputs": [ - { - "name": "samples", - "type": "LATENT", - "link": 7 - }, - { - "name": "vae", - "type": "VAE", - "link": 48 - } - ], - "outputs": [ - { - "name": "IMAGE", - "type": "IMAGE", - "links": [ - 9 - ], - "slot_index": 0 - } - ], - "properties": { - "Node name for S&R": "VAEDecode" - } - }, - { - "id": 9, - "type": "SaveImage", - "pos": [ - 1716, - 169 - ], - "size": { - "0": 410, - "1": 460 - }, - "flags": {}, - "order": 12, - "mode": 0, - "inputs": [ - { - "name": "images", - "type": "IMAGE", - "link": 9 - } - ], - "properties": {}, - "widgets_values": [ - "Result" - ] - } - ], - "links": [ - [ - 1, - 4, - 0, - 3, - 0, - "MODEL" - ], - [ - 2, - 5, - 0, - 3, - 3, - "LATENT" - ], - [ - 3, - 4, - 1, - 6, - 0, - "CLIP" - ], - [ - 5, - 4, - 1, - 7, - 0, - "CLIP" - ], - [ - 6, - 7, - 0, - 3, - 2, - "CONDITIONING" - ], - [ - 7, - 3, - 0, - 8, - 0, - "LATENT" - ], - [ - 9, - 8, - 0, - 9, - 0, - "IMAGE" - ], - [ - 15, - 14, - 0, - 16, - 1, - "CONTROL_NET" - ], - [ - 16, - 6, - 0, - 16, - 0, - "CONDITIONING" - ], - [ - 17, - 16, - 0, - 3, - 1, - "CONDITIONING" - ], - [ - 45, - 12, - 0, - 28, - 0, - "IMAGE" - ], - [ - 46, - 28, - 0, - 24, - 0, - "IMAGE" - ], - [ - 47, - 28, - 0, - 17, - 0, - "IMAGE" - ], - [ - 48, - 4, - 2, - 8, - 1, - "VAE" - ], - [ - 49, - 24, - 0, - 16, - 2, - "IMAGE" - ] - ], - "groups": [], - "config": {}, - "extra": {}, - "version": 0.4 -} \ No newline at end of file +{"id":"986942ff-32de-400d-a5fb-db80ec2f852f","title":"Pose ControlNet workflow","nodes":[{"id":"3","type":"KSampler","properties":{"Node name for S&R":"KSampler"},"pos":[1205,174],"size":[300,413],"inputs":[{"name":"model","type":"MODEL","link":1},{"name":"positive","type":"CONDITIONING","link":17},{"name":"negative","type":"CONDITIONING","link":6},{"name":"latent_image","type":"LATENT","link":2}],"outputs":[{"name":"LATENT","type":"LATENT","links":[7],"slot_index":0}],"widgets_values":[757125948756855,"randomize",20,7,"dpmpp_2m","karras",1],"order":0,"mode":0},{"id":"4","type":"CheckpointLoaderSimple","properties":{"Node name for S&R":"CheckpointLoaderSimple"},"pos":[-220.43367174280888,-214.979780033841],"size":[340,161],"inputs":[],"outputs":[{"name":"MODEL","type":"MODEL","links":[1],"slot_index":0},{"name":"CLIP","type":"CLIP","links":[3,5],"slot_index":1},{"name":"VAE","type":"VAE","links":[48],"slot_index":2}],"widgets_values":["DreamShaper-v8.0.safetensors"],"order":0,"mode":0},{"id":"5","type":"EmptyLatentImage","properties":{"Node name for S&R":"EmptyLatentImage"},"pos":[929,481],"size":[220,189],"inputs":[],"outputs":[{"name":"LATENT","type":"LATENT","links":[2],"slot_index":0}],"widgets_values":[512,512,1],"order":0,"mode":0},{"id":"6","type":"CLIPTextEncode","title":"CLIP Text Encode (Positive)","properties":{"Node name for S&R":"CLIPTextEncode"},"pos":[193.1136209813875,-226.375972927242],"size":[370,221],"inputs":[{"name":"clip","type":"CLIP","link":3}],"outputs":[{"name":"CONDITIONING","type":"CONDITIONING","links":[16],"slot_index":0}],"widgets_values":["masterpiece detailed illustration of a sci-fi battle robot dancing on the street of on an alien planet"],"order":0,"mode":0},{"id":"7","type":"CLIPTextEncode","title":"CLIP Text Encode (Negative)","properties":{"Node name for S&R":"CLIPTextEncode"},"pos":[782.8679357021997,233.41522842639594],"size":[370,221],"inputs":[{"name":"clip","type":"CLIP","link":5}],"outputs":[{"name":"CONDITIONING","type":"CONDITIONING","links":[6],"slot_index":0}],"widgets_values":["blurry, painting, drawing, photography, distorted, horror"],"order":0,"mode":0},{"id":"8","type":"VAEDecode","properties":{"Node name for S&R":"VAEDecode"},"pos":[1540,177.79238578680201],"size":[140,99],"inputs":[{"name":"samples","type":"LATENT","link":7},{"name":"vae","type":"VAE","link":48}],"outputs":[{"name":"IMAGE","type":"IMAGE","links":[9],"slot_index":0}],"widgets_values":[],"order":0,"mode":0},{"id":"9","type":"SaveImage","properties":{},"pos":[1773.565736040609,179.6603214890017],"size":[410,460],"inputs":[{"name":"images","type":"IMAGE","link":9}],"outputs":[],"widgets_values":["Result"],"order":0,"mode":0},{"id":"12","type":"LoadImage","properties":{"Node name for S&R":"LoadImage"},"pos":[-43.60439932318104,186.30338409475465],"size":[210,345],"inputs":[],"outputs":[{"name":"IMAGE","type":"IMAGE","links":[45],"shape":3,"slot_index":0},{"name":"MASK","type":"MASK","links":null,"shape":3}],"widgets_values":["cwf_dance.jpg",null],"order":0,"mode":0},{"id":"14","type":"ControlNetLoader","properties":{"Node name for S&R":"ControlNetLoader"},"pos":[481.8102368866329,31.265313028764808],"size":[365,113],"inputs":[],"outputs":[{"name":"CONTROL_NET","type":"CONTROL_NET","links":[15],"shape":3,"slot_index":0}],"widgets_values":["SD-v1.5-ControlNet-Openpose-fp16.safetensors"],"order":0,"mode":0},{"id":"16","type":"ControlNetApply","properties":{"Node name for S&R":"ControlNetApply"},"pos":[927.2445008460235,39.75490693739425],"size":[212,161],"inputs":[{"name":"conditioning","type":"CONDITIONING","link":16},{"name":"control_net","type":"CONTROL_NET","link":15},{"name":"image","type":"IMAGE","link":49}],"outputs":[{"name":"CONDITIONING","type":"CONDITIONING","links":[17],"shape":3,"slot_index":0}],"widgets_values":[0.8999999999999999],"order":0,"mode":0},{"id":"17","type":"PreviewImage","properties":{"Node name for S&R":"PreviewImage"},"pos":[492.81142131979686,181.92681895093062],"size":[204,246],"inputs":[{"name":"images","type":"IMAGE","link":47}],"outputs":[],"widgets_values":[],"order":0,"mode":0},{"id":"24","type":"ImageScale","properties":{"Node name for S&R":"ImageScale"},"pos":[634.79179357022,-228.80786802030468],"size":[210,227],"inputs":[{"name":"image","type":"IMAGE","link":46}],"outputs":[{"name":"IMAGE","type":"IMAGE","links":[49],"shape":3,"slot_index":0}],"widgets_values":["nearest-exact",512,512,"disabled"],"order":0,"mode":0},{"id":"28","type":"DWPreprocessor","properties":{"Node name for S&R":"DWPreprocessor"},"pos":[198.67876480541457,182.35989847715732],"size":[240,75],"inputs":[{"name":"image","type":"IMAGE","link":45}],"outputs":[{"name":"IMAGE","type":"IMAGE","links":[46,47],"shape":3,"slot_index":0}],"widgets_values":[],"order":0,"mode":0}],"links":[["1","4",0,"3",0,"MODEL"],["2","5",0,"3",3,"LATENT"],["3","4",1,"6",0,"CLIP"],["5","4",1,"7",0,"CLIP"],["6","7",0,"3",2,"CONDITIONING"],["7","3",0,"8",0,"LATENT"],["9","8",0,"9",0,"IMAGE"],["15","14",0,"16",1,"CONTROL_NET"],["16","6",0,"16",0,"CONDITIONING"],["17","16",0,"3",1,"CONDITIONING"],["45","12",0,"28",0,"IMAGE"],["46","28",0,"24",0,"IMAGE"],["47","28",0,"17",0,"IMAGE"],["48","4",2,"8",1,"VAE"],["49","24",0,"16",2,"IMAGE"]],"groups":[],"version":0,"extra":{"comflowy_version":"0.0.4-alpha"}} \ No newline at end of file diff --git a/apps/electron-frontend/src/components/templates/data/SDXL-prompt-styler-workflow.json b/apps/electron-frontend/src/components/templates/data/SDXL-prompt-styler-workflow.json index db9f355d..fed6fb15 100644 --- a/apps/electron-frontend/src/components/templates/data/SDXL-prompt-styler-workflow.json +++ b/apps/electron-frontend/src/components/templates/data/SDXL-prompt-styler-workflow.json @@ -1,442 +1 @@ -{ - "last_node_id": 13, - "last_link_id": 13, - "nodes": [ - { - "id": 8, - "type": "VAEDecode", - "pos": [ - 1209, - 188 - ], - "size": { - "0": 210, - "1": 46 - }, - "flags": {}, - "order": 6, - "mode": 0, - "inputs": [ - { - "name": "samples", - "type": "LATENT", - "link": 7 - }, - { - "name": "vae", - "type": "VAE", - "link": 8 - } - ], - "outputs": [ - { - "name": "IMAGE", - "type": "IMAGE", - "links": [ - 9 - ], - "slot_index": 0 - } - ], - "properties": { - "Node name for S&R": "VAEDecode" - } - }, - { - "id": 9, - "type": "SaveImage", - "pos": [ - 1451, - 189 - ], - "size": [ - 210, - 270 - ], - "flags": {}, - "order": 7, - "mode": 0, - "inputs": [ - { - "name": "images", - "type": "IMAGE", - "link": 9 - } - ], - "properties": {}, - "widgets_values": [ - "ComfyUI" - ] - }, - { - "id": 3, - "type": "KSampler", - "pos": [ - 863, - 186 - ], - "size": { - "0": 315, - "1": 262 - }, - "flags": {}, - "order": 5, - "mode": 0, - "inputs": [ - { - "name": "model", - "type": "MODEL", - "link": 1 - }, - { - "name": "positive", - "type": "CONDITIONING", - "link": 4 - }, - { - "name": "negative", - "type": "CONDITIONING", - "link": 6 - }, - { - "name": "latent_image", - "type": "LATENT", - "link": 2 - } - ], - "outputs": [ - { - "name": "LATENT", - "type": "LATENT", - "links": [ - 7 - ], - "slot_index": 0 - } - ], - "properties": { - "Node name for S&R": "KSampler" - }, - "widgets_values": [ - 882380300250500, - "randomize", - 20, - 8, - "dpmpp_2m", - "karras", - 1 - ] - }, - { - "id": 4, - "type": "CheckpointLoaderSimple", - "pos": [ - -44, - 261 - ], - "size": { - "0": 315, - "1": 98 - }, - "flags": {}, - "order": 0, - "mode": 0, - "outputs": [ - { - "name": "MODEL", - "type": "MODEL", - "links": [ - 1 - ], - "slot_index": 0 - }, - { - "name": "CLIP", - "type": "CLIP", - "links": [ - 3, - 5 - ], - "slot_index": 1 - }, - { - "name": "VAE", - "type": "VAE", - "links": [ - 8 - ], - "slot_index": 2 - } - ], - "properties": { - "Node name for S&R": "CheckpointLoaderSimple" - }, - "widgets_values": [ - "AnythingElse-V4.0.safetensors" - ] - }, - { - "id": 5, - "type": "EmptyLatentImage", - "pos": [ - 443, - 501 - ], - "size": { - "0": 315, - "1": 106 - }, - "flags": {}, - "order": 1, - "mode": 0, - "outputs": [ - { - "name": "LATENT", - "type": "LATENT", - "links": [ - 2 - ], - "slot_index": 0 - } - ], - "properties": { - "Node name for S&R": "EmptyLatentImage" - }, - "widgets_values": [ - 512, - 512, - 1 - ] - }, - { - "id": 10, - "type": "SDXLPromptStyler", - "pos": [ - -48, - 505 - ], - "size": { - "0": 400, - "1": 200 - }, - "flags": {}, - "order": 2, - "mode": 0, - "outputs": [ - { - "name": "text_positive", - "type": "STRING", - "links": [ - 13 - ], - "shape": 3, - "slot_index": 0 - }, - { - "name": "text_negative", - "type": "STRING", - "links": [ - 12 - ], - "shape": 3, - "slot_index": 1 - } - ], - "properties": { - "Node name for S&R": "SDXLPromptStyler" - }, - "widgets_values": [ - "cat, standing on the castle", - "text, watermark", - "game-gta", - true - ] - }, - { - "id": 6, - "type": "CLIPTextEncode", - "pos": [ - 434, - 239 - ], - "size": [ - 316.5625, - 68.34375 - ], - "flags": {}, - "order": 3, - "mode": 0, - "inputs": [ - { - "name": "clip", - "type": "CLIP", - "link": 3 - }, - { - "name": "text", - "type": "STRING", - "link": 13, - "widget": { - "name": "text" - } - } - ], - "outputs": [ - { - "name": "CONDITIONING", - "type": "CONDITIONING", - "links": [ - 4 - ], - "slot_index": 0 - } - ], - "properties": { - "Node name for S&R": "CLIPTextEncode" - }, - "widgets_values": [ - "" - ] - }, - { - "id": 7, - "type": "CLIPTextEncode", - "pos": [ - 437, - 365 - ], - "size": [ - 313.12109375, - 54 - ], - "flags": {}, - "order": 4, - "mode": 0, - "inputs": [ - { - "name": "clip", - "type": "CLIP", - "link": 5 - }, - { - "name": "text", - "type": "STRING", - "link": 12, - "widget": { - "name": "text" - } - } - ], - "outputs": [ - { - "name": "CONDITIONING", - "type": "CONDITIONING", - "links": [ - 6 - ], - "slot_index": 0 - } - ], - "properties": { - "Node name for S&R": "CLIPTextEncode" - }, - "widgets_values": [ - "text, watermark" - ] - } - ], - "links": [ - [ - 1, - 4, - 0, - 3, - 0, - "MODEL" - ], - [ - 2, - 5, - 0, - 3, - 3, - "LATENT" - ], - [ - 3, - 4, - 1, - 6, - 0, - "CLIP" - ], - [ - 4, - 6, - 0, - 3, - 1, - "CONDITIONING" - ], - [ - 5, - 4, - 1, - 7, - 0, - "CLIP" - ], - [ - 6, - 7, - 0, - 3, - 2, - "CONDITIONING" - ], - [ - 7, - 3, - 0, - 8, - 0, - "LATENT" - ], - [ - 8, - 4, - 2, - 8, - 1, - "VAE" - ], - [ - 9, - 8, - 0, - 9, - 0, - "IMAGE" - ], - [ - 12, - 10, - 1, - 7, - 1, - "STRING" - ], - [ - 13, - 10, - 0, - 6, - 1, - "STRING" - ] - ], - "groups": [], - "config": {}, - "extra": {}, - "version": 0.4 -} \ No newline at end of file +{"id":"197f6593-ca05-48fa-9696-2cdca1f93086","title":"SDXL prompt styler workflow","nodes":[{"id":"3","type":"KSampler","properties":{"Node name for S&R":"KSampler"},"pos":[863,186],"size":[315,413],"inputs":[{"name":"model","type":"MODEL","link":1},{"name":"positive","type":"CONDITIONING","link":4},{"name":"negative","type":"CONDITIONING","link":6},{"name":"latent_image","type":"LATENT","link":2}],"outputs":[{"name":"LATENT","type":"LATENT","links":[7],"slot_index":0}],"widgets_values":[882380300250500,"randomize",20,8,"dpmpp_2m","karras",1],"order":0,"mode":0},{"id":"4","type":"CheckpointLoaderSimple","properties":{"Node name for S&R":"CheckpointLoaderSimple"},"pos":[18.02715736040608,232.3720812182741],"size":[315,161],"inputs":[],"outputs":[{"name":"MODEL","type":"MODEL","links":[1],"slot_index":0},{"name":"CLIP","type":"CLIP","links":[3,5],"slot_index":1},{"name":"VAE","type":"VAE","links":[8],"slot_index":2}],"widgets_values":["AnythingElse-V4.0.safetensors"],"order":0,"mode":0},{"id":"5","type":"EmptyLatentImage","properties":{"Node name for S&R":"EmptyLatentImage"},"pos":[435.0478003384095,488.27648054145516],"size":[315,189],"inputs":[],"outputs":[{"name":"LATENT","type":"LATENT","links":[2],"slot_index":0}],"widgets_values":[512,512,1],"order":0,"mode":0},{"id":"6","type":"CLIPTextEncode","properties":{"Node name for S&R":"CLIPTextEncode"},"pos":[434,239],"size":[317,99],"inputs":[{"name":"clip","type":"CLIP","link":3},{"name":"text","type":"STRING","link":13,"widget":{"name":"text"}}],"outputs":[{"name":"CONDITIONING","type":"CONDITIONING","links":[4],"slot_index":0}],"widgets_values":[],"order":0,"mode":0},{"id":"7","type":"CLIPTextEncode","properties":{"Node name for S&R":"CLIPTextEncode"},"pos":[437,365],"size":[313,99],"inputs":[{"name":"clip","type":"CLIP","link":5},{"name":"text","type":"STRING","link":12,"widget":{"name":"text"}}],"outputs":[{"name":"CONDITIONING","type":"CONDITIONING","links":[6],"slot_index":0}],"widgets_values":[],"order":0,"mode":0},{"id":"8","type":"VAEDecode","properties":{"Node name for S&R":"VAEDecode"},"pos":[1209,188],"size":[210,99],"inputs":[{"name":"samples","type":"LATENT","link":7},{"name":"vae","type":"VAE","link":8}],"outputs":[{"name":"IMAGE","type":"IMAGE","links":[9],"slot_index":0}],"widgets_values":[],"order":0,"mode":0},{"id":"9","type":"SaveImage","properties":{},"pos":[1451,189],"size":[210,270],"inputs":[{"name":"images","type":"IMAGE","link":9}],"outputs":[],"widgets_values":["ComfyUI"],"order":0,"mode":0},{"id":"10","type":"SDXLPromptStyler","properties":{"Node name for S&R":"SDXLPromptStyler"},"pos":[-68.67571912013534,422.2971235194585],"size":[400,510],"inputs":[],"outputs":[{"name":"text_positive","type":"STRING","links":[13],"shape":3,"slot_index":0},{"name":"text_negative","type":"STRING","links":[12],"shape":3,"slot_index":1}],"widgets_values":[null,null,null,null,null,null],"order":0,"mode":0}],"links":[["1","4",0,"3",0,"MODEL"],["2","5",0,"3",3,"LATENT"],["3","4",1,"6",0,"CLIP"],["4","6",0,"3",1,"CONDITIONING"],["5","4",1,"7",0,"CLIP"],["6","7",0,"3",2,"CONDITIONING"],["7","3",0,"8",0,"LATENT"],["8","4",2,"8",1,"VAE"],["9","8",0,"9",0,"IMAGE"],["12","10",1,"7",1,"STRING"],["13","10",0,"6",1,"STRING"]],"groups":[],"version":0,"extra":{"comflowy_version":"0.0.4-alpha"}} \ No newline at end of file diff --git a/apps/electron-frontend/src/components/templates/data/Scribble-ControlNet-workflow.json b/apps/electron-frontend/src/components/templates/data/Scribble-ControlNet-workflow.json index 53dcd67f..de5e8142 100644 --- a/apps/electron-frontend/src/components/templates/data/Scribble-ControlNet-workflow.json +++ b/apps/electron-frontend/src/components/templates/data/Scribble-ControlNet-workflow.json @@ -1,506 +1 @@ -{ - "last_node_id": 14, - "last_link_id": 22, - "nodes": [ - { - "id": 8, - "type": "VAEDecode", - "pos": [ - 1210, - 250 - ], - "size": { - "0": 210, - "1": 46 - }, - "flags": {}, - "order": 8, - "mode": 0, - "inputs": [ - { - "name": "samples", - "type": "LATENT", - "link": 7 - }, - { - "name": "vae", - "type": "VAE", - "link": 22 - } - ], - "outputs": [ - { - "name": "IMAGE", - "type": "IMAGE", - "links": [ - 9 - ], - "slot_index": 0 - } - ], - "properties": { - "Node name for S&R": "VAEDecode" - } - }, - { - "id": 7, - "type": "CLIPTextEncode", - "pos": [ - 355, - 213 - ], - "size": { - "0": 425.27801513671875, - "1": 180.6060791015625 - }, - "flags": {}, - "order": 4, - "mode": 0, - "inputs": [ - { - "name": "clip", - "type": "CLIP", - "link": 20 - } - ], - "outputs": [ - { - "name": "CONDITIONING", - "type": "CONDITIONING", - "links": [ - 16 - ], - "slot_index": 0 - } - ], - "properties": { - "Node name for S&R": "CLIPTextEncode" - }, - "widgets_values": [ - "(hands), text, error, cropped, (worst quality:1.2), (low quality:1.2), normal quality, (jpeg artifacts:1.3), signature, watermark, username, blurry, artist name, monochrome, sketch, censorship, censor, (copyright:1.2), extra legs, (forehead mark) (depth of field) (emotionless) (penis)" - ] - }, - { - "id": 5, - "type": "EmptyLatentImage", - "pos": [ - 439, - 446 - ], - "size": { - "0": 315, - "1": 106 - }, - "flags": {}, - "order": 0, - "mode": 0, - "outputs": [ - { - "name": "LATENT", - "type": "LATENT", - "links": [ - 2 - ], - "slot_index": 0 - } - ], - "properties": { - "Node name for S&R": "EmptyLatentImage" - }, - "widgets_values": [ - 512, - 512, - 1 - ] - }, - { - "id": 9, - "type": "SaveImage", - "pos": [ - 1453, - 247 - ], - "size": { - "0": 393.6202087402344, - "1": 449.1610107421875 - }, - "flags": {}, - "order": 9, - "mode": 0, - "inputs": [ - { - "name": "images", - "type": "IMAGE", - "link": 9 - } - ], - "properties": {}, - "widgets_values": [ - "ComfyUI" - ] - }, - { - "id": 6, - "type": "CLIPTextEncode", - "pos": [ - -42, - -147 - ], - "size": { - "0": 422.84503173828125, - "1": 164.31304931640625 - }, - "flags": {}, - "order": 5, - "mode": 0, - "inputs": [ - { - "name": "clip", - "type": "CLIP", - "link": 21 - } - ], - "outputs": [ - { - "name": "CONDITIONING", - "type": "CONDITIONING", - "links": [ - 10 - ], - "slot_index": 0 - } - ], - "properties": { - "Node name for S&R": "CLIPTextEncode" - }, - "widgets_values": [ - "(solo) girl (flat chest:0.9), (fennec ears:1.1)  (fox ears:1.1), (blonde hair:1.0), messy hair, sky clouds, standing in a grass field, (chibi), blue eyes" - ] - }, - { - "id": 11, - "type": "LoadImage", - "pos": [ - -54, - 192 - ], - "size": { - "0": 387.97003173828125, - "1": 465.5097961425781 - }, - "flags": {}, - "order": 1, - "mode": 0, - "outputs": [ - { - "name": "IMAGE", - "type": "IMAGE", - "links": [ - 12 - ], - "slot_index": 0 - }, - { - "name": "MASK", - "type": "MASK", - "links": null - } - ], - "properties": { - "Node name for S&R": "LoadImage" - }, - "widgets_values": [ - "input_scribble_example.png", - "image" - ] - }, - { - "id": 3, - "type": "KSampler", - "pos": [ - 842, - 150 - ], - "size": { - "0": 315, - "1": 262 - }, - "flags": {}, - "order": 7, - "mode": 0, - "inputs": [ - { - "name": "model", - "type": "MODEL", - "link": 19 - }, - { - "name": "positive", - "type": "CONDITIONING", - "link": 18 - }, - { - "name": "negative", - "type": "CONDITIONING", - "link": 16 - }, - { - "name": "latent_image", - "type": "LATENT", - "link": 2 - } - ], - "outputs": [ - { - "name": "LATENT", - "type": "LATENT", - "links": [ - 7 - ], - "slot_index": 0 - } - ], - "properties": { - "Node name for S&R": "KSampler" - }, - "widgets_values": [ - 1002496614778823, - "randomize", - 16, - 6, - "dpmpp_2m", - "karras", - 1 - ] - }, - { - "id": 14, - "type": "CheckpointLoaderSimple", - "pos": [ - -448, - 231 - ], - "size": { - "0": 315, - "1": 98 - }, - "flags": {}, - "order": 2, - "mode": 0, - "outputs": [ - { - "name": "MODEL", - "type": "MODEL", - "links": [ - 19 - ], - "slot_index": 0 - }, - { - "name": "CLIP", - "type": "CLIP", - "links": [ - 20, - 21 - ], - "slot_index": 1 - }, - { - "name": "VAE", - "type": "VAE", - "links": [ - 22 - ], - "slot_index": 2 - } - ], - "properties": { - "Node name for S&R": "CheckpointLoaderSimple" - }, - "widgets_values": [ - "AnythingElse-V4.0.safetensors" - ] - }, - { - "id": 12, - "type": "ControlNetLoader", - "pos": [ - -50, - 69 - ], - "size": { - "0": 422, - "1": 58 - }, - "flags": {}, - "order": 3, - "mode": 0, - "outputs": [ - { - "name": "CONTROL_NET", - "type": "CONTROL_NET", - "links": [ - 13 - ], - "slot_index": 0 - } - ], - "properties": { - "Node name for S&R": "ControlNetLoader" - }, - "widgets_values": [ - "control_scribble.safetensors" - ] - }, - { - "id": 10, - "type": "ControlNetApply", - "pos": [ - 459, - 51 - ], - "size": { - "0": 317.4000244140625, - "1": 98 - }, - "flags": {}, - "order": 6, - "mode": 0, - "inputs": [ - { - "name": "conditioning", - "type": "CONDITIONING", - "link": 10 - }, - { - "name": "control_net", - "type": "CONTROL_NET", - "link": 13 - }, - { - "name": "image", - "type": "IMAGE", - "link": 12 - } - ], - "outputs": [ - { - "name": "CONDITIONING", - "type": "CONDITIONING", - "links": [ - 18 - ], - "slot_index": 0 - } - ], - "properties": { - "Node name for S&R": "ControlNetApply" - }, - "widgets_values": [ - 0.8999999999999999 - ] - } - ], - "links": [ - [ - 2, - 5, - 0, - 3, - 3, - "LATENT" - ], - [ - 7, - 3, - 0, - 8, - 0, - "LATENT" - ], - [ - 9, - 8, - 0, - 9, - 0, - "IMAGE" - ], - [ - 10, - 6, - 0, - 10, - 0, - "CONDITIONING" - ], - [ - 12, - 11, - 0, - 10, - 2, - "IMAGE" - ], - [ - 13, - 12, - 0, - 10, - 1, - "CONTROL_NET" - ], - [ - 16, - 7, - 0, - 3, - 2, - "CONDITIONING" - ], - [ - 18, - 10, - 0, - 3, - 1, - "CONDITIONING" - ], - [ - 19, - 14, - 0, - 3, - 0, - "MODEL" - ], - [ - 20, - 14, - 1, - 7, - 0, - "CLIP" - ], - [ - 21, - 14, - 1, - 6, - 0, - "CLIP" - ], - [ - 22, - 14, - 2, - 8, - 1, - "VAE" - ] - ], - "groups": [], - "config": {}, - "extra": {}, - "version": 0.4 -} \ No newline at end of file +{"id":"8d839df7-2a14-478d-934d-d6990d635446","title":"Scribble ControlNet workflow","nodes":[{"id":"3","type":"KSampler","properties":{"Node name for S&R":"KSampler"},"pos":[842,150],"size":[315,413],"inputs":[{"name":"model","type":"MODEL","link":19},{"name":"positive","type":"CONDITIONING","link":18},{"name":"negative","type":"CONDITIONING","link":16},{"name":"latent_image","type":"LATENT","link":2}],"outputs":[{"name":"LATENT","type":"LATENT","links":[7],"slot_index":0}],"widgets_values":[1002496614778823,"randomize",16,6,"dpmpp_2m","karras",1],"order":0,"mode":0},{"id":"5","type":"EmptyLatentImage","properties":{"Node name for S&R":"EmptyLatentImage"},"pos":[464.6294416243654,433.18527918781723],"size":[315,189],"inputs":[],"outputs":[{"name":"LATENT","type":"LATENT","links":[2],"slot_index":0}],"widgets_values":[512,512,1],"order":0,"mode":0},{"id":"6","type":"CLIPTextEncode","properties":{"Node name for S&R":"CLIPTextEncode"},"pos":[-93.25888324873091,-200.39467005076142],"size":[423,221],"inputs":[{"name":"clip","type":"CLIP","link":21}],"outputs":[{"name":"CONDITIONING","type":"CONDITIONING","links":[10],"slot_index":0}],"widgets_values":["(solo) girl (flat chest:0.9), (fennec ears:1.1)  (fox ears:1.1), (blonde hair:1.0), messy hair, sky clouds, standing in a grass field, (chibi), blue eyes"],"order":0,"mode":0},{"id":"7","type":"CLIPTextEncode","properties":{"Node name for S&R":"CLIPTextEncode"},"pos":[357.13578680203045,189.50634517766497],"size":[425,221],"inputs":[{"name":"clip","type":"CLIP","link":20}],"outputs":[{"name":"CONDITIONING","type":"CONDITIONING","links":[16],"slot_index":0}],"widgets_values":["(hands), text, error, cropped, (worst quality:1.2), (low quality:1.2), normal quality, (jpeg artifacts:1.3), signature, watermark, username, blurry, artist name, monochrome, sketch, censorship, censor, (copyright:1.2), extra legs, (forehead mark) (depth of field) (emotionless) (penis)"],"order":0,"mode":0},{"id":"8","type":"VAEDecode","properties":{"Node name for S&R":"VAEDecode"},"pos":[1210,250],"size":[210,99],"inputs":[{"name":"samples","type":"LATENT","link":7},{"name":"vae","type":"VAE","link":22}],"outputs":[{"name":"IMAGE","type":"IMAGE","links":[9],"slot_index":0}],"widgets_values":[],"order":0,"mode":0},{"id":"9","type":"SaveImage","properties":{},"pos":[1453,247],"size":[394,449],"inputs":[{"name":"images","type":"IMAGE","link":9}],"outputs":[],"widgets_values":["ComfyUI"],"order":0,"mode":0},{"id":"10","type":"ControlNetApply","properties":{"Node name for S&R":"ControlNetApply"},"pos":[459,8.284263959390863],"size":[317,161],"inputs":[{"name":"conditioning","type":"CONDITIONING","link":10},{"name":"control_net","type":"CONTROL_NET","link":13},{"name":"image","type":"IMAGE","link":12}],"outputs":[{"name":"CONDITIONING","type":"CONDITIONING","links":[18],"slot_index":0}],"widgets_values":[0.8999999999999999],"order":0,"mode":0},{"id":"11","type":"LoadImage","properties":{"Node name for S&R":"LoadImage"},"pos":[-60.4073604060913,198.40736040609139],"size":[388,466],"inputs":[],"outputs":[{"name":"IMAGE","type":"IMAGE","links":[12],"slot_index":0},{"name":"MASK","type":"MASK","links":null}],"widgets_values":["input_scribble_example.png",null],"order":0,"mode":0},{"id":"12","type":"ControlNetLoader","properties":{"Node name for S&R":"ControlNetLoader"},"pos":[-92.7157360406091,47.642131979695435],"size":[422,113],"inputs":[],"outputs":[{"name":"CONTROL_NET","type":"CONTROL_NET","links":[13],"slot_index":0}],"widgets_values":["control_scribble.safetensors"],"order":0,"mode":0},{"id":"14","type":"CheckpointLoaderSimple","properties":{"Node name for S&R":"CheckpointLoaderSimple"},"pos":[-448,231],"size":[315,161],"inputs":[],"outputs":[{"name":"MODEL","type":"MODEL","links":[19],"slot_index":0},{"name":"CLIP","type":"CLIP","links":[20,21],"slot_index":1},{"name":"VAE","type":"VAE","links":[22],"slot_index":2}],"widgets_values":["AnythingElse-V4.0.safetensors"],"order":0,"mode":0}],"links":[["2","5",0,"3",3,"LATENT"],["7","3",0,"8",0,"LATENT"],["9","8",0,"9",0,"IMAGE"],["10","6",0,"10",0,"CONDITIONING"],["12","11",0,"10",2,"IMAGE"],["13","12",0,"10",1,"CONTROL_NET"],["16","7",0,"3",2,"CONDITIONING"],["18","10",0,"3",1,"CONDITIONING"],["19","14",0,"3",0,"MODEL"],["20","14",1,"7",0,"CLIP"],["21","14",1,"6",0,"CLIP"],["22","14",2,"8",1,"VAE"]],"groups":[],"version":0,"extra":{"comflowy_version":"0.0.4-alpha"}} \ No newline at end of file diff --git a/apps/electron-frontend/src/components/templates/data/Simple-img2img-workflow.json b/apps/electron-frontend/src/components/templates/data/Simple-img2img-workflow.json index 9273fc64..21068565 100644 --- a/apps/electron-frontend/src/components/templates/data/Simple-img2img-workflow.json +++ b/apps/electron-frontend/src/components/templates/data/Simple-img2img-workflow.json @@ -1,431 +1 @@ -{ - "last_node_id": 14, - "last_link_id": 17, - "nodes": [ - { - "id": 7, - "type": "CLIPTextEncode", - "pos": [ - 413, - 389 - ], - "size": { - "0": 425.27801513671875, - "1": 180.6060791015625 - }, - "flags": {}, - "order": 3, - "mode": 0, - "inputs": [ - { - "name": "clip", - "type": "CLIP", - "link": 15 - } - ], - "outputs": [ - { - "name": "CONDITIONING", - "type": "CONDITIONING", - "links": [ - 6 - ], - "slot_index": 0 - } - ], - "properties": { - "Node name for S&R": "CLIPTextEncode" - }, - "widgets_values": [ - "watermark, text\n" - ] - }, - { - "id": 6, - "type": "CLIPTextEncode", - "pos": [ - 415, - 186 - ], - "size": { - "0": 422.84503173828125, - "1": 164.31304931640625 - }, - "flags": {}, - "order": 2, - "mode": 0, - "inputs": [ - { - "name": "clip", - "type": "CLIP", - "link": 14 - } - ], - "outputs": [ - { - "name": "CONDITIONING", - "type": "CONDITIONING", - "links": [ - 4 - ], - "slot_index": 0 - } - ], - "properties": { - "Node name for S&R": "CLIPTextEncode" - }, - "widgets_values": [ - "photograph of victorian woman with wings, sky clouds, meadow grass\n" - ] - }, - { - "id": 8, - "type": "VAEDecode", - "pos": [ - 1209, - 188 - ], - "size": { - "0": 210, - "1": 46 - }, - "flags": {}, - "order": 6, - "mode": 0, - "inputs": [ - { - "name": "samples", - "type": "LATENT", - "link": 7 - }, - { - "name": "vae", - "type": "VAE", - "link": 17 - } - ], - "outputs": [ - { - "name": "IMAGE", - "type": "IMAGE", - "links": [ - 9 - ], - "slot_index": 0 - } - ], - "properties": { - "Node name for S&R": "VAEDecode" - } - }, - { - "id": 9, - "type": "SaveImage", - "pos": [ - 1451, - 189 - ], - "size": [ - 210, - 270 - ], - "flags": {}, - "order": 7, - "mode": 0, - "inputs": [ - { - "name": "images", - "type": "IMAGE", - "link": 9 - } - ], - "properties": {}, - "widgets_values": [ - "ComfyUI" - ] - }, - { - "id": 12, - "type": "VAEEncode", - "pos": [ - 614.979959716797, - 707.6800268554688 - ], - "size": { - "0": 210, - "1": 46 - }, - "flags": {}, - "order": 4, - "mode": 0, - "inputs": [ - { - "name": "pixels", - "type": "IMAGE", - "link": 10 - }, - { - "name": "vae", - "type": "VAE", - "link": 16 - } - ], - "outputs": [ - { - "name": "LATENT", - "type": "LATENT", - "links": [ - 11 - ], - "slot_index": 0 - } - ], - "properties": { - "Node name for S&R": "VAEEncode" - } - }, - { - "id": 14, - "type": "CheckpointLoaderSimple", - "pos": [ - 19, - 433 - ], - "size": { - "0": 315, - "1": 98 - }, - "flags": {}, - "order": 0, - "mode": 0, - "outputs": [ - { - "name": "MODEL", - "type": "MODEL", - "links": [ - 13 - ], - "shape": 3, - "slot_index": 0 - }, - { - "name": "CLIP", - "type": "CLIP", - "links": [ - 14, - 15 - ], - "shape": 3, - "slot_index": 1 - }, - { - "name": "VAE", - "type": "VAE", - "links": [ - 16, - 17 - ], - "shape": 3, - "slot_index": 2 - } - ], - "properties": { - "Node name for S&R": "CheckpointLoaderSimple" - }, - "widgets_values": [ - "DreamShaper-v8.0.safetensors" - ] - }, - { - "id": 10, - "type": "LoadImage", - "pos": [ - 214, - 736 - ], - "size": { - "0": 315, - "1": 314.0000305175781 - }, - "flags": {}, - "order": 1, - "mode": 0, - "outputs": [ - { - "name": "IMAGE", - "type": "IMAGE", - "links": [ - 10 - ], - "slot_index": 0 - }, - { - "name": "MASK", - "type": "MASK", - "links": null, - "shape": 3 - } - ], - "properties": { - "Node name for S&R": "LoadImage" - }, - "widgets_values": [ - "example.png", - "image" - ] - }, - { - "id": 3, - "type": "KSampler", - "pos": [ - 863, - 186 - ], - "size": { - "0": 315, - "1": 262 - }, - "flags": {}, - "order": 5, - "mode": 0, - "inputs": [ - { - "name": "model", - "type": "MODEL", - "link": 13 - }, - { - "name": "positive", - "type": "CONDITIONING", - "link": 4 - }, - { - "name": "negative", - "type": "CONDITIONING", - "link": 6 - }, - { - "name": "latent_image", - "type": "LATENT", - "link": 11 - } - ], - "outputs": [ - { - "name": "LATENT", - "type": "LATENT", - "links": [ - 7 - ], - "slot_index": 0 - } - ], - "properties": { - "Node name for S&R": "KSampler" - }, - "widgets_values": [ - 321204507298344, - "randomize", - 30, - 8, - "dpmpp_2m", - "normal", - 0.8700000000000001 - ] - } - ], - "links": [ - [ - 4, - 6, - 0, - 3, - 1, - "CONDITIONING" - ], - [ - 6, - 7, - 0, - 3, - 2, - "CONDITIONING" - ], - [ - 7, - 3, - 0, - 8, - 0, - "LATENT" - ], - [ - 9, - 8, - 0, - 9, - 0, - "IMAGE" - ], - [ - 10, - 10, - 0, - 12, - 0, - "IMAGE" - ], - [ - 11, - 12, - 0, - 3, - 3, - "LATENT" - ], - [ - 13, - 14, - 0, - 3, - 0, - "MODEL" - ], - [ - 14, - 14, - 1, - 6, - 0, - "CLIP" - ], - [ - 15, - 14, - 1, - 7, - 0, - "CLIP" - ], - [ - 16, - 14, - 2, - 12, - 1, - "VAE" - ], - [ - 17, - 14, - 2, - 8, - 1, - "VAE" - ] - ], - "groups": [], - "config": {}, - "extra": {}, - "version": 0.4 -} \ No newline at end of file +{"id":"cea8bc18-4c8f-4e7b-bf15-2a09c002b0d5","title":"Simple img2img workflow","nodes":[{"id":"3","type":"KSampler","properties":{"Node name for S&R":"KSampler"},"pos":[863,186],"size":[315,413],"inputs":[{"name":"model","type":"MODEL","link":13},{"name":"positive","type":"CONDITIONING","link":4},{"name":"negative","type":"CONDITIONING","link":6},{"name":"latent_image","type":"LATENT","link":11}],"outputs":[{"name":"LATENT","type":"LATENT","links":[7],"slot_index":0}],"widgets_values":[321204507298344,"randomize",30,8,"dpmpp_2m","normal",0.8700000000000001],"order":0,"mode":0},{"id":"6","type":"CLIPTextEncode","properties":{"Node name for S&R":"CLIPTextEncode"},"pos":[392.39109874826147,108.12489568845619],"size":[423,221],"inputs":[{"name":"clip","type":"CLIP","link":14}],"outputs":[{"name":"CONDITIONING","type":"CONDITIONING","links":[4],"slot_index":0}],"widgets_values":["photograph of victorian woman with wings, sky clouds, meadow grass\n"],"order":0,"mode":0},{"id":"7","type":"CLIPTextEncode","properties":{"Node name for S&R":"CLIPTextEncode"},"pos":[395.4152990264256,357.59874826147427],"size":[425,221],"inputs":[{"name":"clip","type":"CLIP","link":15}],"outputs":[{"name":"CONDITIONING","type":"CONDITIONING","links":[6],"slot_index":0}],"widgets_values":["watermark, text\n"],"order":0,"mode":0},{"id":"8","type":"VAEDecode","properties":{"Node name for S&R":"VAEDecode"},"pos":[1209,188],"size":[210,99],"inputs":[{"name":"samples","type":"LATENT","link":7},{"name":"vae","type":"VAE","link":17}],"outputs":[{"name":"IMAGE","type":"IMAGE","links":[9],"slot_index":0}],"widgets_values":[],"order":0,"mode":0},{"id":"9","type":"SaveImage","properties":{},"pos":[1451,189],"size":[210,313],"inputs":[{"name":"images","type":"IMAGE","link":9}],"outputs":[],"widgets_values":["ComfyUI"],"order":0,"mode":0},{"id":"10","type":"LoadImage","properties":{"Node name for S&R":"LoadImage"},"pos":[214,736],"size":[317,485],"inputs":[],"outputs":[{"name":"IMAGE","type":"IMAGE","links":[10],"slot_index":0},{"name":"MASK","type":"MASK","links":null,"shape":3}],"widgets_values":["example.png",null],"order":0,"mode":0},{"id":"12","type":"VAEEncode","properties":{"Node name for S&R":"VAEEncode"},"pos":[603.6755090909277,612.2202215703504],"size":[210,99],"inputs":[{"name":"pixels","type":"IMAGE","link":10},{"name":"vae","type":"VAE","link":16}],"outputs":[{"name":"LATENT","type":"LATENT","links":[11],"slot_index":0}],"widgets_values":[],"order":0,"mode":0},{"id":"14","type":"CheckpointLoaderSimple","properties":{"Node name for S&R":"CheckpointLoaderSimple"},"pos":[8.951599443671768,433],"size":[315,161],"inputs":[],"outputs":[{"name":"MODEL","type":"MODEL","links":[13],"shape":3,"slot_index":0},{"name":"CLIP","type":"CLIP","links":[14,15],"shape":3,"slot_index":1},{"name":"VAE","type":"VAE","links":[16,17],"shape":3,"slot_index":2}],"widgets_values":["dreamshaper_8.safetensors"],"order":0,"mode":0}],"links":[["4","6",0,"3",1,"CONDITIONING"],["6","7",0,"3",2,"CONDITIONING"],["7","3",0,"8",0,"LATENT"],["9","8",0,"9",0,"IMAGE"],["10","10",0,"12",0,"IMAGE"],["11","12",0,"3",3,"LATENT"],["13","14",0,"3",0,"MODEL"],["14","14",1,"6",0,"CLIP"],["15","14",1,"7",0,"CLIP"],["16","14",2,"12",1,"VAE"],["17","14",2,"8",1,"VAE"]],"groups":[],"version":0,"extra":{"comflowy_version":"0.0.4-alpha"}} \ No newline at end of file diff --git a/apps/electron-frontend/src/components/templates/data/Style-model-workflow.json b/apps/electron-frontend/src/components/templates/data/Style-model-workflow.json index f7c4fb15..05efbf0d 100644 --- a/apps/electron-frontend/src/components/templates/data/Style-model-workflow.json +++ b/apps/electron-frontend/src/components/templates/data/Style-model-workflow.json @@ -1,598 +1 @@ -{ - "last_node_id": 17, - "last_link_id": 25, - "nodes": [ - { - "id": 16, - "type": "LoadImage", - "pos": [ - 80, - 400 - ], - "size": { - "0": 210, - "1": 314 - }, - "flags": {}, - "order": 0, - "mode": 0, - "outputs": [ - { - "name": "IMAGE", - "type": "IMAGE", - "links": [ - 16 - ], - "shape": 3, - "slot_index": 0 - }, - { - "name": "MASK", - "type": "MASK", - "links": null, - "shape": 3 - } - ], - "properties": { - "Node name for S&R": "LoadImage" - }, - "widgets_values": [ - "cwf_marble_statue.jpg", - "image" - ] - }, - { - "id": 8, - "type": "VAEDecode", - "pos": [ - 1230, - 160 - ], - "size": { - "0": 140, - "1": 60 - }, - "flags": {}, - "order": 10, - "mode": 0, - "inputs": [ - { - "name": "samples", - "type": "LATENT", - "link": 7 - }, - { - "name": "vae", - "type": "VAE", - "link": 25 - } - ], - "outputs": [ - { - "name": "IMAGE", - "type": "IMAGE", - "links": [ - 9 - ], - "slot_index": 0 - } - ], - "properties": { - "Node name for S&R": "VAEDecode" - } - }, - { - "id": 9, - "type": "SaveImage", - "pos": [ - 1420, - 160 - ], - "size": { - "0": 410, - "1": 460 - }, - "flags": {}, - "order": 11, - "mode": 0, - "inputs": [ - { - "name": "images", - "type": "IMAGE", - "link": 9 - } - ], - "properties": {}, - "widgets_values": [ - "Result" - ] - }, - { - "id": 5, - "type": "EmptyLatentImage", - "pos": [ - 680, - 290 - ], - "size": { - "0": 220, - "1": 106 - }, - "flags": {}, - "order": 1, - "mode": 0, - "outputs": [ - { - "name": "LATENT", - "type": "LATENT", - "links": [ - 2 - ], - "slot_index": 0 - } - ], - "properties": { - "Node name for S&R": "EmptyLatentImage" - }, - "widgets_values": [ - 512, - 512, - 1 - ] - }, - { - "id": 12, - "type": "StyleModelApply", - "pos": [ - 640, - 180 - ], - "size": { - "0": 262, - "1": 70 - }, - "flags": {}, - "order": 8, - "mode": 0, - "inputs": [ - { - "name": "conditioning", - "type": "CONDITIONING", - "link": 24 - }, - { - "name": "style_model", - "type": "STYLE_MODEL", - "link": 13 - }, - { - "name": "clip_vision_output", - "type": "CLIP_VISION_OUTPUT", - "link": 14 - } - ], - "outputs": [ - { - "name": "CONDITIONING", - "type": "CONDITIONING", - "links": [ - 22 - ], - "shape": 3, - "slot_index": 0 - } - ], - "properties": { - "Node name for S&R": "StyleModelApply" - } - }, - { - "id": 7, - "type": "CLIPTextEncode", - "pos": [ - 360, - 140 - ], - "size": { - "0": 230, - "1": 80 - }, - "flags": {}, - "order": 7, - "mode": 0, - "inputs": [ - { - "name": "clip", - "type": "CLIP", - "link": 5 - } - ], - "outputs": [ - { - "name": "CONDITIONING", - "type": "CONDITIONING", - "links": [ - 6 - ], - "slot_index": 0 - } - ], - "title": "CLIP Text Encode (Negative)", - "properties": { - "Node name for S&R": "CLIPTextEncode" - }, - "widgets_values": [ - "blurry, illustration, naked, text" - ] - }, - { - "id": 15, - "type": "CLIPVisionEncode", - "pos": [ - 340, - 360 - ], - "size": { - "0": 253.60000610351562, - "1": 50 - }, - "flags": {}, - "order": 5, - "mode": 0, - "inputs": [ - { - "name": "clip_vision", - "type": "CLIP_VISION", - "link": 15 - }, - { - "name": "image", - "type": "IMAGE", - "link": 16 - } - ], - "outputs": [ - { - "name": "CLIP_VISION_OUTPUT", - "type": "CLIP_VISION_OUTPUT", - "links": [ - 14 - ], - "shape": 3, - "slot_index": 0 - } - ], - "properties": { - "Node name for S&R": "CLIPVisionEncode" - } - }, - { - "id": 14, - "type": "CLIPVisionLoader", - "pos": [ - 80, - 300 - ], - "size": { - "0": 210, - "1": 60 - }, - "flags": {}, - "order": 2, - "mode": 0, - "outputs": [ - { - "name": "CLIP_VISION", - "type": "CLIP_VISION", - "links": [ - 15 - ], - "shape": 3, - "slot_index": 0 - } - ], - "properties": { - "Node name for S&R": "CLIPVisionLoader" - }, - "widgets_values": [ - "CLIP-vit-large-patch14.bin" - ] - }, - { - "id": 13, - "type": "StyleModelLoader", - "pos": [ - 380, - 260 - ], - "size": { - "0": 210, - "1": 60 - }, - "flags": {}, - "order": 3, - "mode": 0, - "outputs": [ - { - "name": "STYLE_MODEL", - "type": "STYLE_MODEL", - "links": [ - 13 - ], - "shape": 3, - "slot_index": 0 - } - ], - "properties": { - "Node name for S&R": "StyleModelLoader" - }, - "widgets_values": [ - "SD-v1.5-coadapter-style-v1.0.pth" - ] - }, - { - "id": 6, - "type": "CLIPTextEncode", - "pos": [ - 360, - 20 - ], - "size": { - "0": 230, - "1": 80 - }, - "flags": {}, - "order": 6, - "mode": 0, - "inputs": [ - { - "name": "clip", - "type": "CLIP", - "link": 3 - } - ], - "outputs": [ - { - "name": "CONDITIONING", - "type": "CONDITIONING", - "links": [ - 24 - ], - "slot_index": 0 - } - ], - "title": "CLIP Text Encode (Positive)", - "properties": { - "Node name for S&R": "CLIPTextEncode" - }, - "widgets_values": [ - "girl" - ] - }, - { - "id": 3, - "type": "KSampler", - "pos": [ - 950, - 160 - ], - "size": { - "0": 240, - "1": 262 - }, - "flags": {}, - "order": 9, - "mode": 0, - "inputs": [ - { - "name": "model", - "type": "MODEL", - "link": 1 - }, - { - "name": "positive", - "type": "CONDITIONING", - "link": 22 - }, - { - "name": "negative", - "type": "CONDITIONING", - "link": 6 - }, - { - "name": "latent_image", - "type": "LATENT", - "link": 2 - } - ], - "outputs": [ - { - "name": "LATENT", - "type": "LATENT", - "links": [ - 7 - ], - "slot_index": 0 - } - ], - "properties": { - "Node name for S&R": "KSampler" - }, - "widgets_values": [ - 1003683894614458, - "randomize", - 20, - 7, - "dpmpp_2m", - "karras", - 1 - ] - }, - { - "id": 4, - "type": "CheckpointLoaderSimple", - "pos": [ - 40, - 60 - ], - "size": { - "0": 250, - "1": 100 - }, - "flags": {}, - "order": 4, - "mode": 0, - "outputs": [ - { - "name": "MODEL", - "type": "MODEL", - "links": [ - 1 - ], - "slot_index": 0 - }, - { - "name": "CLIP", - "type": "CLIP", - "links": [ - 3, - 5 - ], - "slot_index": 1 - }, - { - "name": "VAE", - "type": "VAE", - "links": [ - 25 - ], - "slot_index": 2 - } - ], - "properties": { - "Node name for S&R": "CheckpointLoaderSimple" - }, - "widgets_values": [ - "SD-v1.5-pruned.safetensors" - ] - } - ], - "links": [ - [ - 1, - 4, - 0, - 3, - 0, - "MODEL" - ], - [ - 2, - 5, - 0, - 3, - 3, - "LATENT" - ], - [ - 3, - 4, - 1, - 6, - 0, - "CLIP" - ], - [ - 5, - 4, - 1, - 7, - 0, - "CLIP" - ], - [ - 6, - 7, - 0, - 3, - 2, - "CONDITIONING" - ], - [ - 7, - 3, - 0, - 8, - 0, - "LATENT" - ], - [ - 9, - 8, - 0, - 9, - 0, - "IMAGE" - ], - [ - 13, - 13, - 0, - 12, - 1, - "STYLE_MODEL" - ], - [ - 14, - 15, - 0, - 12, - 2, - "CLIP_VISION_OUTPUT" - ], - [ - 15, - 14, - 0, - 15, - 0, - "CLIP_VISION" - ], - [ - 16, - 16, - 0, - 15, - 1, - "IMAGE" - ], - [ - 22, - 12, - 0, - 3, - 1, - "CONDITIONING" - ], - [ - 24, - 6, - 0, - 12, - 0, - "CONDITIONING" - ], - [ - 25, - 4, - 2, - 8, - 1, - "VAE" - ] - ], - "groups": [], - "config": {}, - "extra": {}, - "version": 0.4 -} \ No newline at end of file +{"id":"47cc63e5-e8d9-4851-8324-83cb0def7101","title":"Style model workflow","nodes":[{"id":"3","type":"KSampler","properties":{"Node name for S&R":"KSampler"},"pos":[928.0917941585535,-52.23574408901254],"size":[240,413],"inputs":[{"name":"model","type":"MODEL","link":1},{"name":"positive","type":"CONDITIONING","link":22},{"name":"negative","type":"CONDITIONING","link":6},{"name":"latent_image","type":"LATENT","link":2}],"outputs":[{"name":"LATENT","type":"LATENT","links":[7],"slot_index":0}],"widgets_values":[1003683894614458,"randomize",20,7,"dpmpp_2m","karras",1],"order":0,"mode":0},{"id":"4","type":"CheckpointLoaderSimple","properties":{"Node name for S&R":"CheckpointLoaderSimple"},"pos":[-9.293463143254513,-63.233657858136304],"size":[250,161],"inputs":[],"outputs":[{"name":"MODEL","type":"MODEL","links":[1],"slot_index":0},{"name":"CLIP","type":"CLIP","links":[3,5],"slot_index":1},{"name":"VAE","type":"VAE","links":[25],"slot_index":2}],"widgets_values":["v1-5-pruned-emaonly.ckpt"],"order":0,"mode":0},{"id":"5","type":"EmptyLatentImage","properties":{"Node name for S&R":"EmptyLatentImage"},"pos":[663.5688456189151,198.25938803894306],"size":[220,189],"inputs":[],"outputs":[{"name":"LATENT","type":"LATENT","links":[2],"slot_index":0}],"widgets_values":[512,512,1],"order":0,"mode":0},{"id":"6","type":"CLIPTextEncode","title":"CLIP Text Encode (Positive)","properties":{"Node name for S&R":"CLIPTextEncode"},"pos":[336.7225312934632,-223.72878998609178],"size":[245,221],"inputs":[{"name":"clip","type":"CLIP","link":3}],"outputs":[{"name":"CONDITIONING","type":"CONDITIONING","links":[24],"slot_index":0}],"widgets_values":["girl"],"order":0,"mode":0},{"id":"7","type":"CLIPTextEncode","title":"CLIP Text Encode (Negative)","properties":{"Node name for S&R":"CLIPTextEncode"},"pos":[625.6369958275382,-55.804589707927704],"size":[262,221],"inputs":[{"name":"clip","type":"CLIP","link":5}],"outputs":[{"name":"CONDITIONING","type":"CONDITIONING","links":[6],"slot_index":0}],"widgets_values":["blurry, illustration, naked, text"],"order":0,"mode":0},{"id":"8","type":"VAEDecode","properties":{"Node name for S&R":"VAEDecode"},"pos":[1205.3532684283728,-50.86648122392213],"size":[140,99],"inputs":[{"name":"samples","type":"LATENT","link":7},{"name":"vae","type":"VAE","link":25}],"outputs":[{"name":"IMAGE","type":"IMAGE","links":[9],"slot_index":0}],"widgets_values":[],"order":0,"mode":0},{"id":"9","type":"SaveImage","properties":{},"pos":[1430.9541029207232,-46.758692628650905],"size":[408,533],"inputs":[{"name":"images","type":"IMAGE","link":9}],"outputs":[],"widgets_values":["Result"],"order":0,"mode":0},{"id":"12","type":"StyleModelApply","properties":{"Node name for S&R":"StyleModelApply"},"pos":[623.5688456189151,-203.39360222531297],"size":[262,123],"inputs":[{"name":"conditioning","type":"CONDITIONING","link":24},{"name":"style_model","type":"STYLE_MODEL","link":13},{"name":"clip_vision_output","type":"CLIP_VISION_OUTPUT","link":14}],"outputs":[{"name":"CONDITIONING","type":"CONDITIONING","links":[22],"shape":3,"slot_index":0}],"widgets_values":[],"order":0,"mode":0},{"id":"13","type":"StyleModelLoader","properties":{"Node name for S&R":"StyleModelLoader"},"pos":[341.66063977746865,19.009735744089006],"size":[240,115],"inputs":[],"outputs":[{"name":"STYLE_MODEL","type":"STYLE_MODEL","links":[13],"shape":3,"slot_index":0}],"widgets_values":["coadapter-style-sd15v1.pth"],"order":0,"mode":0},{"id":"14","type":"CLIPVisionLoader","properties":{"Node name for S&R":"CLIPVisionLoader"},"pos":[-29.541029207232256,163.07371349095968],"size":[309,123],"inputs":[],"outputs":[{"name":"CLIP_VISION","type":"CLIP_VISION","links":[15],"shape":3,"slot_index":0}],"widgets_values":["pytorch_model.bin"],"order":0,"mode":0},{"id":"15","type":"CLIPVisionEncode","properties":{"Node name for S&R":"CLIPVisionEncode"},"pos":[337.26147426981896,160.08762169680114],"size":[248,99],"inputs":[{"name":"clip_vision","type":"CLIP_VISION","link":15},{"name":"image","type":"IMAGE","link":16}],"outputs":[{"name":"CLIP_VISION_OUTPUT","type":"CLIP_VISION_OUTPUT","links":[14],"shape":3,"slot_index":0}],"widgets_values":[],"order":0,"mode":0},{"id":"16","type":"LoadImage","properties":{"Node name for S&R":"LoadImage"},"pos":[63.56884561891516,327.4290681502086],"size":[210,345],"inputs":[],"outputs":[{"name":"IMAGE","type":"IMAGE","links":[16],"shape":3,"slot_index":0},{"name":"MASK","type":"MASK","links":null,"shape":3}],"widgets_values":["cwf_marble_statue.jpg",null],"order":0,"mode":0}],"links":[["1","4",0,"3",0,"MODEL"],["2","5",0,"3",3,"LATENT"],["3","4",1,"6",0,"CLIP"],["5","4",1,"7",0,"CLIP"],["6","7",0,"3",2,"CONDITIONING"],["7","3",0,"8",0,"LATENT"],["9","8",0,"9",0,"IMAGE"],["13","13",0,"12",1,"STYLE_MODEL"],["14","15",0,"12",2,"CLIP_VISION_OUTPUT"],["15","14",0,"15",0,"CLIP_VISION"],["16","16",0,"15",1,"IMAGE"],["22","12",0,"3",1,"CONDITIONING"],["24","6",0,"12",0,"CONDITIONING"],["25","4",2,"8",1,"VAE"]],"groups":[],"version":0,"extra":{"comflowy_version":"0.0.4-alpha"}} \ No newline at end of file diff --git a/apps/electron-frontend/src/components/templates/data/Upscale-pixel-and-Hi-res-fix-workflow.json b/apps/electron-frontend/src/components/templates/data/Upscale-pixel-and-Hi-res-fix-workflow.json index fc86b109..aa68e167 100644 --- a/apps/electron-frontend/src/components/templates/data/Upscale-pixel-and-Hi-res-fix-workflow.json +++ b/apps/electron-frontend/src/components/templates/data/Upscale-pixel-and-Hi-res-fix-workflow.json @@ -1,714 +1 @@ -{ - "last_node_id": 16, - "last_link_id": 24, - "nodes": [ - { - "id": 5, - "type": "EmptyLatentImage", - "pos": [ - 473, - 609 - ], - "size": { - "0": 315, - "1": 106 - }, - "flags": {}, - "order": 0, - "mode": 0, - "outputs": [ - { - "name": "LATENT", - "type": "LATENT", - "links": [ - 2 - ], - "slot_index": 0 - } - ], - "properties": { - "Node name for S&R": "EmptyLatentImage" - }, - "widgets_values": [ - 512, - 512, - 1 - ] - }, - { - "id": 6, - "type": "CLIPTextEncode", - "pos": [ - 415, - 186 - ], - "size": { - "0": 422.84503173828125, - "1": 164.31304931640625 - }, - "flags": {}, - "order": 3, - "mode": 0, - "inputs": [ - { - "name": "clip", - "type": "CLIP", - "link": 3 - } - ], - "outputs": [ - { - "name": "CONDITIONING", - "type": "CONDITIONING", - "links": [ - 4, - 12 - ], - "slot_index": 0 - } - ], - "properties": { - "Node name for S&R": "CLIPTextEncode" - }, - "widgets_values": [ - "Cat, standing on the castle" - ] - }, - { - "id": 7, - "type": "CLIPTextEncode", - "pos": [ - 413, - 389 - ], - "size": { - "0": 425.27801513671875, - "1": 180.6060791015625 - }, - "flags": {}, - "order": 4, - "mode": 0, - "inputs": [ - { - "name": "clip", - "type": "CLIP", - "link": 5 - } - ], - "outputs": [ - { - "name": "CONDITIONING", - "type": "CONDITIONING", - "links": [ - 6, - 13 - ], - "slot_index": 0 - } - ], - "properties": { - "Node name for S&R": "CLIPTextEncode" - }, - "widgets_values": [ - "text, watermark" - ] - }, - { - "id": 3, - "type": "KSampler", - "pos": [ - 863, - 186 - ], - "size": { - "0": 315, - "1": 262 - }, - "flags": {}, - "order": 5, - "mode": 0, - "inputs": [ - { - "name": "model", - "type": "MODEL", - "link": 1 - }, - { - "name": "positive", - "type": "CONDITIONING", - "link": 4 - }, - { - "name": "negative", - "type": "CONDITIONING", - "link": 6 - }, - { - "name": "latent_image", - "type": "LATENT", - "link": 2 - } - ], - "outputs": [ - { - "name": "LATENT", - "type": "LATENT", - "links": [ - 17 - ], - "slot_index": 0 - } - ], - "properties": { - "Node name for S&R": "KSampler" - }, - "widgets_values": [ - 156680208700286, - "randomize", - 20, - 8, - "dpmpp_2m", - "karras", - 1 - ] - }, - { - "id": 4, - "type": "CheckpointLoaderSimple", - "pos": [ - 26, - 474 - ], - "size": { - "0": 315, - "1": 98 - }, - "flags": {}, - "order": 1, - "mode": 0, - "outputs": [ - { - "name": "MODEL", - "type": "MODEL", - "links": [ - 1, - 14 - ], - "slot_index": 0 - }, - { - "name": "CLIP", - "type": "CLIP", - "links": [ - 3, - 5 - ], - "slot_index": 1 - }, - { - "name": "VAE", - "type": "VAE", - "links": [ - 8, - 23, - 24 - ], - "slot_index": 2 - } - ], - "properties": { - "Node name for S&R": "CheckpointLoaderSimple" - }, - "widgets_values": [ - "sd_xl_refiner_1.0.safetensors" - ] - }, - { - "id": 12, - "type": "VAEDecode", - "pos": [ - 1232, - 425 - ], - "size": { - "0": 210, - "1": 46 - }, - "flags": {}, - "order": 6, - "mode": 0, - "inputs": [ - { - "name": "samples", - "type": "LATENT", - "link": 17 - }, - { - "name": "vae", - "type": "VAE", - "link": 23 - } - ], - "outputs": [ - { - "name": "IMAGE", - "type": "IMAGE", - "links": [ - 18 - ], - "shape": 3, - "slot_index": 0 - } - ], - "properties": { - "Node name for S&R": "VAEDecode" - } - }, - { - "id": 13, - "type": "ImageUpscaleWithModel", - "pos": [ - 1534, - 522 - ], - "size": { - "0": 241.79998779296875, - "1": 46 - }, - "flags": {}, - "order": 7, - "mode": 0, - "inputs": [ - { - "name": "upscale_model", - "type": "UPSCALE_MODEL", - "link": 19 - }, - { - "name": "image", - "type": "IMAGE", - "link": 18 - } - ], - "outputs": [ - { - "name": "IMAGE", - "type": "IMAGE", - "links": [ - 20 - ], - "shape": 3, - "slot_index": 0 - } - ], - "properties": { - "Node name for S&R": "ImageUpscaleWithModel" - } - }, - { - "id": 14, - "type": "UpscaleModelLoader", - "pos": [ - 1141, - 630 - ], - "size": { - "0": 315, - "1": 58 - }, - "flags": {}, - "order": 2, - "mode": 0, - "outputs": [ - { - "name": "UPSCALE_MODEL", - "type": "UPSCALE_MODEL", - "links": [ - 19 - ], - "shape": 3, - "slot_index": 0 - } - ], - "properties": { - "Node name for S&R": "UpscaleModelLoader" - }, - "widgets_values": [ - "BSRGANx2.pth" - ] - }, - { - "id": 16, - "type": "VAEEncode", - "pos": [ - 1824, - 524 - ], - "size": { - "0": 210, - "1": 46 - }, - "flags": {}, - "order": 8, - "mode": 0, - "inputs": [ - { - "name": "pixels", - "type": "IMAGE", - "link": 20 - }, - { - "name": "vae", - "type": "VAE", - "link": 24 - } - ], - "outputs": [ - { - "name": "LATENT", - "type": "LATENT", - "links": [ - 21 - ], - "shape": 3, - "slot_index": 0 - } - ], - "properties": { - "Node name for S&R": "VAEEncode" - } - }, - { - "id": 15, - "type": "LatentUpscaleBy", - "pos": [ - 2077, - 525 - ], - "size": { - "0": 315, - "1": 82 - }, - "flags": {}, - "order": 9, - "mode": 0, - "inputs": [ - { - "name": "samples", - "type": "LATENT", - "link": 21 - } - ], - "outputs": [ - { - "name": "LATENT", - "type": "LATENT", - "links": [ - 22 - ], - "shape": 3, - "slot_index": 0 - } - ], - "properties": { - "Node name for S&R": "LatentUpscaleBy" - }, - "widgets_values": [ - "nearest-exact", - 1.5 - ] - }, - { - "id": 11, - "type": "KSampler", - "pos": [ - 2450, - 508 - ], - "size": { - "0": 315, - "1": 262 - }, - "flags": {}, - "order": 10, - "mode": 0, - "inputs": [ - { - "name": "model", - "type": "MODEL", - "link": 14 - }, - { - "name": "positive", - "type": "CONDITIONING", - "link": 12 - }, - { - "name": "negative", - "type": "CONDITIONING", - "link": 13 - }, - { - "name": "latent_image", - "type": "LATENT", - "link": 22 - } - ], - "outputs": [ - { - "name": "LATENT", - "type": "LATENT", - "links": [ - 15 - ], - "shape": 3, - "slot_index": 0 - } - ], - "properties": { - "Node name for S&R": "KSampler" - }, - "widgets_values": [ - 0, - "randomize", - 20, - 8, - "dpmpp_2m", - "karras", - 0.5 - ] - }, - { - "id": 8, - "type": "VAEDecode", - "pos": [ - 2853, - 533 - ], - "size": { - "0": 210, - "1": 46 - }, - "flags": {}, - "order": 11, - "mode": 0, - "inputs": [ - { - "name": "samples", - "type": "LATENT", - "link": 15 - }, - { - "name": "vae", - "type": "VAE", - "link": 8 - } - ], - "outputs": [ - { - "name": "IMAGE", - "type": "IMAGE", - "links": [ - 9 - ], - "slot_index": 0 - } - ], - "properties": { - "Node name for S&R": "VAEDecode" - } - }, - { - "id": 9, - "type": "SaveImage", - "pos": [ - 3157, - 532 - ], - "size": { - "0": 210, - "1": 58 - }, - "flags": {}, - "order": 12, - "mode": 0, - "inputs": [ - { - "name": "images", - "type": "IMAGE", - "link": 9 - } - ], - "properties": {}, - "widgets_values": [ - "ComfyUI" - ] - } - ], - "links": [ - [ - 1, - 4, - 0, - 3, - 0, - "MODEL" - ], - [ - 2, - 5, - 0, - 3, - 3, - "LATENT" - ], - [ - 3, - 4, - 1, - 6, - 0, - "CLIP" - ], - [ - 4, - 6, - 0, - 3, - 1, - "CONDITIONING" - ], - [ - 5, - 4, - 1, - 7, - 0, - "CLIP" - ], - [ - 6, - 7, - 0, - 3, - 2, - "CONDITIONING" - ], - [ - 8, - 4, - 2, - 8, - 1, - "VAE" - ], - [ - 9, - 8, - 0, - 9, - 0, - "IMAGE" - ], - [ - 12, - 6, - 0, - 11, - 1, - "CONDITIONING" - ], - [ - 13, - 7, - 0, - 11, - 2, - "CONDITIONING" - ], - [ - 14, - 4, - 0, - 11, - 0, - "MODEL" - ], - [ - 15, - 11, - 0, - 8, - 0, - "LATENT" - ], - [ - 17, - 3, - 0, - 12, - 0, - "LATENT" - ], - [ - 18, - 12, - 0, - 13, - 1, - "IMAGE" - ], - [ - 19, - 14, - 0, - 13, - 0, - "UPSCALE_MODEL" - ], - [ - 20, - 13, - 0, - 16, - 0, - "IMAGE" - ], - [ - 21, - 16, - 0, - 15, - 0, - "LATENT" - ], - [ - 22, - 15, - 0, - 11, - 3, - "LATENT" - ], - [ - 23, - 4, - 2, - 12, - 1, - "VAE" - ], - [ - 24, - 4, - 2, - 16, - 1, - "VAE" - ] - ], - "groups": [], - "config": {}, - "extra": {}, - "version": 0.4 -} \ No newline at end of file +{"id":"81cb5889-9a2d-471f-94e3-a778e6837a56","title":"Upscale pixel and hi-res fix latent workflow","nodes":[{"id":"3","type":"KSampler","properties":{"Node name for S&R":"KSampler"},"pos":[863,-9.809510026424984],"size":[315,413],"inputs":[{"name":"model","type":"MODEL","link":1},{"name":"positive","type":"CONDITIONING","link":4},{"name":"negative","type":"CONDITIONING","link":6},{"name":"latent_image","type":"LATENT","link":2}],"outputs":[{"name":"LATENT","type":"LATENT","links":[17],"slot_index":0}],"widgets_values":[156680208700286,"randomize",20,8,"dpmpp_2m","karras",1],"order":0,"mode":0},{"id":"4","type":"CheckpointLoaderSimple","properties":{"Node name for S&R":"CheckpointLoaderSimple"},"pos":[-22.805058230080107,201.18918123524094],"size":[315,161],"inputs":[],"outputs":[{"name":"MODEL","type":"MODEL","links":[1,14],"slot_index":0},{"name":"CLIP","type":"CLIP","links":[3,5],"slot_index":1},{"name":"VAE","type":"VAE","links":[8,23,24],"slot_index":2}],"widgets_values":["sd_xl_refiner_1.0.safetensors"],"order":0,"mode":0},{"id":"5","type":"EmptyLatentImage","properties":{"Node name for S&R":"EmptyLatentImage"},"pos":[498.95065795530934,376.623653763821],"size":[315,189],"inputs":[],"outputs":[{"name":"LATENT","type":"LATENT","links":[2],"slot_index":0}],"widgets_values":[512,512,1],"order":0,"mode":0},{"id":"6","type":"CLIPTextEncode","properties":{"Node name for S&R":"CLIPTextEncode"},"pos":[387.8697666830857,-165.51345775828102],"size":[423,221],"inputs":[{"name":"clip","type":"CLIP","link":3}],"outputs":[{"name":"CONDITIONING","type":"CONDITIONING","links":[4,12],"slot_index":0}],"widgets_values":["Cat, standing on the castle"],"order":0,"mode":0},{"id":"7","type":"CLIPTextEncode","properties":{"Node name for S&R":"CLIPTextEncode"},"pos":[384.6901913214806,103.54276249159733],"size":[425,221],"inputs":[{"name":"clip","type":"CLIP","link":5}],"outputs":[{"name":"CONDITIONING","type":"CONDITIONING","links":[6,13],"slot_index":0}],"widgets_values":["text, watermark"],"order":0,"mode":0},{"id":"8","type":"VAEDecode","properties":{"Node name for S&R":"VAEDecode"},"pos":[2846.773212957964,14.101079830342485],"size":[210,99],"inputs":[{"name":"samples","type":"LATENT","link":15},{"name":"vae","type":"VAE","link":8}],"outputs":[{"name":"IMAGE","type":"IMAGE","links":[9],"slot_index":0}],"widgets_values":[],"order":0,"mode":0},{"id":"9","type":"SaveImage","properties":{},"pos":[3098.883320940998,19.327866872378287],"size":[210,313],"inputs":[{"name":"images","type":"IMAGE","link":9}],"outputs":[],"widgets_values":["ComfyUI"],"order":0,"mode":0},{"id":"11","type":"KSampler","properties":{"Node name for S&R":"KSampler"},"pos":[2485.2851265715367,18.159419359843298],"size":[315,413],"inputs":[{"name":"model","type":"MODEL","link":14},{"name":"positive","type":"CONDITIONING","link":12},{"name":"negative","type":"CONDITIONING","link":13},{"name":"latent_image","type":"LATENT","link":22}],"outputs":[{"name":"LATENT","type":"LATENT","links":[15],"shape":3,"slot_index":0}],"widgets_values":[0,"randomize",20,8,"dpmpp_2m","karras",0.5],"order":0,"mode":0},{"id":"12","type":"VAEDecode","properties":{"Node name for S&R":"VAEDecode"},"pos":[1335.7797840339317,155.1725615117781],"size":[210,99],"inputs":[{"name":"samples","type":"LATENT","link":17},{"name":"vae","type":"VAE","link":23}],"outputs":[{"name":"IMAGE","type":"IMAGE","links":[18],"shape":3,"slot_index":0}],"widgets_values":[],"order":0,"mode":0},{"id":"13","type":"ImageUpscaleWithModel","properties":{"Node name for S&R":"ImageUpscaleWithModel"},"pos":[1598.3434661010376,3.1010798303424636],"size":[242,99],"inputs":[{"name":"upscale_model","type":"UPSCALE_MODEL","link":19},{"name":"image","type":"IMAGE","link":18}],"outputs":[{"name":"IMAGE","type":"IMAGE","links":[20],"shape":3,"slot_index":0}],"widgets_values":[],"order":0,"mode":0},{"id":"14","type":"UpscaleModelLoader","properties":{"Node name for S&R":"UpscaleModelLoader"},"pos":[1236.4774013112171,3.1701044350537124],"size":[315,113],"inputs":[],"outputs":[{"name":"UPSCALE_MODEL","type":"UPSCALE_MODEL","links":[19],"shape":3,"slot_index":0}],"widgets_values":["BSRGANx2.pth"],"order":0,"mode":0},{"id":"15","type":"LatentUpscaleBy","properties":{"Node name for S&R":"LatentUpscaleBy"},"pos":[2135.1166790590014,8.176675511021074],"size":[315,151],"inputs":[{"name":"samples","type":"LATENT","link":21}],"outputs":[{"name":"LATENT","type":"LATENT","links":[22],"shape":3,"slot_index":0}],"widgets_values":["nearest-exact",1.5],"order":0,"mode":0},{"id":"16","type":"VAEEncode","properties":{"Node name for S&R":"VAEEncode"},"pos":[1890.4190617817162,5.101079830342414],"size":[210,99],"inputs":[{"name":"pixels","type":"IMAGE","link":20},{"name":"vae","type":"VAE","link":24}],"outputs":[{"name":"LATENT","type":"LATENT","links":[21],"shape":3,"slot_index":0}],"widgets_values":[],"order":0,"mode":0}],"links":[["1","4",0,"3",0,"MODEL"],["2","5",0,"3",3,"LATENT"],["3","4",1,"6",0,"CLIP"],["4","6",0,"3",1,"CONDITIONING"],["5","4",1,"7",0,"CLIP"],["6","7",0,"3",2,"CONDITIONING"],["8","4",2,"8",1,"VAE"],["9","8",0,"9",0,"IMAGE"],["12","6",0,"11",1,"CONDITIONING"],["13","7",0,"11",2,"CONDITIONING"],["14","4",0,"11",0,"MODEL"],["15","11",0,"8",0,"LATENT"],["17","3",0,"12",0,"LATENT"],["18","12",0,"13",1,"IMAGE"],["19","14",0,"13",0,"UPSCALE_MODEL"],["20","13",0,"16",0,"IMAGE"],["21","16",0,"15",0,"LATENT"],["22","15",0,"11",3,"LATENT"],["23","4",2,"12",1,"VAE"],["24","4",2,"16",1,"VAE"]],"groups":[],"version":0,"extra":{"comflowy_version":"0.0.4-alpha"}} \ No newline at end of file diff --git a/apps/electron-frontend/src/components/templates/data/Upscale-pixel-by-algorithm-workflow.json b/apps/electron-frontend/src/components/templates/data/Upscale-pixel-by-algorithm-workflow.json index f66f90e0..d468caf2 100644 --- a/apps/electron-frontend/src/components/templates/data/Upscale-pixel-by-algorithm-workflow.json +++ b/apps/electron-frontend/src/components/templates/data/Upscale-pixel-by-algorithm-workflow.json @@ -1,133 +1 @@ -{ - "last_node_id": 3, - "last_link_id": 2, - "nodes": [ - { - "id": 2, - "type": "ImageScaleBy", - "pos": [ - 884, - 166 - ], - "size": { - "0": 315, - "1": 82 - }, - "flags": {}, - "order": 1, - "mode": 0, - "inputs": [ - { - "name": "image", - "type": "IMAGE", - "link": 1 - } - ], - "outputs": [ - { - "name": "IMAGE", - "type": "IMAGE", - "links": [ - 2 - ], - "shape": 3, - "slot_index": 0 - } - ], - "properties": { - "Node name for S&R": "ImageScaleBy" - }, - "widgets_values": [ - "nearest-exact", - 2 - ] - }, - { - "id": 1, - "type": "LoadImage", - "pos": [ - 282, - 230 - ], - "size": [ - 315, - 314 - ], - "flags": {}, - "order": 0, - "mode": 0, - "outputs": [ - { - "name": "IMAGE", - "type": "IMAGE", - "links": [ - 1 - ], - "shape": 3, - "slot_index": 0 - }, - { - "name": "MASK", - "type": "MASK", - "links": null, - "shape": 3 - } - ], - "properties": { - "Node name for S&R": "LoadImage" - }, - "widgets_values": [ - "oldphoto2_RealSR_JPEG.png", - "image" - ] - }, - { - "id": 3, - "type": "SaveImage", - "pos": [ - 1305, - 165 - ], - "size": { - "0": 315, - "1": 58 - }, - "flags": {}, - "order": 2, - "mode": 0, - "inputs": [ - { - "name": "images", - "type": "IMAGE", - "link": 2 - } - ], - "properties": {}, - "widgets_values": [ - "ComfyUI" - ] - } - ], - "links": [ - [ - 1, - 1, - 0, - 2, - 0, - "IMAGE" - ], - [ - 2, - 2, - 0, - 3, - 0, - "IMAGE" - ] - ], - "groups": [], - "config": {}, - "extra": {}, - "version": 0.4 -} \ No newline at end of file +{"id":"fb4bdbb5-7712-42b7-badf-5ad0ae97d652","title":"Upscale pixel by algorithm workflow","nodes":[{"id":"1","type":"LoadImage","properties":{"Node name for S&R":"LoadImage"},"pos":[473.39541029207237,174.7307371349096],"size":[315,345],"inputs":[],"outputs":[{"name":"IMAGE","type":"IMAGE","links":[1],"shape":3,"slot_index":0},{"name":"MASK","type":"MASK","links":null,"shape":3}],"widgets_values":["oldphoto2.png",null],"order":0,"mode":0},{"id":"2","type":"ImageScaleBy","properties":{"Node name for S&R":"ImageScaleBy"},"pos":[855.3418636995826,175.2115438108484],"size":[315,151],"inputs":[{"name":"image","type":"IMAGE","link":1}],"outputs":[{"name":"IMAGE","type":"IMAGE","links":[2],"shape":3,"slot_index":0}],"widgets_values":["nearest-exact",2],"order":0,"mode":0},{"id":"3","type":"SaveImage","properties":{},"pos":[1235.401668984701,175.23504867872046],"size":[321,442],"inputs":[{"name":"images","type":"IMAGE","link":2}],"outputs":[],"widgets_values":["ComfyUI"],"order":0,"mode":0}],"links":[["1","1",0,"2",0,"IMAGE"],["2","2",0,"3",0,"IMAGE"]],"groups":[],"version":0,"extra":{"comflowy_version":"0.0.4-alpha"}} \ No newline at end of file diff --git a/apps/electron-frontend/src/components/templates/data/Upscale-pixel-by-model-workflow.json b/apps/electron-frontend/src/components/templates/data/Upscale-pixel-by-model-workflow.json index 32880b15..98cba1fd 100644 --- a/apps/electron-frontend/src/components/templates/data/Upscale-pixel-by-model-workflow.json +++ b/apps/electron-frontend/src/components/templates/data/Upscale-pixel-by-model-workflow.json @@ -1,174 +1 @@ -{ - "last_node_id": 5, - "last_link_id": 6, - "nodes": [ - { - "id": 1, - "type": "LoadImage", - "pos": [ - 282, - 230 - ], - "size": [ - 315, - 314 - ], - "flags": {}, - "order": 0, - "mode": 0, - "outputs": [ - { - "name": "IMAGE", - "type": "IMAGE", - "links": [ - 5 - ], - "shape": 3, - "slot_index": 0 - }, - { - "name": "MASK", - "type": "MASK", - "links": null, - "shape": 3 - } - ], - "properties": { - "Node name for S&R": "LoadImage" - }, - "widgets_values": [ - "oldphoto2_RealSR_JPEG.png", - "image" - ] - }, - { - "id": 4, - "type": "UpscaleModelLoader", - "pos": [ - 701, - 87 - ], - "size": { - "0": 315, - "1": 58 - }, - "flags": {}, - "order": 1, - "mode": 0, - "outputs": [ - { - "name": "UPSCALE_MODEL", - "type": "UPSCALE_MODEL", - "links": [ - 6 - ], - "shape": 3, - "slot_index": 0 - } - ], - "properties": { - "Node name for S&R": "UpscaleModelLoader" - }, - "widgets_values": [ - "BSRGANx2.pth" - ] - }, - { - "id": 5, - "type": "ImageUpscaleWithModel", - "pos": [ - 1084, - 208 - ], - "size": { - "0": 241.79998779296875, - "1": 46 - }, - "flags": {}, - "order": 2, - "mode": 0, - "inputs": [ - { - "name": "upscale_model", - "type": "UPSCALE_MODEL", - "link": 6 - }, - { - "name": "image", - "type": "IMAGE", - "link": 5 - } - ], - "outputs": [ - { - "name": "IMAGE", - "type": "IMAGE", - "links": [ - 4 - ], - "shape": 3 - } - ], - "properties": { - "Node name for S&R": "ImageUpscaleWithModel" - } - }, - { - "id": 3, - "type": "SaveImage", - "pos": [ - 1407, - 211 - ], - "size": { - "0": 315, - "1": 58 - }, - "flags": {}, - "order": 3, - "mode": 0, - "inputs": [ - { - "name": "images", - "type": "IMAGE", - "link": 4, - "slot_index": 0 - } - ], - "properties": {}, - "widgets_values": [ - "ComfyUI" - ] - } - ], - "links": [ - [ - 4, - 5, - 0, - 3, - 0, - "IMAGE" - ], - [ - 5, - 1, - 0, - 5, - 1, - "IMAGE" - ], - [ - 6, - 4, - 0, - 5, - 0, - "UPSCALE_MODEL" - ] - ], - "groups": [], - "config": {}, - "extra": {}, - "version": 0.4 -} \ No newline at end of file +{"id":"f3a52eae-84eb-4bbf-897d-226d59a4e20a","title":"Upscale pixel by model workflow","nodes":[{"id":"1","type":"LoadImage","properties":{"Node name for S&R":"LoadImage"},"pos":[704.9874826147428,245.4214186369958],"size":[315,345],"inputs":[],"outputs":[{"name":"IMAGE","type":"IMAGE","links":[5],"shape":3,"slot_index":0},{"name":"MASK","type":"MASK","links":null,"shape":3}],"widgets_values":["oldphoto2.png",null],"order":0,"mode":0},{"id":"3","type":"SaveImage","properties":{},"pos":[1407,211],"size":[315,313],"inputs":[{"name":"images","type":"IMAGE","link":4,"slot_index":0}],"outputs":[],"widgets_values":["ComfyUI"],"order":0,"mode":0},{"id":"4","type":"UpscaleModelLoader","properties":{"Node name for S&R":"UpscaleModelLoader"},"pos":[701,87],"size":[315,113],"inputs":[],"outputs":[{"name":"UPSCALE_MODEL","type":"UPSCALE_MODEL","links":[6],"shape":3,"slot_index":0}],"widgets_values":["BSRGANx2.pth"],"order":0,"mode":0},{"id":"5","type":"ImageUpscaleWithModel","properties":{"Node name for S&R":"ImageUpscaleWithModel"},"pos":[1084,208],"size":[242,99],"inputs":[{"name":"upscale_model","type":"UPSCALE_MODEL","link":6},{"name":"image","type":"IMAGE","link":5}],"outputs":[{"name":"IMAGE","type":"IMAGE","links":[4],"shape":3}],"widgets_values":[],"order":0,"mode":0}],"links":[["4","5",0,"3",0,"IMAGE"],["5","1",0,"5",1,"IMAGE"],["6","4",0,"5",0,"UPSCALE_MODEL"]],"groups":[],"version":0,"extra":{"comflowy_version":"0.0.4-alpha"}} \ No newline at end of file diff --git a/apps/electron-frontend/src/components/templates/data/default-workflow.json b/apps/electron-frontend/src/components/templates/data/default-workflow.json index 4de8277c..fb19e6d2 100644 --- a/apps/electron-frontend/src/components/templates/data/default-workflow.json +++ b/apps/electron-frontend/src/components/templates/data/default-workflow.json @@ -1,366 +1 @@ -{ - "last_node_id": 11, - "last_link_id": 9, - "nodes": [ - { - "id": 7, - "type": "CLIPTextEncode", - "pos": [ - 413, - 389 - ], - "size": { - "0": 425.27801513671875, - "1": 180.6060791015625 - }, - "flags": {}, - "order": 3, - "mode": 0, - "inputs": [ - { - "name": "clip", - "type": "CLIP", - "link": 5 - } - ], - "outputs": [ - { - "name": "CONDITIONING", - "type": "CONDITIONING", - "links": [ - 6 - ], - "slot_index": 0 - } - ], - "properties": { - "Node name for S&R": "CLIPTextEncode" - }, - "widgets_values": [ - "text, watermark" - ] - }, - { - "id": 5, - "type": "EmptyLatentImage", - "pos": [ - 473, - 609 - ], - "size": { - "0": 315, - "1": 106 - }, - "flags": {}, - "order": 0, - "mode": 0, - "outputs": [ - { - "name": "LATENT", - "type": "LATENT", - "links": [ - 2 - ], - "slot_index": 0 - } - ], - "properties": { - "Node name for S&R": "EmptyLatentImage" - }, - "widgets_values": [ - 512, - 512, - 1 - ] - }, - { - "id": 8, - "type": "VAEDecode", - "pos": [ - 1209, - 188 - ], - "size": { - "0": 210, - "1": 46 - }, - "flags": {}, - "order": 5, - "mode": 0, - "inputs": [ - { - "name": "samples", - "type": "LATENT", - "link": 7 - }, - { - "name": "vae", - "type": "VAE", - "link": 8 - } - ], - "outputs": [ - { - "name": "IMAGE", - "type": "IMAGE", - "links": [ - 9 - ], - "slot_index": 0 - } - ], - "properties": { - "Node name for S&R": "VAEDecode" - } - }, - { - "id": 9, - "type": "SaveImage", - "pos": [ - 1451, - 189 - ], - "size": [ - 210, - 270 - ], - "flags": {}, - "order": 6, - "mode": 0, - "inputs": [ - { - "name": "images", - "type": "IMAGE", - "link": 9 - } - ], - "properties": {}, - "widgets_values": [ - "ComfyUI" - ] - }, - { - "id": 4, - "type": "CheckpointLoaderSimple", - "pos": [ - 26, - 474 - ], - "size": { - "0": 315, - "1": 98 - }, - "flags": {}, - "order": 1, - "mode": 0, - "outputs": [ - { - "name": "MODEL", - "type": "MODEL", - "links": [ - 1 - ], - "slot_index": 0 - }, - { - "name": "CLIP", - "type": "CLIP", - "links": [ - 3, - 5 - ], - "slot_index": 1 - }, - { - "name": "VAE", - "type": "VAE", - "links": [ - 8 - ], - "slot_index": 2 - } - ], - "properties": { - "Node name for S&R": "CheckpointLoaderSimple" - }, - "widgets_values": [ - "SD-v1.5-pruned.safetensors" - ] - }, - { - "id": 3, - "type": "KSampler", - "pos": [ - 863, - 186 - ], - "size": { - "0": 315, - "1": 262 - }, - "flags": {}, - "order": 4, - "mode": 0, - "inputs": [ - { - "name": "model", - "type": "MODEL", - "link": 1 - }, - { - "name": "positive", - "type": "CONDITIONING", - "link": 4 - }, - { - "name": "negative", - "type": "CONDITIONING", - "link": 6 - }, - { - "name": "latent_image", - "type": "LATENT", - "link": 2 - } - ], - "outputs": [ - { - "name": "LATENT", - "type": "LATENT", - "links": [ - 7 - ], - "slot_index": 0 - } - ], - "properties": { - "Node name for S&R": "KSampler" - }, - "widgets_values": [ - 931096203916419, - "randomize", - 20, - 8, - "dpmpp_2m", - "karras", - 1 - ] - }, - { - "id": 6, - "type": "CLIPTextEncode", - "pos": [ - 415, - 186 - ], - "size": { - "0": 422.84503173828125, - "1": 164.31304931640625 - }, - "flags": {}, - "order": 2, - "mode": 0, - "inputs": [ - { - "name": "clip", - "type": "CLIP", - "link": 3 - } - ], - "outputs": [ - { - "name": "CONDITIONING", - "type": "CONDITIONING", - "links": [ - 4 - ], - "slot_index": 0 - } - ], - "properties": { - "Node name for S&R": "CLIPTextEncode" - }, - "widgets_values": [ - "cat, standing on the castle" - ] - } - ], - "links": [ - [ - 1, - 4, - 0, - 3, - 0, - "MODEL" - ], - [ - 2, - 5, - 0, - 3, - 3, - "LATENT" - ], - [ - 3, - 4, - 1, - 6, - 0, - "CLIP" - ], - [ - 4, - 6, - 0, - 3, - 1, - "CONDITIONING" - ], - [ - 5, - 4, - 1, - 7, - 0, - "CLIP" - ], - [ - 6, - 7, - 0, - 3, - 2, - "CONDITIONING" - ], - [ - 7, - 3, - 0, - 8, - 0, - "LATENT" - ], - [ - 8, - 4, - 2, - 8, - 1, - "VAE" - ], - [ - 9, - 8, - 0, - 9, - 0, - "IMAGE" - ] - ], - "groups": [], - "config": {}, - "extra": {}, - "version": 0.4 -} \ No newline at end of file +{"id":"b1e2f57b-a924-4433-8d13-3cf2b2eae0fa","title":"Default Workflow","nodes":[{"id":"3","type":"KSampler","properties":{"Node name for S&R":"KSampler"},"pos":[863,186],"size":[315,413],"inputs":[{"name":"model","type":"MODEL","link":1},{"name":"positive","type":"CONDITIONING","link":4},{"name":"negative","type":"CONDITIONING","link":6},{"name":"latent_image","type":"LATENT","link":2}],"outputs":[{"name":"LATENT","type":"LATENT","links":[7],"slot_index":0}],"widgets_values":[931096203916419,"randomize",20,8,"dpmpp_2m","karras",1],"order":0,"mode":0},{"id":"4","type":"CheckpointLoaderSimple","properties":{"Node name for S&R":"CheckpointLoaderSimple"},"pos":[-7.768776077885974,195.09492350486786],"size":[315,161],"inputs":[],"outputs":[{"name":"MODEL","type":"MODEL","links":[1],"slot_index":0},{"name":"CLIP","type":"CLIP","links":[3,5],"slot_index":1},{"name":"VAE","type":"VAE","links":[8],"slot_index":2}],"widgets_values":["SD-v1.5-pruned.safetensors"],"order":0,"mode":0},{"id":"5","type":"EmptyLatentImage","properties":{"Node name for S&R":"EmptyLatentImage"},"pos":[505.51808066759395,588.9888734353269],"size":[315,189],"inputs":[],"outputs":[{"name":"LATENT","type":"LATENT","links":[2],"slot_index":0}],"widgets_values":[512,512,1],"order":0,"mode":0},{"id":"6","type":"CLIPTextEncode","properties":{"Node name for S&R":"CLIPTextEncode"},"pos":[398.740959666203,70.93602225312932],"size":[423,221],"inputs":[{"name":"clip","type":"CLIP","link":3}],"outputs":[{"name":"CONDITIONING","type":"CONDITIONING","links":[4],"slot_index":0}],"widgets_values":["cat, standing on the castle"],"order":0,"mode":0},{"id":"7","type":"CLIPTextEncode","properties":{"Node name for S&R":"CLIPTextEncode"},"pos":[397.99165507649514,325.2145340751043],"size":[425,221],"inputs":[{"name":"clip","type":"CLIP","link":5}],"outputs":[{"name":"CONDITIONING","type":"CONDITIONING","links":[6],"slot_index":0}],"widgets_values":["text, watermark"],"order":0,"mode":0},{"id":"8","type":"VAEDecode","properties":{"Node name for S&R":"VAEDecode"},"pos":[1209,188],"size":[210,99],"inputs":[{"name":"samples","type":"LATENT","link":7},{"name":"vae","type":"VAE","link":8}],"outputs":[{"name":"IMAGE","type":"IMAGE","links":[9],"slot_index":0}],"widgets_values":[],"order":0,"mode":0},{"id":"9","type":"SaveImage","properties":{},"pos":[1451,189],"size":[210,270],"inputs":[{"name":"images","type":"IMAGE","link":9}],"outputs":[],"widgets_values":["ComfyUI"],"order":0,"mode":0}],"links":[["1","4",0,"3",0,"MODEL"],["2","5",0,"3",3,"LATENT"],["3","4",1,"6",0,"CLIP"],["4","6",0,"3",1,"CONDITIONING"],["5","4",1,"7",0,"CLIP"],["6","7",0,"3",2,"CONDITIONING"],["7","3",0,"8",0,"LATENT"],["8","4",2,"8",1,"VAE"],["9","8",0,"9",0,"IMAGE"]],"groups":[],"version":0,"extra":{"comflowy_version":"0.0.4-alpha"}} \ No newline at end of file diff --git a/apps/electron-frontend/src/components/templates/data/unCLIP-model-workflow.json b/apps/electron-frontend/src/components/templates/data/unCLIP-model-workflow.json index e46b0c7c..42420002 100644 --- a/apps/electron-frontend/src/components/templates/data/unCLIP-model-workflow.json +++ b/apps/electron-frontend/src/components/templates/data/unCLIP-model-workflow.json @@ -1,537 +1 @@ -{ - "last_node_id": 16, - "last_link_id": 24, - "nodes": [ - { - "id": 8, - "type": "VAEDecode", - "pos": [ - 1480, - 60 - ], - "size": { - "0": 140, - "1": 60 - }, - "flags": {}, - "order": 8, - "mode": 0, - "inputs": [ - { - "name": "samples", - "type": "LATENT", - "link": 7 - }, - { - "name": "vae", - "type": "VAE", - "link": 15 - } - ], - "outputs": [ - { - "name": "IMAGE", - "type": "IMAGE", - "links": [ - 9 - ], - "slot_index": 0 - } - ], - "properties": { - "Node name for S&R": "VAEDecode" - } - }, - { - "id": 5, - "type": "EmptyLatentImage", - "pos": [ - 870, - 210 - ], - "size": { - "0": 220, - "1": 106 - }, - "flags": {}, - "order": 0, - "mode": 0, - "outputs": [ - { - "name": "LATENT", - "type": "LATENT", - "links": [ - 2 - ], - "slot_index": 0 - } - ], - "properties": { - "Node name for S&R": "EmptyLatentImage" - }, - "widgets_values": [ - 768, - 768, - 1 - ] - }, - { - "id": 13, - "type": "CLIPVisionEncode", - "pos": [ - 520, - 270 - ], - "size": { - "0": 253.60000610351562, - "1": 50 - }, - "flags": {}, - "order": 5, - "mode": 0, - "inputs": [ - { - "name": "clip_vision", - "type": "CLIP_VISION", - "link": 16 - }, - { - "name": "image", - "type": "IMAGE", - "link": 24 - } - ], - "outputs": [ - { - "name": "CLIP_VISION_OUTPUT", - "type": "CLIP_VISION_OUTPUT", - "links": [ - 17 - ], - "shape": 3, - "slot_index": 0 - } - ], - "properties": { - "Node name for S&R": "CLIPVisionEncode" - } - }, - { - "id": 15, - "type": "LoadImage", - "pos": [ - 120, - 360 - ], - "size": { - "0": 240, - "1": 320 - }, - "flags": {}, - "order": 1, - "mode": 0, - "outputs": [ - { - "name": "IMAGE", - "type": "IMAGE", - "links": [ - 24 - ], - "shape": 3, - "slot_index": 0 - }, - { - "name": "MASK", - "type": "MASK", - "links": null, - "shape": 3 - } - ], - "properties": { - "Node name for S&R": "LoadImage" - }, - "widgets_values": [ - "cwf_budapest.jpg", - "image" - ] - }, - { - "id": 14, - "type": "unCLIPConditioning", - "pos": [ - 830, - 60 - ], - "size": { - "0": 262, - "1": 102 - }, - "flags": {}, - "order": 6, - "mode": 0, - "inputs": [ - { - "name": "conditioning", - "type": "CONDITIONING", - "link": 18 - }, - { - "name": "clip_vision_output", - "type": "CLIP_VISION_OUTPUT", - "link": 17 - } - ], - "outputs": [ - { - "name": "CONDITIONING", - "type": "CONDITIONING", - "links": [ - 19 - ], - "shape": 3, - "slot_index": 0 - } - ], - "properties": { - "Node name for S&R": "unCLIPConditioning" - }, - "widgets_values": [ - 1, - 0.1 - ] - }, - { - "id": 12, - "type": "unCLIPCheckpointLoader", - "pos": [ - 30, - 180 - ], - "size": { - "0": 250, - "1": 120 - }, - "flags": {}, - "order": 2, - "mode": 0, - "outputs": [ - { - "name": "MODEL", - "type": "MODEL", - "links": [ - 14 - ], - "shape": 3, - "slot_index": 0 - }, - { - "name": "CLIP", - "type": "CLIP", - "links": [ - 13, - 21 - ], - "shape": 3, - "slot_index": 1 - }, - { - "name": "VAE", - "type": "VAE", - "links": [ - 15 - ], - "shape": 3, - "slot_index": 2 - }, - { - "name": "CLIP_VISION", - "type": "CLIP_VISION", - "links": [ - 16 - ], - "shape": 3, - "slot_index": 3 - } - ], - "properties": { - "Node name for S&R": "unCLIPCheckpointLoader" - }, - "widgets_values": [ - "SD-v2.1-unclip-h.ckpt" - ] - }, - { - "id": 3, - "type": "KSampler", - "pos": [ - 1140, - 60 - ], - "size": { - "0": 300, - "1": 262 - }, - "flags": {}, - "order": 7, - "mode": 0, - "inputs": [ - { - "name": "model", - "type": "MODEL", - "link": 14 - }, - { - "name": "positive", - "type": "CONDITIONING", - "link": 19 - }, - { - "name": "negative", - "type": "CONDITIONING", - "link": 6 - }, - { - "name": "latent_image", - "type": "LATENT", - "link": 2 - } - ], - "outputs": [ - { - "name": "LATENT", - "type": "LATENT", - "links": [ - 7 - ], - "slot_index": 0 - } - ], - "properties": { - "Node name for S&R": "KSampler" - }, - "widgets_values": [ - 2, - "fixed", - 20, - 7, - "dpmpp_2m", - "karras", - 1 - ] - }, - { - "id": 9, - "type": "SaveImage", - "pos": [ - 1669, - 59 - ], - "size": { - "0": 410, - "1": 460 - }, - "flags": {}, - "order": 9, - "mode": 0, - "inputs": [ - { - "name": "images", - "type": "IMAGE", - "link": 9 - } - ], - "properties": {}, - "widgets_values": [ - "Result" - ] - }, - { - "id": 6, - "type": "CLIPTextEncode", - "pos": [ - 410, - 60 - ], - "size": { - "0": 370, - "1": 160 - }, - "flags": {}, - "order": 3, - "mode": 0, - "inputs": [ - { - "name": "clip", - "type": "CLIP", - "link": 13 - } - ], - "outputs": [ - { - "name": "CONDITIONING", - "type": "CONDITIONING", - "links": [ - 18 - ], - "slot_index": 0 - } - ], - "title": "CLIP Text Encode (Positive)", - "properties": { - "Node name for S&R": "CLIPTextEncode" - }, - "widgets_values": [ - "a beautiful photograph of an old European city" - ] - }, - { - "id": 7, - "type": "CLIPTextEncode", - "pos": [ - 400, - 370 - ], - "size": { - "0": 370, - "1": 160 - }, - "flags": {}, - "order": 4, - "mode": 0, - "inputs": [ - { - "name": "clip", - "type": "CLIP", - "link": 21 - } - ], - "outputs": [ - { - "name": "CONDITIONING", - "type": "CONDITIONING", - "links": [ - 6 - ], - "slot_index": 0 - } - ], - "title": "CLIP Text Encode (Negative)", - "properties": { - "Node name for S&R": "CLIPTextEncode" - }, - "widgets_values": [ - "blurry, illustration" - ] - } - ], - "links": [ - [ - 2, - 5, - 0, - 3, - 3, - "LATENT" - ], - [ - 6, - 7, - 0, - 3, - 2, - "CONDITIONING" - ], - [ - 7, - 3, - 0, - 8, - 0, - "LATENT" - ], - [ - 9, - 8, - 0, - 9, - 0, - "IMAGE" - ], - [ - 13, - 12, - 1, - 6, - 0, - "CLIP" - ], - [ - 14, - 12, - 0, - 3, - 0, - "MODEL" - ], - [ - 15, - 12, - 2, - 8, - 1, - "VAE" - ], - [ - 16, - 12, - 3, - 13, - 0, - "CLIP_VISION" - ], - [ - 17, - 13, - 0, - 14, - 1, - "CLIP_VISION_OUTPUT" - ], - [ - 18, - 6, - 0, - 14, - 0, - "CONDITIONING" - ], - [ - 19, - 14, - 0, - 3, - 1, - "CONDITIONING" - ], - [ - 21, - 12, - 1, - 7, - 0, - "CLIP" - ], - [ - 24, - 15, - 0, - 13, - 1, - "IMAGE" - ] - ], - "groups": [], - "config": {}, - "extra": {}, - "version": 0.4 -} \ No newline at end of file +{"id":"f27d1766-cb0c-4368-a09b-cb452a22bfc5","title":"unCLIP model workflow","nodes":[{"id":"3","type":"KSampler","properties":{"Node name for S&R":"KSampler"},"pos":[1108.652294853964,34.92183588317107],"size":[300,413],"inputs":[{"name":"model","type":"MODEL","link":14},{"name":"positive","type":"CONDITIONING","link":19},{"name":"negative","type":"CONDITIONING","link":6},{"name":"latent_image","type":"LATENT","link":2}],"outputs":[{"name":"LATENT","type":"LATENT","links":[7],"slot_index":0}],"widgets_values":[2,"randomnized",20,7,"dpmpp_2m","karras",1],"order":0,"mode":0},{"id":"5","type":"EmptyLatentImage","properties":{"Node name for S&R":"EmptyLatentImage"},"pos":[826.1132127955494,432.5687065368567],"size":[220,189],"inputs":[],"outputs":[{"name":"LATENT","type":"LATENT","links":[2],"slot_index":0}],"widgets_values":[768,768,1],"order":0,"mode":0},{"id":"6","type":"CLIPTextEncode","title":"CLIP Text Encode (Positive)","properties":{"Node name for S&R":"CLIPTextEncode"},"pos":[361.41105702364393,-209.5902642559109],"size":[370,221],"inputs":[{"name":"clip","type":"CLIP","link":13}],"outputs":[{"name":"CONDITIONING","type":"CONDITIONING","links":[18],"slot_index":0}],"widgets_values":["a beautiful photograph of an old European city"],"order":0,"mode":0},{"id":"7","type":"CLIPTextEncode","title":"CLIP Text Encode (Negative)","properties":{"Node name for S&R":"CLIPTextEncode"},"pos":[675.8598052851183,164.67253129346315],"size":[370,221],"inputs":[{"name":"clip","type":"CLIP","link":21}],"outputs":[{"name":"CONDITIONING","type":"CONDITIONING","links":[6],"slot_index":0}],"widgets_values":["blurry, illustration"],"order":0,"mode":0},{"id":"8","type":"VAEDecode","properties":{"Node name for S&R":"VAEDecode"},"pos":[1458.0566063977747,42.75876216968011],"size":[140,99],"inputs":[{"name":"samples","type":"LATENT","link":7},{"name":"vae","type":"VAE","link":15}],"outputs":[{"name":"IMAGE","type":"IMAGE","links":[9],"slot_index":0}],"widgets_values":[],"order":0,"mode":0},{"id":"9","type":"SaveImage","properties":{},"pos":[1697.2129346314325,43.32614742698192],"size":[410,460],"inputs":[{"name":"images","type":"IMAGE","link":9}],"outputs":[],"widgets_values":["Result"],"order":0,"mode":0},{"id":"12","type":"unCLIPCheckpointLoader","properties":{"Node name for S&R":"unCLIPCheckpointLoader"},"pos":[47.24123783031993,-207.1441585535466],"size":[250,185],"inputs":[],"outputs":[{"name":"MODEL","type":"MODEL","links":[14],"shape":3,"slot_index":0},{"name":"CLIP","type":"CLIP","links":[13,21],"shape":3,"slot_index":1},{"name":"VAE","type":"VAE","links":[15],"shape":3,"slot_index":2},{"name":"CLIP_VISION","type":"CLIP_VISION","links":[16],"shape":3,"slot_index":3}],"widgets_values":["sd21-unclip-h.ckpt"],"order":0,"mode":0},{"id":"13","type":"CLIPVisionEncode","properties":{"Node name for S&R":"CLIPVisionEncode"},"pos":[477.6805980528511,36.45959666203063],"size":[254,99],"inputs":[{"name":"clip_vision","type":"CLIP_VISION","link":16},{"name":"image","type":"IMAGE","link":24}],"outputs":[{"name":"CLIP_VISION_OUTPUT","type":"CLIP_VISION_OUTPUT","links":[17],"shape":3,"slot_index":0}],"widgets_values":[],"order":0,"mode":0},{"id":"14","type":"unCLIPConditioning","properties":{"Node name for S&R":"unCLIPConditioning"},"pos":[764.1698191933241,-203.32072322670376],"size":[262,175],"inputs":[{"name":"conditioning","type":"CONDITIONING","link":18},{"name":"clip_vision_output","type":"CLIP_VISION_OUTPUT","link":17}],"outputs":[{"name":"CONDITIONING","type":"CONDITIONING","links":[19],"shape":3,"slot_index":0}],"widgets_values":[1,0.1],"order":0,"mode":0},{"id":"15","type":"LoadImage","properties":{"Node name for S&R":"LoadImage"},"pos":[198.36926286509038,91.97712100139083],"size":[240,345],"inputs":[],"outputs":[{"name":"IMAGE","type":"IMAGE","links":[24],"shape":3,"slot_index":0},{"name":"MASK","type":"MASK","links":null,"shape":3}],"widgets_values":["cwf_budapest (1).jpg",null],"order":0,"mode":0}],"links":[["2","5",0,"3",3,"LATENT"],["6","7",0,"3",2,"CONDITIONING"],["7","3",0,"8",0,"LATENT"],["9","8",0,"9",0,"IMAGE"],["13","12",1,"6",0,"CLIP"],["14","12",0,"3",0,"MODEL"],["15","12",2,"8",1,"VAE"],["16","12",3,"13",0,"CLIP_VISION"],["17","13",0,"14",1,"CLIP_VISION_OUTPUT"],["18","6",0,"14",0,"CONDITIONING"],["19","14",0,"3",1,"CONDITIONING"],["21","12",1,"7",0,"CLIP"],["24","15",0,"13",1,"IMAGE"]],"groups":[],"version":0,"extra":{"comflowy_version":"0.0.4-alpha"}} \ No newline at end of file diff --git a/apps/electron-frontend/src/components/workflow-editor/reactflow-node/reactflow-node.tsx b/apps/electron-frontend/src/components/workflow-editor/reactflow-node/reactflow-node.tsx index 4cb56fe2..acc93a9f 100644 --- a/apps/electron-frontend/src/components/workflow-editor/reactflow-node/reactflow-node.tsx +++ b/apps/electron-frontend/src/components/workflow-editor/reactflow-node/reactflow-node.tsx @@ -90,7 +90,7 @@ export const NodeComponent = memo(({ const mainRef = useRef(); const onNodesChange = useAppStore(st => st.onNodesChange); - + const undoManager = useAppStore(st => st.undoManager); const updateMinHeight = useCallback(async () => { if (mainRef.current) { await new Promise((resolve) => { diff --git a/apps/electron-frontend/src/components/workflow-editor/reactflow-topleft-panel/reactflow-topleft-panel.tsx b/apps/electron-frontend/src/components/workflow-editor/reactflow-topleft-panel/reactflow-topleft-panel.tsx index 665c6d59..430ad23f 100644 --- a/apps/electron-frontend/src/components/workflow-editor/reactflow-topleft-panel/reactflow-topleft-panel.tsx +++ b/apps/electron-frontend/src/components/workflow-editor/reactflow-topleft-panel/reactflow-topleft-panel.tsx @@ -20,8 +20,25 @@ export default function ReactflowTopLeftPanel() { export function UndoRedo() { const undo = useAppStore(st => st.undo); const redo = useAppStore(st => st.redo); - const canUndo = useAppStore(st => st.undoManager && st.undoManager.canUndo()); - const canRedo = useAppStore(st => st.undoManager && st.undoManager.canRedo()); + const undoManager = useAppStore(st => st.undoManager); + const [canUndo, setCanUndo] = useState(false); + const [canRedo, setCanRedo] = useState(false); + useEffect(() => { + if (!undoManager) { + return; + } + const updateHandler = (ev) => { + setCanRedo(undoManager.canRedo()); + setCanUndo(undoManager.canUndo()); + } + undoManager.on('stack-item-updated', updateHandler); + undoManager.on('stack-item-added', updateHandler); + undoManager.on('stack-item-popped', updateHandler); + return () => { + undoManager.off('stack-item-updated', updateHandler); + } + }, [undoManager]); + const inActiveColor = '#ababab'; const activeColor = 'white'; return ( From 6466dd7c58441bbd1ea69e6f359c31fe11b5196d Mon Sep 17 00:00:00 2001 From: 6174 Date: Fri, 26 Jan 2024 19:11:05 +0800 Subject: [PATCH 37/37] update npmrc --- .npmrc | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.npmrc b/.npmrc index 096cda1e..3fc8e580 100755 --- a/.npmrc +++ b/.npmrc @@ -1 +1,2 @@ -auto-install-peers = true +auto-install-peers = true +ELECTRON_MIRROR=http://npm.taobao.org/mirrors/electron/