diff --git a/src/lib/components/PromptDisplay.svelte b/src/lib/components/PromptDisplay.svelte index 8d9ef13..004b4bd 100644 --- a/src/lib/components/PromptDisplay.svelte +++ b/src/lib/components/PromptDisplay.svelte @@ -20,6 +20,7 @@ import JsonView from "./JsonView.svelte"; import type { ZodError } from "zod"; import { concatRestoreParams, getWorkflowRestoreParams, getWorkflowRestoreParamsUsingLayout, type RestoreParamTargets, type RestoreParamWorkflowNodeTargets } from "$lib/restoreParameters"; + import notify from "$lib/notify"; const splitLength = 50; @@ -38,9 +39,12 @@ $: { restoreParams = {} + // TODO exclude from both history and journey patch + const noExclude = true; + // TODO other sources than serialized workflow if (workflow != null) { - const workflowParams = getWorkflowRestoreParamsUsingLayout(workflow.workflow, workflow.layout) + const workflowParams = getWorkflowRestoreParamsUsingLayout(workflow.workflow, workflow.layout, noExclude) console.error("GETPARMS", workflowParams) restoreParams = concatRestoreParams(restoreParams, workflowParams); } @@ -158,6 +162,24 @@ } function doRestoreParams(e: CustomEvent) { + const activeWorkflow = workflowState.getActiveWorkflow(); + if (activeWorkflow == null) { + notify("No active workflow!", { type: "error" }) + } + + // TODO other param sources + const patch: RestoreParamWorkflowNodeTargets = {}; + + for (const [nodeID, sources] of Object.entries(restoreParams)) { + for (const source of sources) { + if (source.type === "workflow") { + patch[nodeID] = source; + } + } + } + + activeWorkflow.applyParamsPatch(patch); + closeModal(); } diff --git a/src/lib/stores/uiQueueState.ts b/src/lib/stores/uiQueueState.ts index f712db0..5517703 100644 --- a/src/lib/stores/uiQueueState.ts +++ b/src/lib/stores/uiQueueState.ts @@ -62,7 +62,7 @@ function convertEntry(entry: QueueEntry, status: QueueUIEntryStatus): QueueUIEnt const subgraphs: string[] | null = entry.extraData?.extra_pnginfo?.comfyBoxPrompt?.subgraphs; - let message = "Prompt"; + let message = `#${entry.number}: Prompt`; if (entry.extraData?.workflowTitle != null) { message = `${entry.extraData.workflowTitle}` } diff --git a/src/scss/global.scss b/src/scss/global.scss index 8e738b4..5df21c6 100644 --- a/src/scss/global.scss +++ b/src/scss/global.scss @@ -13,6 +13,10 @@ body { height: 100%; margin: 0px; font-family: Arial; + display: block; + position: absolute; + top: 0; + left: 0; } :root {