Skip to content

Commit

Permalink
Update litegraph 0.8.72 (#2470)
Browse files Browse the repository at this point in the history
  • Loading branch information
huchenlei authored Feb 8, 2025
1 parent 9e37738 commit 88a969d
Show file tree
Hide file tree
Showing 5 changed files with 18 additions and 12 deletions.
8 changes: 4 additions & 4 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@
"dependencies": {
"@atlaskit/pragmatic-drag-and-drop": "^1.3.1",
"@comfyorg/comfyui-electron-types": "^0.4.16",
"@comfyorg/litegraph": "^0.8.71",
"@comfyorg/litegraph": "^0.8.72",
"@primevue/forms": "^4.2.5",
"@primevue/themes": "^4.2.5",
"@sentry/vue": "^8.48.0",
Expand Down
5 changes: 3 additions & 2 deletions src/extensions/core/load3d.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
// @ts-strict-ignore
import { IWidget } from '@comfyorg/litegraph'
import type { IStringWidget } from '@comfyorg/litegraph/dist/types/widgets'
import { nextTick } from 'vue'

import Load3DConfiguration from '@/extensions/core/load3d/Load3DConfiguration'
Expand Down Expand Up @@ -65,7 +66,7 @@ app.registerExtension({
if (fileInput.files?.length) {
const modelWidget = node.widgets?.find(
(w: IWidget) => w.name === 'model_file'
)
) as IStringWidget
const uploadPath = await Load3dUtils.uploadFile(
load3d,
fileInput.files[0],
Expand Down Expand Up @@ -234,7 +235,7 @@ app.registerExtension({
if (fileInput.files?.length) {
const modelWidget = node.widgets?.find(
(w: IWidget) => w.name === 'model_file'
)
) as IStringWidget
const uploadPath = await Load3dUtils.uploadFile(
load3d,
fileInput.files[0],
Expand Down
7 changes: 4 additions & 3 deletions src/extensions/core/uploadAudio.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
// @ts-strict-ignore
import type { IWidget } from '@comfyorg/litegraph'
import type { IStringWidget } from '@comfyorg/litegraph/dist/types/widgets'

import type { DOMWidget } from '@/scripts/domWidget'
import { useToastStore } from '@/stores/toastStore'
Expand Down Expand Up @@ -37,7 +38,7 @@ function getResourceURL(
}

async function uploadFile(
audioWidget: IWidget,
audioWidget: IStringWidget,
audioUIWidget: DOMWidget<HTMLAudioElement, string>,
file: File,
updateNode: boolean,
Expand Down Expand Up @@ -151,9 +152,9 @@ app.registerExtension({
return {
AUDIOUPLOAD(node, inputName: string) {
// The widget that allows user to select file.
const audioWidget: IWidget = node.widgets.find(
const audioWidget = node.widgets.find(
(w: IWidget) => w.name === 'audio'
)
) as IStringWidget
const audioUIWidget = node.widgets.find(
(w: IWidget) => w.name === 'audioUI'
) as unknown as DOMWidget<HTMLAudioElement, string>
Expand Down
8 changes: 6 additions & 2 deletions src/scripts/widgets.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,10 @@
// @ts-strict-ignore
import type { LGraphNode } from '@comfyorg/litegraph'
import type { IWidget } from '@comfyorg/litegraph'
import type {
IComboWidget,
IStringWidget
} from '@comfyorg/litegraph/dist/types/widgets'
import { Editor as TiptapEditor } from '@tiptap/core'
import TiptapLink from '@tiptap/extension-link'
import TiptapTable from '@tiptap/extension-table'
Expand Down Expand Up @@ -568,7 +572,7 @@ export const ComfyWidgets: Record<string, ComfyWidgetConstructor> = {
const res = {
widget: node.addWidget('combo', inputName, defaultValue, () => {}, {
values: options ?? inputData[0]
})
}) as IComboWidget
}

if (type === 'remote') {
Expand Down Expand Up @@ -617,7 +621,7 @@ export const ComfyWidgets: Record<string, ComfyWidgetConstructor> = {
// TODO make image upload handle a custom node type?
const imageWidget = node.widgets.find(
(w) => w.name === (inputData[1]?.widget ?? 'image')
)
) as IStringWidget
let uploadWidget

function showImage(name) {
Expand Down

0 comments on commit 88a969d

Please sign in to comment.