- {/if}
- {/key}
- {/key}
+
+
+
+ {#if hidden && edit}
+
+ {/if}
+ {#if showHandles || hovered}
+
+ {/if}
{/if}
diff --git a/src/lib/nodes/ComfyGraphNode.ts b/src/lib/nodes/ComfyGraphNode.ts
index e03204a..e3698e8 100644
--- a/src/lib/nodes/ComfyGraphNode.ts
+++ b/src/lib/nodes/ComfyGraphNode.ts
@@ -118,7 +118,7 @@ export default class ComfyGraphNode extends LGraphNode {
}
get dragItem(): WidgetLayout | null {
- return layoutStates.getDragItemByNode(this);
+ return layoutStates.getDragItemByNode(this) as WidgetLayout;
}
get workflow(): ComfyBoxWorkflow | null {
diff --git a/src/lib/restoreParameters.ts b/src/lib/restoreParameters.ts
index 2274945..c350077 100644
--- a/src/lib/restoreParameters.ts
+++ b/src/lib/restoreParameters.ts
@@ -185,24 +185,23 @@ export function getWorkflowRestoreParamsFromWorkflow(workflow: ComfyBoxWorkflow,
return result
}
-export function getWorkflowRestoreParams(workflow: ComfyBoxWorkflow, prompt: SerializedLGraph): RestoreParamWorkflowNodeTargets {
+export function getWorkflowRestoreParams(serGraph: SerializedLGraph, noExclude: boolean = false): RestoreParamWorkflowNodeTargets {
const result = {}
- const graph = workflow.graph;
+ for (const node of serGraph.nodes) {
+ if (!isSerializedComfyWidgetNode(node))
+ continue;
- // Find nodes that correspond to *this* workflow exactly, since we can
- // easily match up the nodes between each (their IDs will be the same)
- for (const serNode of prompt.nodes) {
- const foundNode = graph.getNodeByIdRecursive(serNode.id);
- if (isComfyWidgetNode(foundNode) && foundNode.type === serNode.type) {
- const finalValue = (serNode as SerializedComfyWidgetNode).comfyValue;
- if (finalValue != null) {
- const source: RestoreParamSourceWorkflowNode = {
- type: "workflow",
- finalValue,
- }
- result[foundNode.id] = source;
+ if (!noExclude && node.properties.excludeFromJourney)
+ continue;
+
+ const finalValue = node.comfyValue
+ if (finalValue != null) {
+ const source: RestoreParamSourceWorkflowNode = {
+ type: "workflow",
+ finalValue,
}
+ result[node.id] = source;
}
}
@@ -250,10 +249,10 @@ export function getBackendRestoreParams(workflow: ComfyBoxWorkflow, prompt: Seri
return result
}
-export default function restoreParameters(workflow: ComfyBoxWorkflow, prompt: SerializedPrompt): RestoreParamTargets {
+export default function getRestoreParameters(workflow: ComfyBoxWorkflow, prompt: SerializedPrompt): RestoreParamTargets {
const result = {}
- const workflowParams = getWorkflowRestoreParams(workflow, prompt.workflow);
+ const workflowParams = getWorkflowRestoreParams(prompt.workflow);
concatRestoreParams(result, workflowParams);
const backendParams = getBackendRestoreParams(workflow, prompt);
diff --git a/src/lib/stores/journeyStates.ts b/src/lib/stores/journeyStates.ts
index 2719f83..0b7ec2e 100644
--- a/src/lib/stores/journeyStates.ts
+++ b/src/lib/stores/journeyStates.ts
@@ -185,7 +185,8 @@ function create() {
if (activeNode == null) {
// add root node
if (get(store).root != null) {
- return;
+ console.debug("[journeyStates] Root already exists")
+ return null;
}
journeyNode = addNode(workflowParams, null);
if (showNotification)
@@ -196,9 +197,10 @@ function create() {
const patch = calculateWorkflowParamsPatch(activeNode, workflowParams);
const patchedCount = Object.keys(patch).length;
if (patchedCount === 0) {
+ console.debug("[journeyStates] Patch had no diff")
if (showNotification)
notify("No changes were made to active parameters yet.", { type: "warning" })
- return;
+ return null;
}
journeyNode = addNode(patch, activeNode);
if (showNotification)
@@ -209,6 +211,7 @@ function create() {
selectNode(journeyNode);
}
+ console.debug("[journeyStates] added node", journeyNode)
return journeyNode;
}
@@ -268,6 +271,11 @@ function create() {
return;
// TODO
+ store.update(s => {
+ s.version += 1;
+ s.activeNodeID = journeyNode.id;
+ return s;
+ })
}
return {
diff --git a/src/lib/stores/uiQueueState.ts b/src/lib/stores/uiQueueState.ts
index a361c22..a295478 100644
--- a/src/lib/stores/uiQueueState.ts
+++ b/src/lib/stores/uiQueueState.ts
@@ -89,6 +89,13 @@ function convertEntry(entry: QueueEntry, status: QueueUIEntryStatus): QueueUIEnt
}
}
+export function getQueueEntryImages(queueEntry: QueueEntry): string[] {
+ return Object.values(queueEntry.outputs)
+ .filter(o => o.images)
+ .flatMap(o => o.images)
+ .map(convertComfyOutputToComfyURL);
+}
+
function convertPendingEntry(entry: QueueEntry, status: QueueUIEntryStatus): QueueUIEntry {
const result = convertEntry(entry, status);
@@ -97,10 +104,7 @@ function convertPendingEntry(entry: QueueEntry, status: QueueUIEntryStatus): Que
result.images = thumbnails.map(convertComfyOutputToComfyURL);
}
- const outputs = Object.values(entry.outputs)
- .filter(o => o.images)
- .flatMap(o => o.images)
- .map(convertComfyOutputToComfyURL);
+ const outputs = getQueueEntryImages(entry);
if (outputs) {
result.images = result.images.concat(outputs)
}
@@ -111,11 +115,7 @@ function convertPendingEntry(entry: QueueEntry, status: QueueUIEntryStatus): Que
function convertCompletedEntry(entry: CompletedQueueEntry): QueueUIEntry {
const result = convertEntry(entry.entry, entry.status);
- const images = Object.values(entry.entry.outputs)
- .filter(o => o.images)
- .flatMap(o => o.images)
- .map(convertComfyOutputToComfyURL);
- result.images = images
+ result.images = getQueueEntryImages(entry.entry)
if (entry.message)
result.submessage = entry.message
diff --git a/src/lib/stores/uiState.ts b/src/lib/stores/uiState.ts
index 5ee9a00..398616e 100644
--- a/src/lib/stores/uiState.ts
+++ b/src/lib/stores/uiState.ts
@@ -16,7 +16,7 @@ export type UIState = {
activeError: PromptID | null
- autoPushJourney: boolean
+ saveHistory: boolean
}
type UIStateOps = {
@@ -38,7 +38,7 @@ const store: Writable = writable(
activeError: null,
- autoPushJourney: true
+ saveHistory: true
})
function reconnecting() {