LCOV - code coverage report
Current view: top level - src/constants - essentialsNodes.ts Coverage Total Hit
Test: ComfyUI E2E Coverage Lines: 100.0 % 6 6
Test Date: 2026-11-17 04:17:53

            Line data    Source code
       1              : import { mapValues } from 'es-toolkit'
       2              : 
       3              : import { BLUEPRINT_TYPE_PREFIX } from '@/utils/blueprintUtils'
       4              : 
       5              : export type EssentialsMediaType = 'image' | 'video' | 'text' | 'audio' | '3d'
       6              : 
       7              : interface EssentialsPath {
       8              :   section: string
       9              :   subgroup?: string
      10              : }
      11              : 
      12              : export interface EssentialTile {
      13              :   icon?: string
      14              :   media?: EssentialsMediaType
      15              :   partnerLogo?: string
      16              :   /**
      17              :    * Backing ComfyUI node identifier resolved by the hover popover.
      18              :    *   - For NODEs and PARTNER/API nodes: pass the registered
      19              :    *     `name` (class key)
      20              :    *   - For BLUEPRINTs: pass `SubgraphBlueprint.<filename>` where
      21              :    *     `<filename>` is the bare blueprint JSON filename (no extension,
      22              :    *     no `local-` prefix), e.g. `Image Inpainting (Qwen-image)`.
      23              :    */
      24              :   nodeName: string
      25              : }
      26              : 
      27              : interface EssentialSubgroup {
      28              :   key: string
      29              :   media: EssentialsMediaType
      30              :   tiles: EssentialTile[]
      31              : }
      32              : 
      33              : export interface EssentialSection {
      34              :   key: string
      35              :   subgroups?: EssentialSubgroup[]
      36              :   tiles?: EssentialTile[]
      37              : }
      38              : 
      39        94240 : function blueprint(name: string) {
      40        94240 :   return BLUEPRINT_TYPE_PREFIX + name
      41              : }
      42              : 
      43         2356 : export const ESSENTIAL_SECTIONS: EssentialSection[] = [
      44              :   {
      45              :     key: 'inputs-outputs',
      46              :     tiles: [
      47              :       {
      48              :         icon: 'icon-s1.5-[lucide--image-up]',
      49              :         media: 'image',
      50              :         nodeName: 'LoadImage'
      51              :       },
      52              :       {
      53              :         icon: 'icon-s1.5-[lucide--image-down]',
      54              :         media: 'image',
      55              :         nodeName: 'SaveImage'
      56              :       },
      57              :       {
      58              :         icon: 'icon-[comfy--load-video]',
      59              :         media: 'video',
      60              :         nodeName: 'LoadVideo'
      61              :       },
      62              :       {
      63              :         icon: 'icon-[comfy--save-video]',
      64              :         media: 'video',
      65              :         nodeName: 'SaveVideo'
      66              :       },
      67              :       {
      68              :         icon: 'icon-[comfy--load-3d]',
      69              :         media: '3d',
      70              :         nodeName: 'Load3D'
      71              :       },
      72              :       {
      73              :         icon: 'icon-[comfy--save-3d]',
      74              :         media: '3d',
      75              :         nodeName: 'SaveGLB'
      76              :       },
      77              :       {
      78              :         icon: 'icon-[comfy--load-audio]',
      79              :         media: 'audio',
      80              :         nodeName: 'LoadAudio'
      81              :       },
      82              :       {
      83              :         icon: 'icon-[comfy--save-audio]',
      84              :         media: 'audio',
      85              :         nodeName: 'SaveAudioAdvanced'
      86              :       },
      87              :       {
      88              :         icon: 'icon-s1.5-[lucide--text]',
      89              :         media: 'text',
      90              :         nodeName: 'PrimitiveStringMultiline'
      91              :       },
      92              :       {
      93              :         icon: 'icon-s1.5-[lucide--text]',
      94              :         media: 'text',
      95              :         nodeName: 'PreviewAny'
      96              :       },
      97              :       {
      98              :         icon: 'icon-[comfy--lora-loader]',
      99              :         media: 'image',
     100              :         nodeName: 'LoraLoader'
     101              :       }
     102              :     ]
     103              :   },
     104              :   {
     105              :     key: 'generate',
     106              :     subgroups: [
     107              :       {
     108              :         key: 'generate-image',
     109              :         media: 'image',
     110              :         tiles: [
     111              :           {
     112              :             icon: 'icon-[comfy--text-to-image]',
     113              :             partnerLogo: 'icon-[comfy--gemini]',
     114              :             nodeName: 'GeminiImageNode'
     115              :           },
     116              :           {
     117              :             icon: 'icon-[comfy--image-edit]',
     118              :             partnerLogo: 'icon-[comfy--grok]',
     119              :             nodeName: 'GrokImageEditNodeV2'
     120              :           },
     121              :           {
     122              :             icon: 'icon-[comfy--text-to-image]',
     123              :             partnerLogo: 'icon-[comfy--bytedance]',
     124              :             nodeName: 'ByteDanceSeedreamNode'
     125              :           },
     126              :           {
     127              :             icon: 'icon-[comfy--text-to-image]',
     128              :             nodeName: blueprint('Text to Image (Z-Image-Turbo)')
     129              :           },
     130              :           {
     131              :             icon: 'icon-[comfy--image-edit]',
     132              :             nodeName: blueprint('Image Edit (Qwen 2511)')
     133              :           },
     134              :           {
     135              :             icon: 'icon-[comfy--image-inpaint]',
     136              :             nodeName: blueprint('Image Inpainting (Qwen-image)')
     137              :           },
     138              :           {
     139              :             icon: 'icon-[comfy--image-outpaint]',
     140              :             nodeName: blueprint('Image Outpainting (Qwen-Image)')
     141              :           },
     142              :           {
     143              :             icon: 'icon-[comfy--image-to-layers]',
     144              :             nodeName: blueprint('Image to Layers(Qwen-Image-Layered)')
     145              :           },
     146              :           {
     147              :             icon: 'icon-[comfy--image-vectorize]',
     148              :             partnerLogo: 'icon-[comfy--recraft]',
     149              :             nodeName: 'RecraftVectorizeImageNode'
     150              :           },
     151              :           {
     152              :             icon: 'icon-[comfy--pose-to-image]',
     153              :             nodeName: blueprint('Pose to Image (Z-Image-Turbo)')
     154              :           },
     155              :           {
     156              :             icon: 'icon-[comfy--canny-to-image]',
     157              :             nodeName: blueprint('Canny to Image (Z-Image-Turbo)')
     158              :           },
     159              :           {
     160              :             icon: 'icon-[comfy--depth-to-image]',
     161              :             nodeName: blueprint('Depth to Image (Z-Image-Turbo)')
     162              :           }
     163              :         ]
     164              :       },
     165              :       {
     166              :         key: 'generate-video',
     167              :         media: 'video',
     168              :         tiles: [
     169              :           {
     170              :             icon: 'icon-[comfy--text-to-video]',
     171              :             partnerLogo: 'icon-[comfy--grok]',
     172              :             nodeName: 'GrokVideoNode'
     173              :           },
     174              :           {
     175              :             icon: 'icon-[comfy--image-to-video]',
     176              :             partnerLogo: 'icon-[comfy--kling]',
     177              :             nodeName: 'KlingImage2VideoNode'
     178              :           },
     179              :           {
     180              :             icon: 'icon-[comfy--image-to-video]',
     181              :             partnerLogo: 'icon-[comfy--bytedance]',
     182              :             nodeName: 'ByteDance2ReferenceNode'
     183              :           },
     184              :           {
     185              :             icon: 'icon-[comfy--text-to-video]',
     186              :             nodeName: blueprint('Text to Video (Wan 2.2)')
     187              :           },
     188              :           {
     189              :             icon: 'icon-[comfy--image-to-video]',
     190              :             nodeName: blueprint('Image to Video (Wan 2.2)')
     191              :           },
     192              :           {
     193              :             icon: 'icon-[comfy--image-to-video]',
     194              :             nodeName: blueprint('First-Last-Frame to Video')
     195              :           },
     196              :           {
     197              :             icon: 'icon-[comfy--video-edit]',
     198              :             partnerLogo: 'icon-[comfy--kling]',
     199              :             nodeName: 'KlingOmniProEditVideoNode'
     200              :           },
     201              :           {
     202              :             icon: 'icon-s1.5-[lucide--mic-vocal]',
     203              :             partnerLogo: 'icon-[comfy--kling]',
     204              :             nodeName: 'KlingLipSyncAudioToVideoNode'
     205              :           },
     206              :           {
     207              :             icon: 'icon-[comfy--video-inpaint]',
     208              :             nodeName: blueprint('Video Inpainting (Wan2.1 VACE)')
     209              :           },
     210              :           {
     211              :             icon: 'icon-[comfy--pose-to-video]',
     212              :             nodeName: blueprint('Pose to Video (LTX 2.0)')
     213              :           },
     214              :           {
     215              :             icon: 'icon-[comfy--canny-to-video]',
     216              :             nodeName: blueprint('Canny to Video (LTX 2.0)')
     217              :           },
     218              :           {
     219              :             icon: 'icon-[comfy--depth-to-video]',
     220              :             nodeName: blueprint('Depth to Video (ltx 2.0)')
     221              :           }
     222              :         ]
     223              :       },
     224              :       {
     225              :         key: 'generate-text',
     226              :         media: 'text',
     227              :         tiles: [
     228              :           {
     229              :             icon: 'icon-[comfy--text-prompt-enhance]',
     230              :             partnerLogo: 'icon-[comfy--gemini]',
     231              :             nodeName: 'GeminiNode'
     232              :           },
     233              :           {
     234              :             icon: 'icon-[comfy--text-prompt-enhance]',
     235              :             partnerLogo: 'icon-[comfy--claude]',
     236              :             nodeName: 'ClaudeNode'
     237              :           },
     238              :           {
     239              :             icon: 'icon-[comfy--text-prompt-enhance]',
     240              :             nodeName: blueprint('Prompt Enhance')
     241              :           },
     242              :           {
     243              :             icon: 'icon-[comfy--image-captioning]',
     244              :             nodeName: blueprint('Image Captioning (gemini)')
     245              :           },
     246              :           {
     247              :             icon: 'icon-[comfy--video-captioning]',
     248              :             nodeName: blueprint('Video Captioning (Gemini)')
     249              :           }
     250              :         ]
     251              :       },
     252              :       {
     253              :         key: 'generate-audio',
     254              :         media: 'audio',
     255              :         tiles: [
     256              :           {
     257              :             icon: 'icon-[comfy--text-to-audio]',
     258              :             nodeName: blueprint('Text to Audio (ACE-Step 1.5)')
     259              :           },
     260              :           {
     261              :             icon: 'icon-s1.5-[lucide--speech]',
     262              :             partnerLogo: 'icon-[comfy--elevenlabs]',
     263              :             nodeName: 'ElevenLabsTextToSpeech'
     264              :           },
     265              :           {
     266              :             icon: 'icon-[comfy--voice-clone]',
     267              :             partnerLogo: 'icon-[comfy--elevenlabs]',
     268              :             nodeName: 'ElevenLabsInstantVoiceClone'
     269              :           }
     270              :         ]
     271              :       },
     272              :       {
     273              :         key: 'generate-3d',
     274              :         media: '3d',
     275              :         tiles: [
     276              :           {
     277              :             icon: 'icon-[comfy--text-to-3d]',
     278              :             partnerLogo: 'icon-[comfy--tencent]',
     279              :             nodeName: 'TencentTextToModelNode'
     280              :           },
     281              :           {
     282              :             icon: 'icon-[comfy--image-to-3d]',
     283              :             nodeName: blueprint('Image to Model (Hunyuan3d 2.1)')
     284              :           }
     285              :         ]
     286              :       }
     287              :     ]
     288              :   },
     289              :   {
     290              :     key: 'control-guidance',
     291              :     subgroups: [
     292              :       {
     293              :         key: 'control-image',
     294              :         media: 'image',
     295              :         tiles: [
     296              :           {
     297              :             icon: 'icon-[comfy--image-canny]',
     298              :             nodeName: 'Canny'
     299              :           }
     300              :         ]
     301              :       }
     302              :     ]
     303              :   },
     304              :   {
     305              :     key: 'editing-utilities',
     306              :     subgroups: [
     307              :       {
     308              :         key: 'image-transform',
     309              :         media: 'image',
     310              :         tiles: [
     311              :           {
     312              :             icon: 'icon-s1.5-[lucide--crop]',
     313              :             nodeName: 'ImageCropV2'
     314              :           },
     315              :           {
     316              :             icon: 'icon-s1.5-[lucide--crop]',
     317              :             nodeName: blueprint('Crop Images 2x2')
     318              :           },
     319              :           {
     320              :             icon: 'icon-s1.5-[lucide--crop]',
     321              :             nodeName: blueprint('Crop Images 3x3')
     322              :           },
     323              :           {
     324              :             icon: 'icon-[comfy--image-upscale]',
     325              :             nodeName: 'ImageScale'
     326              :           },
     327              :           {
     328              :             icon: 'icon-[comfy--image-upscale]',
     329              :             nodeName: blueprint('Image Upscale(Z-image-Turbo)')
     330              :           },
     331              :           {
     332              :             icon: 'icon-[comfy--image-rotate]',
     333              :             nodeName: 'ImageRotate'
     334              :           },
     335              :           {
     336              :             icon: 'icon-[comfy--image-collage]',
     337              :             nodeName: 'ImageStitch'
     338              :           }
     339              :         ]
     340              :       },
     341              :       {
     342              :         key: 'image-utilities',
     343              :         media: 'image',
     344              :         tiles: [
     345              :           {
     346              :             icon: 'icon-[comfy--image-batch]',
     347              :             nodeName: 'BatchImagesNode'
     348              :           },
     349              :           {
     350              :             icon: 'icon-[comfy--image-compare]',
     351              :             nodeName: 'ImageCompare'
     352              :           },
     353              :           {
     354              :             icon: 'icon-[comfy--frames-to-video]',
     355              :             nodeName: 'CreateVideo'
     356              :           }
     357              :         ]
     358              :       },
     359              :       {
     360              :         key: 'image-filters-effects',
     361              :         media: 'image',
     362              :         tiles: [
     363              :           {
     364              :             icon: 'icon-[comfy--image-invert]',
     365              :             nodeName: 'ImageInvert'
     366              :           },
     367              :           {
     368              :             icon: 'icon-[comfy--chromatic-aberration]',
     369              :             nodeName: blueprint('Chromatic Aberration')
     370              :           },
     371              :           {
     372              :             icon: 'icon-[comfy--grain]',
     373              :             nodeName: blueprint('Film Grain')
     374              :           },
     375              :           {
     376              :             icon: 'icon-[comfy--glow]',
     377              :             nodeName: blueprint('Glow')
     378              :           },
     379              :           {
     380              :             icon: 'icon-[comfy--image-sharpen]',
     381              :             nodeName: blueprint('Sharpen')
     382              :           },
     383              :           {
     384              :             icon: 'icon-[comfy--image-blur]',
     385              :             nodeName: blueprint('Image Blur')
     386              :           },
     387              :           {
     388              :             icon: 'icon-[comfy--image-shader]',
     389              :             nodeName: 'GLSLShader'
     390              :           }
     391              :         ]
     392              :       },
     393              :       {
     394              :         key: 'image-color',
     395              :         media: 'image',
     396              :         tiles: [
     397              :           {
     398              :             icon: 'icon-[comfy--brightness-contrast]',
     399              :             nodeName: blueprint('Brightness and Contrast')
     400              :           },
     401              :           {
     402              :             icon: 'icon-[comfy--dial]',
     403              :             nodeName: blueprint('Hue and Saturation')
     404              :           },
     405              :           {
     406              :             icon: 'icon-s1.5-[lucide--sliders-horizontal]',
     407              :             nodeName: blueprint('Color Balance')
     408              :           },
     409              :           {
     410              :             icon: 'icon-s1.5-[lucide--chart-spline]',
     411              :             nodeName: blueprint('Color Curves')
     412              :           },
     413              :           {
     414              :             icon: 'icon-s1.5-[lucide--sliders-horizontal]',
     415              :             nodeName: blueprint('Image Levels')
     416              :           },
     417              :           {
     418              :             icon: 'icon-[comfy--channels]',
     419              :             nodeName: blueprint('Image Channels')
     420              :           },
     421              :           {
     422              :             icon: 'icon-s1.5-[lucide--sliders-horizontal]',
     423              :             nodeName: blueprint('Color Adjustment')
     424              :           }
     425              :         ]
     426              :       },
     427              :       {
     428              :         key: 'image-selection-masking',
     429              :         media: 'image',
     430              :         tiles: [
     431              :           {
     432              :             icon: 'icon-[comfy--image-select-object-segmentation]',
     433              :             nodeName: blueprint('Image Segmentation (SAM3)')
     434              :           },
     435              :           {
     436              :             icon: 'icon-[comfy--image-remove-background]',
     437              :             partnerLogo: 'icon-[comfy--recraft]',
     438              :             nodeName: 'RecraftRemoveBackgroundNode'
     439              :           }
     440              :         ]
     441              :       },
     442              :       {
     443              :         key: 'video-transform',
     444              :         media: 'video',
     445              :         tiles: [
     446              :           {
     447              :             icon: 'icon-[comfy--video-trim]',
     448              :             nodeName: 'Video Slice'
     449              :           },
     450              :           {
     451              :             icon: 'icon-[comfy--video-upscale]',
     452              :             partnerLogo: 'icon-[comfy--topaz]',
     453              :             nodeName: 'TopazVideoEnhanceV2'
     454              :           }
     455              :         ]
     456              :       },
     457              :       {
     458              :         key: 'video-compose',
     459              :         media: 'video',
     460              :         tiles: [
     461              :           {
     462              :             icon: 'icon-[comfy--video-split-screen]',
     463              :             nodeName: blueprint('Video Stitch')
     464              :           },
     465              :           {
     466              :             icon: 'icon-[comfy--video-extract-frame]',
     467              :             nodeName: blueprint('Get Any Video Frame')
     468              :           },
     469              :           {
     470              :             icon: 'icon-[comfy--video-interpolation]',
     471              :             nodeName: blueprint('Frame Interpolation')
     472              :           }
     473              :         ]
     474              :       },
     475              :       {
     476              :         key: 'video-selection-masking',
     477              :         media: 'video',
     478              :         tiles: [
     479              :           {
     480              :             icon: 'icon-[comfy--video-select-object-segmentation]',
     481              :             nodeName: blueprint('Video Segmentation (SAM3)')
     482              :           }
     483              :         ]
     484              :       },
     485              :       {
     486              :         key: '3d-transform',
     487              :         media: '3d',
     488              :         tiles: [
     489              :           {
     490              :             icon: 'icon-s1.5-[lucide--package-open]',
     491              :             partnerLogo: 'icon-[comfy--tencent]',
     492              :             nodeName: 'TencentModelTo3DUVNode'
     493              :           },
     494              :           {
     495              :             icon: 'icon-[comfy--3d-decomp]',
     496              :             partnerLogo: 'icon-[comfy--tencent]',
     497              :             nodeName: 'Tencent3DPartNode'
     498              :           }
     499              :         ]
     500              :       }
     501              :     ]
     502              :   }
     503              : ]
     504              : 
     505         2356 : const NODE_TO_ESSENTIALS_PATH: Record<string, EssentialsPath> =
     506              :   Object.fromEntries(
     507              :     ESSENTIAL_SECTIONS.flatMap(
     508              :       (section) =>
     509              :         section.subgroups?.flatMap((sg) =>
     510              :           sg.tiles.map((t) => [
     511              :             t.nodeName,
     512              :             { section: section.key, subgroup: sg.key }
     513              :           ])
     514              :         ) ??
     515              :         section.tiles?.map((t) => [t.nodeName, { section: section.key }]) ??
     516              :         []
     517              :     )
     518              :   )
     519              : 
     520         2356 : export const NODE_TO_ESSENTIALS_CATEGORY: Record<string, string> = mapValues(
     521              :   NODE_TO_ESSENTIALS_PATH,
     522              :   (v) => v.subgroup ?? v.section
     523              : )
     524              : 
     525         2356 : export const TOOLKIT_NODES = new Set(
     526              :   Object.entries(NODE_TO_ESSENTIALS_PATH)
     527              :     .filter(([, path]) => path.section !== 'inputs-outputs')
     528              :     .map(([type]) => type)
     529              : )
        

Generated by: LCOV version 2.0-1