diff --git a/litegraph b/litegraph index b7ebbf5..a5e7911 160000 --- a/litegraph +++ b/litegraph @@ -1 +1 @@ -Subproject commit b7ebbf57d3b08a1a859809f8f95e1c37e841406a +Subproject commit a5e7911ae74595d667f488849185e1b64e31f765 diff --git a/package.json b/package.json index 219d603..1199f9f 100644 --- a/package.json +++ b/package.json @@ -37,9 +37,11 @@ "@gradio/atoms": "workspace:*", "@gradio/button": "workspace:*", "@gradio/client": "workspace:*", + "@gradio/file": "workspace:*", "@gradio/form": "workspace:*", "@gradio/gallery": "workspace:*", "@gradio/icons": "workspace:*", + "@gradio/image": "workspace:*", "@gradio/tabs": "workspace:*", "@gradio/theme": "workspace:*", "@gradio/upload": "workspace:*", diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 7ce7654..00d8ec4 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -16,6 +16,9 @@ importers: '@gradio/client': specifier: workspace:* version: link:gradio/client/js + '@gradio/file': + specifier: workspace:* + version: link:gradio/js/file '@gradio/form': specifier: workspace:* version: link:gradio/js/form @@ -25,6 +28,9 @@ importers: '@gradio/icons': specifier: workspace:* version: link:gradio/js/icons + '@gradio/image': + specifier: workspace:* + version: link:gradio/js/image '@gradio/tabs': specifier: workspace:* version: link:gradio/js/tabs diff --git a/src/lib/components/AccordionContainer.svelte b/src/lib/components/AccordionContainer.svelte index 64ff363..8cd307a 100644 --- a/src/lib/components/AccordionContainer.svelte +++ b/src/lib/components/AccordionContainer.svelte @@ -78,7 +78,7 @@
{#if item[SHADOW_ITEM_MARKER_PROPERTY_NAME]} @@ -183,6 +183,7 @@ .animation-wrapper { position: relative; flex-grow: 100; + flex-basis: 0; } .handle-widget:hover { diff --git a/src/lib/components/BlockContainer.svelte b/src/lib/components/BlockContainer.svelte index 10520f3..09172c9 100644 --- a/src/lib/components/BlockContainer.svelte +++ b/src/lib/components/BlockContainer.svelte @@ -80,7 +80,7 @@
{#if item[SHADOW_ITEM_MARKER_PROPERTY_NAME]} @@ -238,6 +238,7 @@ .animation-wrapper { position: relative; flex-grow: 100; + flex-basis: 0; } .handle-hidden { diff --git a/src/lib/components/ComfyApp.svelte b/src/lib/components/ComfyApp.svelte index f54ddfa..3ed280d 100644 --- a/src/lib/components/ComfyApp.svelte +++ b/src/lib/components/ComfyApp.svelte @@ -49,14 +49,15 @@ resizeTimeout = setTimeout(app.resizeCanvas.bind(app), 250); } - function queuePrompt() { - console.log("Queuing!"); - const workflow = $layoutState.attrs.defaultSubgraph; - app.queuePrompt(0, 1, workflow); - } + $: if (app?.lCanvas) { + app.lCanvas.allow_dragnodes = $uiState.uiUnlocked; + app.lCanvas.allow_interaction = $uiState.uiUnlocked; - $: if (app?.lCanvas) app.lCanvas.allow_dragnodes = !$uiState.nodesLocked; - $: if (app?.lCanvas) app.lCanvas.allow_interaction = !$uiState.graphLocked; + if (!$uiState.uiUnlocked) { + app.lCanvas.deselectAllNodes(); + $layoutState.currentSelectionNodes = [] + } + } $: if ($uiState.uiEditMode) $layoutState.currentSelection = [] @@ -240,9 +241,6 @@
- diff --git a/src/lib/components/ComfyApp.ts b/src/lib/components/ComfyApp.ts index e957273..671987c 100644 --- a/src/lib/components/ComfyApp.ts +++ b/src/lib/components/ComfyApp.ts @@ -131,6 +131,10 @@ export default class ComfyApp { LiteGraph.release_link_on_empty_shows_menu = true; LiteGraph.alt_drag_do_clone_nodes = true; + const uiUnlocked = get(uiState).uiUnlocked; + this.lCanvas.allow_dragnodes = uiUnlocked; + this.lCanvas.allow_interaction = uiUnlocked; + (window as any).LiteGraph = LiteGraph; // await this.#invokeExtensionsAsync("init"); @@ -542,6 +546,11 @@ export default class ComfyApp { // nodes have conditional logic that determines which link // to follow backwards. while (isFrontendParent(parent)) { + if (!("getUpstreamLink" in parent)) { + console.warn("[graphToPrompt] Node does not support getUpstreamLink", parent.type) + break; + } + const nextLink = parent.getUpstreamLink() if (nextLink == null) { console.warn("[graphToPrompt] No upstream link found in frontend node", parent) @@ -715,7 +724,8 @@ export default class ComfyApp { comfyInput.config.values = def["input"]["required"][comfyInput.name][0]; const inputNode = node.getInputNode(index) - if (inputNode && "doAutoConfig" in inputNode) { + if (inputNode && "doAutoConfig" in inputNode && comfyInput.widgetNodeType === inputNode.type) { + console.debug("[ComfyApp] Reconfiguring combo widget", inputNode.type, comfyInput.config.values) const comfyComboNode = inputNode as nodes.ComfyComboNode; comfyComboNode.doAutoConfig(comfyInput) if (!comfyInput.config.values.includes(get(comfyComboNode.value))) { diff --git a/src/lib/components/TabsContainer.svelte b/src/lib/components/TabsContainer.svelte index 1f163be..22925fe 100644 --- a/src/lib/components/TabsContainer.svelte +++ b/src/lib/components/TabsContainer.svelte @@ -92,7 +92,7 @@
+ style={item?.attrs?.style || ""}>