Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Enable ts-strict for uploadImage.ts #1280

Merged
merged 1 commit into from
Oct 23, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading