Skip to content

Commit

Permalink
Enable ts-strict for uploadImage.ts (#1280)
Browse files Browse the repository at this point in the history
  • Loading branch information
huchenlei authored Oct 23, 2024
1 parent 59c03d2 commit 5db757a
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 4 deletions.
3 changes: 1 addition & 2 deletions src/extensions/core/uploadImage.ts
Original file line number Diff line number Diff line change
@@ -1,12 +1,11 @@
// @ts-strict-ignore
import { app } from '../../scripts/app'
import { ComfyNodeDef } from '@/types/apiTypes'

// Adds an upload button to the nodes

app.registerExtension({
name: 'Comfy.UploadImage',
async beforeRegisterNodeDef(nodeType, nodeData: ComfyNodeDef, app) {
beforeRegisterNodeDef(nodeType, nodeData: ComfyNodeDef) {
if (nodeData?.input?.required?.image?.[1]?.image_upload === true) {
nodeData.input.required.upload = ['IMAGEUPLOAD']
}
Expand Down
7 changes: 5 additions & 2 deletions src/types/comfy.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ export interface ComfyExtension {
* @param app The ComfyUI app instance
*/
addCustomNodeDefs?(
defs: Record<string, ComfyObjectInfo>,
defs: Record<string, ComfyNodeDef>,
app: ComfyApp
): Promise<void> | void
/**
Expand All @@ -76,7 +76,7 @@ export interface ComfyExtension {
*/
beforeRegisterNodeDef?(
nodeType: typeof LGraphNode,
nodeData: ComfyObjectInfo,
nodeData: ComfyNodeDef,
app: ComfyApp
): Promise<void> | void

Expand Down Expand Up @@ -114,6 +114,9 @@ export interface ComfyExtension {
[key: string]: any
}

/**
* @deprecated Use ComfyNodeDef instead
*/
export type ComfyObjectInfo = {
name: string
display_name?: string
Expand Down

0 comments on commit 5db757a

Please sign in to comment.