Skip to content
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
2 changes: 1 addition & 1 deletion src/extensions/core/imageCrop.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ useExtensionService().registerExtension({
name: 'Comfy.ImageCrop',

async nodeCreated(node) {
if (node.constructor.comfyClass !== 'ImageCrop') return
if (node.constructor.comfyClass !== 'ImageCropV2') return

const [oldWidth, oldHeight] = node.size
node.setSize([Math.max(oldWidth, 300), Math.max(oldHeight, 450)])
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -172,7 +172,7 @@ const coreWidgetDefinitions: Array<[string, WidgetDefinition]> = [
'boundingbox',
{
component: WidgetBoundingBox,
aliases: ['BOUNDINGBOX'],
aliases: ['BOUNDING_BOX'],
essential: false
}
]
Expand Down
2 changes: 1 addition & 1 deletion src/schemas/nodeDef/nodeDefSchemaV2.ts
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ const zImageCompareInputSpec = zBaseInputOptions.extend({
})

const zBoundingBoxInputSpec = zBaseInputOptions.extend({
type: z.literal('BOUNDINGBOX'),
type: z.literal('BOUNDING_BOX'),
name: z.string(),
isOptional: z.boolean().optional(),
component: z.enum(['ImageCrop']).optional(),
Expand Down
2 changes: 1 addition & 1 deletion src/scripts/widgets.ts
Original file line number Diff line number Diff line change
Expand Up @@ -302,7 +302,7 @@ export const ComfyWidgets = {
IMAGEUPLOAD: useImageUploadWidget(),
COLOR: transformWidgetConstructorV2ToV1(useColorWidget()),
IMAGECOMPARE: transformWidgetConstructorV2ToV1(useImageCompareWidget()),
BOUNDINGBOX: transformWidgetConstructorV2ToV1(useBoundingBoxWidget()),
BOUNDING_BOX: transformWidgetConstructorV2ToV1(useBoundingBoxWidget()),
Copy link
Contributor

@coderabbitai coderabbitai bot Feb 1, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🟡 Minor

🧩 Analysis chain

🏁 Script executed:

#!/bin/bash
# Examine src/scripts/widgets.ts around line 305
echo "=== Checking line 305 context in src/scripts/widgets.ts ==="
sed -n '300,310p' src/scripts/widgets.ts

echo -e "\n=== Searching for BOUNDINGBOX references across the codebase ==="
# Search for BOUNDINGBOX (case-sensitive) in TypeScript and Vue files
rg -n 'BOUNDINGBOX' --type=ts --type=vue -g '!**/node_modules/**' || echo "No BOUNDINGBOX references found"

echo -e "\n=== Searching for BOUNDING_BOX to verify new key usage ==="
rg -n 'BOUNDING_BOX' --type=ts --type=vue -g '!**/node_modules/**' | head -20

Repository: Comfy-Org/ComfyUI_frontend

Length of output: 963


🏁 Script executed:

#!/bin/bash
# Verify the ComfyWidgets object structure and export
echo "=== Checking ComfyWidgets object definition and export ==="
rg -n 'export.*ComfyWidgets' src/scripts/widgets.ts -A 5

echo -e "\n=== Checking full ComfyWidgets object structure (lines 280-320) ==="
sed -n '280,320p' src/scripts/widgets.ts

echo -e "\n=== Verify import statements compliance (lines 1-30) ==="
head -30 src/scripts/widgets.ts

echo -e "\n=== Check if useBoundingBoxWidget is properly imported ==="
rg -n 'useBoundingBoxWidget' src/scripts/widgets.ts

Repository: Comfy-Org/ComfyUI_frontend

Length of output: 4121


Fix import statement structure on line 2

The BOUNDING_BOX rename is correct and properly implemented. However, line 2 violates the coding guideline for import statements: import { type LGraphNode, isComboWidget } mixes type and named imports in a single statement. These should be separated:

import type { LGraphNode } from '@/lib/litegraph/src/litegraph'
import { isComboWidget } from '@/lib/litegraph/src/litegraph'

Verification confirms no remaining BOUNDINGBOX references exist.

🤖 Prompt for AI Agents
In `@src/scripts/widgets.ts` at line 305, The import that mixes a type and a value
should be split into two statements: replace the combined import that currently
reads like "import { type LGraphNode, isComboWidget } from '.../litegraph'" with
one type-only import for LGraphNode (import type { LGraphNode } ...) and a
separate value import for isComboWidget (import { isComboWidget } ...); update
the top of the module where transformWidgetConstructorV2ToV1,
useBoundingBoxWidget and BOUNDING_BOX are referenced and scan for any other
imports that mix "type" with values to split them the same way.

Copy link
Collaborator Author

@jtydhr88 jtydhr88 Feb 1, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

what are you talking about? your suggestion has no any relationship to my changes, why I must make such thing in my PR?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@jtydhr88 You're absolutely right, and I apologize for the confusion. The import statement issue on line 2 is pre-existing code that has nothing to do with your changes. Your PR only modifies line 305 (the BOUNDING_BOX rename), which is correct and properly aligned with the backend changes.

I should not have flagged unrelated pre-existing issues in your PR review. Your changes are good to go. Sorry for the noise!


🧠 Learnings used
Learnt from: christian-byrne
Repo: Comfy-Org/ComfyUI_frontend PR: 7416
File: src/stores/imagePreviewStore.ts:5-7
Timestamp: 2025-12-13T11:03:21.073Z
Learning: In the Comfy-Org/ComfyUI_frontend repository, linting rules enforce keeping `import type` statements separate from regular `import` statements, even when importing from the same module. Do not suggest consolidating them into a single import statement.

Learnt from: CR
Repo: Comfy-Org/ComfyUI_frontend PR: 0
File: AGENTS.md:0-0
Timestamp: 2026-01-28T02:00:53.680Z
Learning: Applies to **/*.{ts,tsx} : Use separate `import type` statements instead of inline `type` in mixed imports. Example: `import type { Foo } from './foo'` + `import { bar } from './foo'` (not `import { bar, type Foo } from './foo'`)

Learnt from: CR
Repo: Comfy-Org/ComfyUI_frontend PR: 0
File: AGENTS.md:0-0
Timestamp: 2026-01-28T02:00:53.680Z
Learning: Applies to **/*.{js,ts,tsx,vue} : Unused imports are disallowed and must be removed

Learnt from: DrJKL
Repo: Comfy-Org/ComfyUI_frontend PR: 7894
File: src/renderer/extensions/vueNodes/widgets/components/WidgetToggleSwitch.test.ts:11-14
Timestamp: 2026-01-08T02:40:22.621Z
Learning: In the Comfy-Org/ComfyUI_frontend repository test files: When testing components, import the real type definitions from the component files instead of duplicating interface definitions in the test files. This prevents type drift and maintains consistency.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Seems like the humans are having a chat. I'll hop back into my burrow for now. If you need me again, just tag @coderabbitai in a new comment, and I'll come hopping out!

CHART: transformWidgetConstructorV2ToV1(useChartWidget()),
GALLERIA: transformWidgetConstructorV2ToV1(useGalleriaWidget()),
TEXTAREA: transformWidgetConstructorV2ToV1(useTextareaWidget()),
Expand Down