Shorten node source package name by remove ComfyUI prefix/suffix (#883)

* Shorten node source package name by remove ComfyUI prefix/suffix

* Update test expectations [skip ci]

---------

Co-authored-by: github-actions <github-actions@github.com>
This commit is contained in:
Chenlei Hu
2024-09-19 12:40:05 +09:00
committed by GitHub
parent 29d69338ef
commit b6dbe8f07b
10 changed files with 54 additions and 52 deletions

View File

@@ -10,6 +10,7 @@ import { TreeNode } from 'primevue/treenode'
import { buildTree } from '@/utils/treeUtil'
import { computed, ref } from 'vue'
import axios from 'axios'
import { type NodeSource, getNodeSource } from '@/types/nodeSource'
export class BaseInputSpec<T = any> {
name: string
@@ -194,6 +195,12 @@ export class ComfyNodeDefImpl {
@Transform(({ obj }) => ComfyNodeDefImpl.transformOutputSpec(obj))
output: ComfyOutputsSpec
@Transform(({ obj }) => getNodeSource(obj.python_module), {
toClassOnly: true
})
@Expose()
nodeSource: NodeSource
private static transformOutputSpec(obj: any): ComfyOutputsSpec {
const { output, output_is_list, output_name, output_tooltips } = obj
const result = output.map((type: string | any[], index: number) => {