LCOV - code coverage report
Current view: top level - src/renderer/extensions/vueNodes/widgets/composables - useBoundingBoxesWidget.ts Coverage Total Hit
Test: ComfyUI E2E Coverage Lines: 33.3 % 6 2
Test Date: 2026-11-17 04:17:53

            Line data    Source code
       1              : import type { LGraphNode } from '@/lib/litegraph/src/litegraph'
       2              : import type {
       3              :   IBaseWidget,
       4              :   IWidgetBoundingBoxesOptions
       5              : } from '@comfyorg/graph-model/widgets'
       6              : import type {
       7              :   BoundingBoxesInputSpec,
       8              :   InputSpec as InputSpecV2
       9              : } from '@comfyorg/object-info-parser/schemas/nodeDefSchemaV2'
      10              : import type { ComfyWidgetConstructorV2 } from '@/types/widgetConstructor'
      11              : import type { BoundingBox } from '@comfyorg/graph-model/boundingBoxes'
      12              : 
      13         2356 : export const useBoundingBoxesWidget = (): ComfyWidgetConstructorV2 => {
      14         2356 :   return (node: LGraphNode, inputSpec: InputSpecV2): IBaseWidget => {
      15            0 :     const spec = inputSpec as BoundingBoxesInputSpec
      16            0 :     const defaultValue: BoundingBox[] =
      17              :       spec.default?.map((box) => ({
      18              :         ...box,
      19              :         metadata: { ...box.metadata, palette: [...box.metadata.palette] }
      20              :       })) ?? []
      21            0 :     const options: IWidgetBoundingBoxesOptions = {
      22              :       serialize: true,
      23              :       hideInPanel: true,
      24              :       max_boxes: spec.max_boxes
      25              :     }
      26            0 :     return node.addWidget(
      27              :       'boundingboxes',
      28              :       spec.name,
      29              :       defaultValue,
      30              :       null,
      31              :       options
      32              :     )
      33              :   }
      34              : }
        

Generated by: LCOV version 2.0-1