Add custom nodes, Civitai loras (LFS), and vast.ai setup script
Some checks failed
Python Linting / Run Ruff (push) Has been cancelled
Python Linting / Run Pylint (push) Has been cancelled
Full Comfy CI Workflow Runs / test-stable (12.1, , linux, 3.10, [self-hosted Linux], stable) (push) Has been cancelled
Full Comfy CI Workflow Runs / test-stable (12.1, , linux, 3.11, [self-hosted Linux], stable) (push) Has been cancelled
Full Comfy CI Workflow Runs / test-stable (12.1, , linux, 3.12, [self-hosted Linux], stable) (push) Has been cancelled
Full Comfy CI Workflow Runs / test-unix-nightly (12.1, , linux, 3.11, [self-hosted Linux], nightly) (push) Has been cancelled
Execution Tests / test (macos-latest) (push) Has been cancelled
Execution Tests / test (ubuntu-latest) (push) Has been cancelled
Execution Tests / test (windows-latest) (push) Has been cancelled
Test server launches without errors / test (push) Has been cancelled
Unit Tests / test (macos-latest) (push) Has been cancelled
Unit Tests / test (ubuntu-latest) (push) Has been cancelled
Unit Tests / test (windows-2022) (push) Has been cancelled
Some checks failed
Python Linting / Run Ruff (push) Has been cancelled
Python Linting / Run Pylint (push) Has been cancelled
Full Comfy CI Workflow Runs / test-stable (12.1, , linux, 3.10, [self-hosted Linux], stable) (push) Has been cancelled
Full Comfy CI Workflow Runs / test-stable (12.1, , linux, 3.11, [self-hosted Linux], stable) (push) Has been cancelled
Full Comfy CI Workflow Runs / test-stable (12.1, , linux, 3.12, [self-hosted Linux], stable) (push) Has been cancelled
Full Comfy CI Workflow Runs / test-unix-nightly (12.1, , linux, 3.11, [self-hosted Linux], nightly) (push) Has been cancelled
Execution Tests / test (macos-latest) (push) Has been cancelled
Execution Tests / test (ubuntu-latest) (push) Has been cancelled
Execution Tests / test (windows-latest) (push) Has been cancelled
Test server launches without errors / test (push) Has been cancelled
Unit Tests / test (macos-latest) (push) Has been cancelled
Unit Tests / test (ubuntu-latest) (push) Has been cancelled
Unit Tests / test (windows-2022) (push) Has been cancelled
Includes 30 custom nodes committed directly, 7 Civitai-exclusive loras stored via Git LFS, and a setup script that installs all dependencies and downloads HuggingFace-hosted models on vast.ai. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
5
custom_nodes/ComfyUI-Crystools/web/comfy/index.d.ts
vendored
Normal file
5
custom_nodes/ComfyUI-Crystools/web/comfy/index.d.ts
vendored
Normal file
@@ -0,0 +1,5 @@
|
||||
export type * from './scripts.js';
|
||||
export * from './scripts.js';
|
||||
export type { ComfyApp } from './typings/comfy.js';
|
||||
export * from './liteGraph.js';
|
||||
export type * from './liteGraph.js';
|
||||
2
custom_nodes/ComfyUI-Crystools/web/comfy/index.js
Normal file
2
custom_nodes/ComfyUI-Crystools/web/comfy/index.js
Normal file
@@ -0,0 +1,2 @@
|
||||
export * from './scripts.js';
|
||||
export * from './liteGraph.js';
|
||||
5
custom_nodes/ComfyUI-Crystools/web/comfy/index.ts
Normal file
5
custom_nodes/ComfyUI-Crystools/web/comfy/index.ts
Normal file
@@ -0,0 +1,5 @@
|
||||
export type * from './scripts.js';
|
||||
export * from './scripts.js';
|
||||
export type { ComfyApp } from './typings/comfy.js';
|
||||
export * from './liteGraph.js';
|
||||
export type * from './liteGraph.js';
|
||||
19
custom_nodes/ComfyUI-Crystools/web/comfy/liteGraph.d.ts
vendored
Normal file
19
custom_nodes/ComfyUI-Crystools/web/comfy/liteGraph.d.ts
vendored
Normal file
@@ -0,0 +1,19 @@
|
||||
export type * from './liteGraph.types.js';
|
||||
import type { IWidget as IWidgetOld, LGraphNode as TypeGraphNode, TypeLiteGraph } from './liteGraph.types.js';
|
||||
declare const LGraphNode: typeof TypeGraphNode;
|
||||
export interface IWidget extends IWidgetOld {
|
||||
onRemove?: () => void;
|
||||
serializeValue?: () => Promise<void>;
|
||||
}
|
||||
export declare class TLGraphNode extends LGraphNode {
|
||||
static category: string;
|
||||
static shape: number;
|
||||
static color: string;
|
||||
static bgcolor: string;
|
||||
static collapsable: boolean;
|
||||
isVirtualNode?: boolean;
|
||||
widgets_values?: any[];
|
||||
name?: string;
|
||||
prototype: TLGraphNode;
|
||||
}
|
||||
export declare const LiteGraph: TypeLiteGraph;
|
||||
30
custom_nodes/ComfyUI-Crystools/web/comfy/liteGraph.js
Normal file
30
custom_nodes/ComfyUI-Crystools/web/comfy/liteGraph.js
Normal file
@@ -0,0 +1,30 @@
|
||||
export class TLGraphNode extends LGraphNode {
|
||||
constructor() {
|
||||
super(...arguments);
|
||||
Object.defineProperty(this, "isVirtualNode", {
|
||||
enumerable: true,
|
||||
configurable: true,
|
||||
writable: true,
|
||||
value: void 0
|
||||
});
|
||||
Object.defineProperty(this, "widgets_values", {
|
||||
enumerable: true,
|
||||
configurable: true,
|
||||
writable: true,
|
||||
value: void 0
|
||||
});
|
||||
Object.defineProperty(this, "name", {
|
||||
enumerable: true,
|
||||
configurable: true,
|
||||
writable: true,
|
||||
value: void 0
|
||||
});
|
||||
Object.defineProperty(this, "prototype", {
|
||||
enumerable: true,
|
||||
configurable: true,
|
||||
writable: true,
|
||||
value: void 0
|
||||
});
|
||||
}
|
||||
}
|
||||
export const LiteGraph = window.LiteGraph;
|
||||
32
custom_nodes/ComfyUI-Crystools/web/comfy/liteGraph.ts
Normal file
32
custom_nodes/ComfyUI-Crystools/web/comfy/liteGraph.ts
Normal file
@@ -0,0 +1,32 @@
|
||||
// / <reference path="/types/litegraph.d.ts" />
|
||||
// A LOTS OF PATCHES FOR LITEGRAPH TYPES ¯\_(ツ)_/¯
|
||||
export type * from './liteGraph.types.js';
|
||||
|
||||
import type { IWidget as IWidgetOld, LGraphNode as TypeGraphNode, TypeLiteGraph } from './liteGraph.types.js';
|
||||
|
||||
declare const LGraphNode: typeof TypeGraphNode; // just for get the type
|
||||
|
||||
export interface IWidget extends IWidgetOld {
|
||||
onRemove?: () => void;
|
||||
serializeValue?: () => Promise<void>;
|
||||
}
|
||||
|
||||
export class TLGraphNode extends LGraphNode {
|
||||
// on discovery...
|
||||
static category: string;
|
||||
static shape: number;
|
||||
static color: string;
|
||||
static bgcolor: string;
|
||||
static collapsable: boolean;
|
||||
|
||||
// widgets?: IWidget[];
|
||||
isVirtualNode?: boolean;
|
||||
// override onResize?: (size: [number, number]) => void;
|
||||
widgets_values?: any[];
|
||||
name?: string;
|
||||
|
||||
prototype: TLGraphNode; // yes itself
|
||||
}
|
||||
|
||||
// from globals
|
||||
export const LiteGraph: TypeLiteGraph = (window as any).LiteGraph;
|
||||
19
custom_nodes/ComfyUI-Crystools/web/comfy/liteGraph.types.d.ts
vendored
Normal file
19
custom_nodes/ComfyUI-Crystools/web/comfy/liteGraph.types.d.ts
vendored
Normal file
@@ -0,0 +1,19 @@
|
||||
// A LOTS OF PATCHES FOR LITEGRAPH TYPES ¯\_(ツ)_/¯
|
||||
import { LGraph } from './typings/litegraph.js';
|
||||
|
||||
export type * from './typings/litegraph.js';
|
||||
|
||||
export declare type TypeLiteGraph = typeof LiteGraph & {
|
||||
graph: LGraph;
|
||||
};
|
||||
|
||||
// export declare type ComfyApi = typeof api;
|
||||
export declare type ComfyNode = any;
|
||||
|
||||
// I prefer not use global, but if I change of opinion:
|
||||
// / <reference path="./types.ts" />
|
||||
// import { LGraphNode as TLGraphNode, LiteGraph as TLiteGraph } from '/types/litegraph';
|
||||
// export declare const LGraphNode: typeof TLGraphNode;
|
||||
// declare global {
|
||||
// const LGraphNode: LGraphNode;
|
||||
// }
|
||||
5
custom_nodes/ComfyUI-Crystools/web/comfy/scripts.d.ts
vendored
Normal file
5
custom_nodes/ComfyUI-Crystools/web/comfy/scripts.d.ts
vendored
Normal file
@@ -0,0 +1,5 @@
|
||||
export { ComfyWidgets } from '../../../scripts/widgets.js';
|
||||
export { app } from '../../../scripts/app.js';
|
||||
export { api } from '../../../scripts/api.js';
|
||||
export * as utils from '../../../scripts/utils.js';
|
||||
export { ComfyButtonGroup } from '../../../scripts/ui/components/buttonGroup.js';
|
||||
5
custom_nodes/ComfyUI-Crystools/web/comfy/scripts.js
Normal file
5
custom_nodes/ComfyUI-Crystools/web/comfy/scripts.js
Normal file
@@ -0,0 +1,5 @@
|
||||
export { ComfyWidgets } from '../../../scripts/widgets.js';
|
||||
export { app } from '../../../scripts/app.js';
|
||||
export { api } from '../../../scripts/api.js';
|
||||
export * as utils from '../../../scripts/utils.js';
|
||||
export { ComfyButtonGroup } from '../../../scripts/ui/components/buttonGroup.js';
|
||||
10
custom_nodes/ComfyUI-Crystools/web/comfy/scripts.ts
Normal file
10
custom_nodes/ComfyUI-Crystools/web/comfy/scripts.ts
Normal file
@@ -0,0 +1,10 @@
|
||||
// @ts-expect-error I could not find a way to make this work
|
||||
export { ComfyWidgets } from '../../../scripts/widgets.js';
|
||||
// @ts-expect-error I could not find a way to make this work
|
||||
export { app } from '../../../scripts/app.js';
|
||||
// @ts-expect-error I could not find a way to make this work
|
||||
export { api } from '../../../scripts/api.js';
|
||||
// @ts-expect-error I could not find a way to make this work
|
||||
export * as utils from '../../../scripts/utils.js';
|
||||
// @ts-expect-error I could not find a way to make this work
|
||||
export { ComfyButtonGroup } from '../../../scripts/ui/components/buttonGroup.js';
|
||||
@@ -0,0 +1,5 @@
|
||||
COPIED FROM rgthree
|
||||
|
||||
The typings in node_modules or in ComfyUI's web/ directory were not that well covered. These typings are hacked together with some of the inconsistencies I found.
|
||||
|
||||
To be honest, I have no idea why I needed a bizarre workaround for litegraph's types. Usually the '/// <reference>' comment should have picked up the types, but it wasn't having it. ¯\_(ツ)_/¯
|
||||
227
custom_nodes/ComfyUI-Crystools/web/comfy/typings/comfy.d.ts
vendored
Normal file
227
custom_nodes/ComfyUI-Crystools/web/comfy/typings/comfy.d.ts
vendored
Normal file
@@ -0,0 +1,227 @@
|
||||
import type { LGraphGroup as TLGraphGroup, LGraphNode as TLGraphNode, IWidget, SerializedLGraphNode, LGraph as TLGraph, LGraphCanvas as TLGraphCanvas, LiteGraph as TLiteGraph } from "./litegraph.js";
|
||||
import type {Constructor, SerializedGraph} from './index.js';
|
||||
|
||||
declare global {
|
||||
const LiteGraph: typeof TLiteGraph;
|
||||
const LGraph: typeof TLGraph;
|
||||
const LGraphNode: typeof TLGraphNode;
|
||||
const LGraphCanvas: typeof TLGraphCanvas;
|
||||
const LGraphGroup: typeof TLGraphGroup;
|
||||
}
|
||||
|
||||
// @rgthree: Types on ComfyApp as needed.
|
||||
export interface ComfyApp {
|
||||
extensions: ComfyExtension[];
|
||||
async queuePrompt(number?: number, batchCount = 1): Promise<void>;
|
||||
graph: TLGraph;
|
||||
canvas: TLGraphCanvas;
|
||||
clean() : void;
|
||||
registerExtension(extension: ComfyExtension): void;
|
||||
getPreviewFormatParam(): string;
|
||||
getRandParam(): string;
|
||||
loadApiJson(apiData: {}, fileName: string): void;
|
||||
async graphToPrompt(graph?: TLGraph, clean?: boolean): Promise<void>;
|
||||
// workflow: ComfyWorkflowInstance ???
|
||||
async loadGraphData(graphData: {}, clean?: boolean, restore_view?: boolean, workflow?: any|null): Promise<void>
|
||||
ui: {
|
||||
settings: {
|
||||
addSetting(config: {id: string, name: string, type: () => HTMLElement}) : void;
|
||||
}
|
||||
}
|
||||
// Just marking as any for now.
|
||||
menu?: any;
|
||||
}
|
||||
|
||||
export interface ComfyWidget extends IWidget {
|
||||
// https://github.com/comfyanonymous/ComfyUI/issues/2193 Changes from SerializedLGraphNode to
|
||||
// LGraphNode...
|
||||
serializeValue(nodeType: TLGraphNode, index: number): Promise<TValue>;
|
||||
afterQueued(): void;
|
||||
inputEl?: HTMLTextAreaElement;
|
||||
width: number;
|
||||
}
|
||||
|
||||
export interface ComfyGraphNode extends TLGraphNode {
|
||||
getExtraMenuOptions: (node: TLGraphNode, options: ContextMenuItem[]) => void;
|
||||
onExecuted(message: any): void;
|
||||
}
|
||||
|
||||
export interface ComfyNode extends TLGraphNode {
|
||||
comfyClass: string;
|
||||
}
|
||||
|
||||
// @rgthree
|
||||
export interface ComfyNodeConstructor extends Constructor<ComfyNode> {
|
||||
static title: string;
|
||||
static type?: string;
|
||||
static comfyClass: string;
|
||||
}
|
||||
|
||||
export type NodeMode = 0|1|2|3|4|undefined;
|
||||
|
||||
|
||||
export interface ComfyExtension {
|
||||
/**
|
||||
* The name of the extension
|
||||
*/
|
||||
name: string;
|
||||
/**
|
||||
* Allows any initialisation, e.g. loading resources. Called after the canvas is created but before nodes are added
|
||||
* @param app The ComfyUI app instance
|
||||
*/
|
||||
init?(app: ComfyApp): Promise<void>;
|
||||
/**
|
||||
* Allows any additonal setup, called after the application is fully set up and running
|
||||
* @param app The ComfyUI app instance
|
||||
*/
|
||||
setup?(app: ComfyApp): Promise<void>;
|
||||
/**
|
||||
* Called before nodes are registered with the graph
|
||||
* @param defs The collection of node definitions, add custom ones or edit existing ones
|
||||
* @param app The ComfyUI app instance
|
||||
*/
|
||||
addCustomNodeDefs?(defs: Record<string, ComfyObjectInfo>, app: ComfyApp): Promise<void>;
|
||||
/**
|
||||
* Allows the extension to add custom widgets
|
||||
* @param app The ComfyUI app instance
|
||||
* @returns An array of {[widget name]: widget data}
|
||||
*/
|
||||
getCustomWidgets?(
|
||||
app: ComfyApp
|
||||
): Promise<
|
||||
Record<string, (node, inputName, inputData, app) => { widget?: IWidget; minWidth?: number; minHeight?: number }>
|
||||
>;
|
||||
/**
|
||||
* Allows the extension to add additional handling to the node before it is registered with LGraph
|
||||
* @rgthree changed nodeType from `typeof LGraphNode` to `ComfyNodeConstructor`
|
||||
* @param nodeType The node class (not an instance)
|
||||
* @param nodeData The original node object info config object
|
||||
* @param app The ComfyUI app instance
|
||||
*/
|
||||
beforeRegisterNodeDef?(nodeType: ComfyNodeConstructor, nodeData: ComfyObjectInfo, app: ComfyApp): Promise<void>;
|
||||
/**
|
||||
* Allows the extension to register additional nodes with LGraph after standard nodes are added
|
||||
* @param app The ComfyUI app instance
|
||||
*/
|
||||
// @rgthree - add void for non async
|
||||
registerCustomNodes?(app: ComfyApp): void|Promise<void>;
|
||||
/**
|
||||
* Allows the extension to modify a node that has been reloaded onto the graph.
|
||||
* If you break something in the backend and want to patch workflows in the frontend
|
||||
* This is the place to do this
|
||||
* @param node The node that has been loaded
|
||||
* @param app The ComfyUI app instance
|
||||
*/
|
||||
loadedGraphNode?(node: TLGraphNode, app: ComfyApp);
|
||||
/**
|
||||
* Allows the extension to run code after the constructor of the node
|
||||
* @param node The node that has been created
|
||||
* @param app The ComfyUI app instance
|
||||
*/
|
||||
nodeCreated?(node: TLGraphNode, app: ComfyApp);
|
||||
}
|
||||
|
||||
export type ComfyObjectInfo = {
|
||||
name: string;
|
||||
display_name?: string;
|
||||
description?: string;
|
||||
category: string;
|
||||
input?: {
|
||||
required?: Record<string, ComfyObjectInfoConfig>;
|
||||
optional?: Record<string, ComfyObjectInfoConfig>;
|
||||
hidden?: Record<string, ComfyObjectInfoConfig>;
|
||||
};
|
||||
output?: string[];
|
||||
output_name: string[];
|
||||
// @rgthree
|
||||
output_node?: boolean;
|
||||
};
|
||||
|
||||
export type ComfyObjectInfoConfig = [string | any[]] | [string | any[], any];
|
||||
|
||||
// @rgthree
|
||||
type ComfyApiInputLink = [
|
||||
/** The id string of the connected node. */
|
||||
string,
|
||||
/** The output index. */
|
||||
number,
|
||||
]
|
||||
|
||||
// @rgthree
|
||||
export type ComfyApiFormatNode = {
|
||||
"inputs": {
|
||||
[input_name: string]: string|number|boolean|ComfyApiInputLink,
|
||||
},
|
||||
"class_type": string,
|
||||
"_meta": {
|
||||
"title": string,
|
||||
}
|
||||
}
|
||||
|
||||
// @rgthree
|
||||
export type ComfyApiFormat = {
|
||||
[node_id: string]: ComfyApiFormatNode
|
||||
}
|
||||
|
||||
// @rgthree
|
||||
export type ComfyApiPrompt = {
|
||||
workflow: SerializedGraph,
|
||||
output: ComfyApiFormat,
|
||||
}
|
||||
|
||||
// @rgthree
|
||||
export type ComfyApiEventDetailStatus = {
|
||||
exec_info: {
|
||||
queue_remaining: number;
|
||||
};
|
||||
};
|
||||
|
||||
// @rgthree
|
||||
export type ComfyApiEventDetailExecutionStart = {
|
||||
prompt_id: string;
|
||||
};
|
||||
|
||||
// @rgthree
|
||||
export type ComfyApiEventDetailExecuting = null | string;
|
||||
|
||||
// @rgthree
|
||||
export type ComfyApiEventDetailProgress = {
|
||||
node: string;
|
||||
prompt_id: string;
|
||||
max: number;
|
||||
value: number;
|
||||
};
|
||||
|
||||
// @rgthree
|
||||
export type ComfyApiEventDetailExecuted = {
|
||||
node: string;
|
||||
prompt_id: string;
|
||||
output: any;
|
||||
};
|
||||
|
||||
// @rgthree
|
||||
export type ComfyApiEventDetailCached = {
|
||||
nodes: string[];
|
||||
prompt_id: string;
|
||||
};
|
||||
|
||||
// @rgthree
|
||||
export type ComfyApiEventDetailExecuted = {
|
||||
prompt_id: string;
|
||||
node: string;
|
||||
output: any;
|
||||
};
|
||||
|
||||
// @rgthree
|
||||
export type ComfyApiEventDetailError = {
|
||||
prompt_id: string;
|
||||
exception_type: string;
|
||||
exception_message: string;
|
||||
node_id: string;
|
||||
node_type: string;
|
||||
node_id: string;
|
||||
traceback: string;
|
||||
executed: any[];
|
||||
current_inputs: {[key: string]: (number[]|string[])};
|
||||
current_outputs: {[key: string]: (number[]|string[])};
|
||||
}
|
||||
55
custom_nodes/ComfyUI-Crystools/web/comfy/typings/index.d.ts
vendored
Normal file
55
custom_nodes/ComfyUI-Crystools/web/comfy/typings/index.d.ts
vendored
Normal file
@@ -0,0 +1,55 @@
|
||||
import { LGraph } from "./litegraph.js";
|
||||
|
||||
export type Constructor<T> = new(...args: any[]) => T;
|
||||
|
||||
export type SerializedLink = [
|
||||
number, // this.id,
|
||||
number, // this.origin_id,
|
||||
number, // this.origin_slot,
|
||||
number, // this.target_id,
|
||||
number, // this.target_slot,
|
||||
string, // this.type
|
||||
];
|
||||
|
||||
export interface SerializedNodeInput {
|
||||
name: string;
|
||||
type: string;
|
||||
link: number;
|
||||
}
|
||||
export interface SerializedNodeOutput {
|
||||
name: string;
|
||||
type: string;
|
||||
link: number;
|
||||
slot_index: number;
|
||||
links: number[];
|
||||
}
|
||||
export interface SerializedNode {
|
||||
id: number;
|
||||
inputs: SerializedNodeInput[];
|
||||
outputs: SerializedNodeOutput[];
|
||||
mode: number;
|
||||
order: number;
|
||||
pos: [number, number];
|
||||
properties: any;
|
||||
size: [number, number];
|
||||
type: string;
|
||||
widgets_values: Array<number | string>;
|
||||
}
|
||||
|
||||
export interface SerializedGraph {
|
||||
config: any;
|
||||
extra: any;
|
||||
groups: any;
|
||||
last_link_id: number;
|
||||
last_node_id: number;
|
||||
links: SerializedLink[];
|
||||
nodes: SerializedNode[];
|
||||
}
|
||||
|
||||
export interface BadLinksData<T = SerializedGraph|LGraph> {
|
||||
hasBadLinks: boolean;
|
||||
fixed: boolean;
|
||||
graph: T;
|
||||
patched: number;
|
||||
deleted: number;
|
||||
}
|
||||
1750
custom_nodes/ComfyUI-Crystools/web/comfy/typings/litegraph.d.ts
vendored
Normal file
1750
custom_nodes/ComfyUI-Crystools/web/comfy/typings/litegraph.d.ts
vendored
Normal file
File diff suppressed because it is too large
Load Diff
Reference in New Issue
Block a user