Skip to content

Conversation

@snomiao
Copy link
Member

@snomiao snomiao commented Nov 25, 2025

Summary

Implements Babel plugins to handle Vite define replacements during Playwright's compilation for i18n collection tests. This resolves ReferenceErrors caused by unprocessed compile-time constants like __DISTRIBUTION__.

Related to Notion task: https://www.notion.so/comfy-org/Implement-Babel-plugin-for-Vite-define-replacements-in-Playwright-2b56d73d365081d5bb63e02712912b17

Problem

Playwright's Babel compilation does not run Vite's define replacements, causing reference errors during i18n collection. The __DISTRIBUTION__ reference from coreMenuCommands.ts (via src/platform/distribution/types.ts) remains raw and causes failures.

See failing CI: https://github.com/Comfy-Org/ComfyUI_frontend/actions/runs/19624786760/job/56191480523

Solution

Following the approach from PR #5515, this PR adds:

1. babel-plugin-vite-define.cjs

  • Replaces Vite define constants (__DISTRIBUTION__, __COMFYUI_FRONTEND_VERSION__, etc.) during Babel transformation
  • Uses default values suitable for Playwright test environment
  • Handles various value types (strings, booleans, numbers)

2. babel-plugin-inject-globals.cjs

  • Automatically injects browser globals setup import into i18n collection test files
  • Pattern-matches files starting with collect-i18n-

3. setup-i18n-globals.mjs

  • Provides JSDOM-based browser environment for Node.js execution
  • Sets up window, document, navigator, and other browser globals
  • Required because the codebase references browser globals that don't exist in Node.js

4. Updated playwright.i18n.config.ts

  • Configures Babel plugins for Playwright test compilation
  • Includes module resolver for @ alias support
  • TypeScript transformation with declare fields support

Changes

  • ✨ Add babel-plugin-vite-define.cjs to replace Vite define constants
  • ✨ Add babel-plugin-inject-globals.cjs to inject browser globals setup
  • ✨ Add setup-i18n-globals.mjs for JSDOM-based browser environment
  • 🔧 Update playwright.i18n.config.ts with Babel plugin configuration
  • 🔧 Update knip.config.ts to ignore babel-plugin-module-resolver
  • 📦 Install babel-plugin-module-resolver for @ alias support

Test Plan

  • Verify i18n collection tests run without ReferenceErrors
  • Confirm __DISTRIBUTION__ and other defines are properly replaced
  • Check that browser globals are available during test execution
  • Ensure CI passes for i18n collection workflow

Notes

🤖 Generated with Claude Code

Fixes #10981

┆Issue is synchronized with this Notion page by Unito

Implements a solution to handle Vite define replacements during Playwright's
Babel compilation for i18n collection tests. This resolves ReferenceErrors
caused by unprocessed compile-time constants like __DISTRIBUTION__.

Changes:
- Add babel-plugin-vite-define.cjs to replace Vite define constants
- Add babel-plugin-inject-globals.cjs to inject browser globals setup
- Add setup-i18n-globals.mjs for JSDOM-based browser environment
- Update playwright.i18n.config.ts with Babel plugin configuration
- Install babel-plugin-module-resolver for @ alias support

The implementation follows the approach from PR #5515 but is adapted for
the current codebase structure. The Babel plugins run during Playwright's
test compilation to ensure all Vite define constants are replaced with
their actual values before execution.

Fixes #10981

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <[email protected]>
@coderabbitai
Copy link
Contributor

coderabbitai bot commented Nov 25, 2025

📝 Walkthrough

Walkthrough

Added Babel plugin infrastructure for i18n test compilation to inject globals and replace Vite constants. Expanded CI workflow trigger conditions for i18n updates. Removed deprecated 3D-related node definitions and experimental Vue Nodes entries across all locales. English locale adds new image processing and dataset handling nodes.

Changes

Cohort / File(s) Summary
Test infrastructure - Babel plugins
playwright.i18n.config.ts, scripts/babel-plugin-vite-define.cjs, scripts/babel-plugin-inject-globals.cjs, scripts/setup-i18n-globals.mjs
Configured Playwright i18n tests with custom Babel plugins: babel-plugin-vite-define replaces Vite constants during compilation; babel-plugin-inject-globals prepends setup imports to matched test files; setup-i18n-globals initializes browser-like globals (DOM, window, localStorage, observers) for Node.js test environment.
Build configuration
package.json, knip.config.ts, pnpm-workspace.yaml
Added babel-plugin-module-resolver as dev dependency; configured it in knip ignore list and pnpm workspace catalog for module alias resolution.
Workflow configuration
.github/workflows/i18n-update-core.yaml
Expanded update-locales job condition to trigger on sno- prefixed branches in addition to existing workflow_dispatch and version-bump- prefixes.
Locale files - removals (ar, es, fr, ja, ko, ru, tr, zh-TW, zh)
src/locales/{ar,es,fr,ja,ko,ru,tr,zh-TW,zh}/main.json, src/locales/{ar,es,fr,ja,ko,ru,tr,zh-TW,zh}/nodeDefs.json
Removed deprecated 3D node definitions (Load3D, Load3DAnimation, LoadImageSetFromFolderNode, LoadImageTextSetFromFolderNode, Preview3DAnimation); removed LOAD_3D_ANIMATION data type; removed "Experimental: Enable Vue Nodes" menu entries; removed Vue nodes banner messages; trimmed descriptions from LoraModelLoader and LossGraphNode.
Locale file - additions (en/main.json, en/nodeDefs.json)
src/locales/en/main.json, src/locales/en/nodeDefs.json
Renamed Vue Nodes experimental entries to "Experimental: Enable Nodes 2_0"; added node category translations (dataset, text, image); added 15+ new node definitions for image processing (CenterCropImages, ImageGrid, ImageDeduplication, RandomCropImages), text manipulation (ReplaceText, TextToLowercase, TextToUppercase), and dataset operations (MakeTrainingDataset, LoadTrainingDataset, SaveTrainingDataset, etc.); updated Kling-related nodes and LoRA node naming.

Possibly related PRs

✨ Finishing touches
  • 📝 Generate docstrings
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch sno-babel-define

Comment @coderabbitai help to get the list of available commands and usage tips.

@github-actions
Copy link

github-actions bot commented Nov 25, 2025

🎭 Playwright Test Results

⚠️ Tests passed with flaky tests

⏰ Completed at: 12/02/2025, 02:29:35 AM UTC

📈 Summary

  • Total Tests: 496
  • Passed: 484 ✅
  • Failed: 0
  • Flaky: 3 ⚠️
  • Skipped: 9 ⏭️

📊 Test Reports by Browser

  • chromium: View Report • ✅ 475 / ❌ 0 / ⚠️ 3 / ⏭️ 9
  • chromium-2x: View Report • ✅ 2 / ❌ 0 / ⚠️ 0 / ⏭️ 0
  • chromium-0.5x: View Report • ✅ 1 / ❌ 0 / ⚠️ 0 / ⏭️ 0
  • mobile-chrome: View Report • ✅ 6 / ❌ 0 / ⚠️ 0 / ⏭️ 0

🎉 Click on the links above to view detailed test results for each browser configuration.

@github-actions
Copy link

github-actions bot commented Nov 25, 2025

🎨 Storybook Build Status

Build completed successfully!

⏰ Completed at: 12/02/2025, 02:20:36 AM UTC

🔗 Links


🎉 Your Storybook is ready for review!

@socket-security
Copy link

socket-security bot commented Nov 25, 2025

Review the following changes in direct dependencies. Learn more about Socket for GitHub.

Diff Package Supply Chain
Security
Vulnerability Quality Maintenance License
Addedbabel-plugin-module-resolver@​5.0.29910010082100

View full report

@github-actions
Copy link

github-actions bot commented Nov 25, 2025

Bundle Size Report

Summary

  • Raw size: 17 MB baseline 17 MB — ⚪ 0 B
  • Gzip: 3.37 MB baseline 3.37 MB — ⚪ 0 B
  • Brotli: 2.58 MB baseline 2.58 MB — ⚪ 0 B
  • Bundles: 97 current • 97 baseline

Category Glance
Vendor & Third-Party ⚪ 0 B (8.56 MB) · Other ⚪ 0 B (3.84 MB) · App Entry Points ⚪ 0 B (3.18 MB) · Graph Workspace ⚪ 0 B (956 kB) · Panels & Settings ⚪ 0 B (298 kB) · UI Components ⚪ 0 B (139 kB) · + 3 more

Per-category breakdown
App Entry Points — 3.18 MB (baseline 3.18 MB) • ⚪ 0 B

Main entry bundles and manifests

File Before After Δ Raw Δ Gzip Δ Brotli
assets/index-BQcQwdpo.js 2.95 MB 2.95 MB ⚪ 0 B ⚪ 0 B ⚪ 0 B
assets/index-DSUyz4Qm.js 227 kB 227 kB ⚪ 0 B ⚪ 0 B ⚪ 0 B
assets/index-DyiqTMGx.js 345 B 345 B ⚪ 0 B ⚪ 0 B ⚪ 0 B
Graph Workspace — 956 kB (baseline 956 kB) • ⚪ 0 B

Graph editor runtime, canvas, workflow orchestration

File Before After Δ Raw Δ Gzip Δ Brotli
assets/GraphView-DeEAWQUg.js 956 kB 956 kB ⚪ 0 B ⚪ 0 B ⚪ 0 B
Views & Navigation — 6.54 kB (baseline 6.54 kB) • ⚪ 0 B

Top-level views, pages, and routed surfaces

File Before After Δ Raw Δ Gzip Δ Brotli
assets/UserSelectView-BLS31PJ8.js 6.54 kB 6.54 kB ⚪ 0 B ⚪ 0 B ⚪ 0 B
Panels & Settings — 298 kB (baseline 298 kB) • ⚪ 0 B

Configuration panels, inspectors, and settings screens

File Before After Δ Raw Δ Gzip Δ Brotli
assets/AboutPanel-BQX0pmW7.js 9.16 kB 9.16 kB ⚪ 0 B ⚪ 0 B ⚪ 0 B
assets/CreditsPanel-omeGa93g.js 21.4 kB 21.4 kB ⚪ 0 B ⚪ 0 B ⚪ 0 B
assets/ExtensionPanel-CP1IHi__.js 10.8 kB 10.8 kB ⚪ 0 B ⚪ 0 B ⚪ 0 B
assets/KeybindingPanel-uev5TeJ0.js 13.6 kB 13.6 kB ⚪ 0 B ⚪ 0 B ⚪ 0 B
assets/ServerConfigPanel-C321WfSx.js 6.56 kB 6.56 kB ⚪ 0 B ⚪ 0 B ⚪ 0 B
assets/settings-BhbWhsRg.js 101 B 101 B ⚪ 0 B ⚪ 0 B ⚪ 0 B
assets/settings-BXTtSH4O.js 33.3 kB 33.3 kB ⚪ 0 B ⚪ 0 B ⚪ 0 B
assets/settings-C9Pzn-NG.js 25.2 kB 25.2 kB ⚪ 0 B ⚪ 0 B ⚪ 0 B
assets/settings-CCy2fA_h.js 27.3 kB 27.3 kB ⚪ 0 B ⚪ 0 B ⚪ 0 B
assets/settings-CQpqEFfl.js 26.6 kB 26.6 kB ⚪ 0 B ⚪ 0 B ⚪ 0 B
assets/settings-DHcnxypw.js 21.7 kB 21.7 kB ⚪ 0 B ⚪ 0 B ⚪ 0 B
assets/settings-DhFTK9fY.js 25.1 kB 25.1 kB ⚪ 0 B ⚪ 0 B ⚪ 0 B
assets/settings-DlT4t_ui.js 25.9 kB 25.9 kB ⚪ 0 B ⚪ 0 B ⚪ 0 B
assets/settings-DRgSrIdD.js 24.2 kB 24.2 kB ⚪ 0 B ⚪ 0 B ⚪ 0 B
assets/settings-tjkeqiZq.js 21.1 kB 21.1 kB ⚪ 0 B ⚪ 0 B ⚪ 0 B
assets/UserPanel-Dh_zFsU7.js 6.23 kB 6.23 kB ⚪ 0 B ⚪ 0 B ⚪ 0 B
UI Components — 139 kB (baseline 139 kB) • ⚪ 0 B

Reusable component library chunks

File Before After Δ Raw Δ Gzip Δ Brotli
assets/ComfyQueueButton-CT5p2u3t.js 8.44 kB 8.44 kB ⚪ 0 B ⚪ 0 B ⚪ 0 B
assets/LazyImage.vue_vue_type_script_setup_true_lang-C6H8lTKh.js 10.8 kB 10.8 kB ⚪ 0 B ⚪ 0 B ⚪ 0 B
assets/Load3D.vue_vue_type_script_setup_true_lang-DTXMObcx.js 53.9 kB 53.9 kB ⚪ 0 B ⚪ 0 B ⚪ 0 B
assets/MediaTitle.vue_vue_type_script_setup_true_lang-DKBuequ-.js 897 B 897 B ⚪ 0 B ⚪ 0 B ⚪ 0 B
assets/UserAvatar.vue_vue_type_script_setup_true_lang-C5LozO_F.js 1.34 kB 1.34 kB ⚪ 0 B ⚪ 0 B ⚪ 0 B
assets/WidgetButton-B-LyNlD7.js 2.04 kB 2.04 kB ⚪ 0 B ⚪ 0 B ⚪ 0 B
assets/WidgetInputNumber.vue_vue_type_script_setup_true_lang-sqkeLkOX.js 12.9 kB 12.9 kB ⚪ 0 B ⚪ 0 B ⚪ 0 B
assets/WidgetLayoutField.vue_vue_type_script_setup_true_lang-Cj7vQINR.js 2 kB 2 kB ⚪ 0 B ⚪ 0 B ⚪ 0 B
assets/WidgetSelect.vue_vue_type_script_setup_true_lang-6WW91OW6.js 47 kB 47 kB ⚪ 0 B ⚪ 0 B ⚪ 0 B
Data & Services — 12.5 kB (baseline 12.5 kB) • ⚪ 0 B

Stores, services, APIs, and repositories

File Before After Δ Raw Δ Gzip Δ Brotli
assets/audioService-D7Rdx86O.js 2.2 kB 2.2 kB ⚪ 0 B ⚪ 0 B ⚪ 0 B
assets/keybindingService-CHWsidLF.js 7.51 kB 7.51 kB ⚪ 0 B ⚪ 0 B ⚪ 0 B
assets/serverConfigStore-BQ9GXEkd.js 2.83 kB 2.83 kB ⚪ 0 B ⚪ 0 B ⚪ 0 B
Utilities & Hooks — 2.94 kB (baseline 2.94 kB) • ⚪ 0 B

Helpers, composables, and utility bundles

File Before After Δ Raw Δ Gzip Δ Brotli
assets/audioUtils-Bbiz8a_0.js 1.41 kB 1.41 kB ⚪ 0 B ⚪ 0 B ⚪ 0 B
assets/mathUtil-CTARWQ-l.js 1.07 kB 1.07 kB ⚪ 0 B ⚪ 0 B ⚪ 0 B
assets/nodeFilterUtil-CXKCRJ-m.js 460 B 460 B ⚪ 0 B ⚪ 0 B ⚪ 0 B
Vendor & Third-Party — 8.56 MB (baseline 8.56 MB) • ⚪ 0 B

External libraries and shared vendor chunks

File Before After Δ Raw Δ Gzip Δ Brotli
assets/vendor-chart-B_stLV7c.js 452 kB 452 kB ⚪ 0 B ⚪ 0 B ⚪ 0 B
assets/vendor-other-BawBdcAH.js 3.98 MB 3.98 MB ⚪ 0 B ⚪ 0 B ⚪ 0 B
assets/vendor-primevue-DqE43B_H.js 1.96 MB 1.96 MB ⚪ 0 B ⚪ 0 B ⚪ 0 B
assets/vendor-three-aR6ntw5X.js 1.37 MB 1.37 MB ⚪ 0 B ⚪ 0 B ⚪ 0 B
assets/vendor-tiptap-CogkskC9.js 232 kB 232 kB ⚪ 0 B ⚪ 0 B ⚪ 0 B
assets/vendor-vue-DCnqNLx6.js 160 kB 160 kB ⚪ 0 B ⚪ 0 B ⚪ 0 B
assets/vendor-xterm-BZLod3g9.js 407 kB 407 kB ⚪ 0 B ⚪ 0 B ⚪ 0 B
Other — 3.84 MB (baseline 3.84 MB) • ⚪ 0 B

Bundles that do not match a named category

File Before After Δ Raw Δ Gzip Δ Brotli
assets/AudioPreviewPlayer-Dc4LYAD8.js 13.5 kB 13.5 kB ⚪ 0 B ⚪ 0 B ⚪ 0 B
assets/commands-_s-RvhJR.js 13.6 kB 13.6 kB ⚪ 0 B ⚪ 0 B ⚪ 0 B
assets/commands-BuUILW6P.js 13 kB 13 kB ⚪ 0 B ⚪ 0 B ⚪ 0 B
assets/commands-BV4R6fLx.js 14.9 kB 14.9 kB ⚪ 0 B ⚪ 0 B ⚪ 0 B
assets/commands-BWp4HdfU.js 101 B 101 B ⚪ 0 B ⚪ 0 B ⚪ 0 B
assets/commands-CLwPdnT6.js 14.2 kB 14.2 kB ⚪ 0 B ⚪ 0 B ⚪ 0 B
assets/commands-CWMchBmd.js 15.9 kB 15.9 kB ⚪ 0 B ⚪ 0 B ⚪ 0 B
assets/commands-DazTQhtc.js 12.9 kB 12.9 kB ⚪ 0 B ⚪ 0 B ⚪ 0 B
assets/commands-DmWrOe93.js 13.7 kB 13.7 kB ⚪ 0 B ⚪ 0 B ⚪ 0 B
assets/commands-DwiH7Kr6.js 13.8 kB 13.8 kB ⚪ 0 B ⚪ 0 B ⚪ 0 B
assets/commands-mS3LCNPn.js 14.5 kB 14.5 kB ⚪ 0 B ⚪ 0 B ⚪ 0 B
assets/Load3D-CYTns2GD.js 424 B 424 B ⚪ 0 B ⚪ 0 B ⚪ 0 B
assets/main-5lOBdqcC.js 84.5 kB 84.5 kB ⚪ 0 B ⚪ 0 B ⚪ 0 B
assets/main-BOCuaVpE.js 73.4 kB 73.4 kB ⚪ 0 B ⚪ 0 B ⚪ 0 B
assets/main-ClrEFGUz.js 72.4 kB 72.4 kB ⚪ 0 B ⚪ 0 B ⚪ 0 B
assets/main-Cw9RZWRY.js 89 B 89 B ⚪ 0 B ⚪ 0 B ⚪ 0 B
assets/main-CyNU0iQX.js 99.3 kB 99.3 kB ⚪ 0 B ⚪ 0 B ⚪ 0 B
assets/main-D7gwLxft.js 114 kB 114 kB ⚪ 0 B ⚪ 0 B ⚪ 0 B
assets/main-DC8o4BCt.js 86.8 kB 86.8 kB ⚪ 0 B ⚪ 0 B ⚪ 0 B
assets/main-DKiesCV4.js 94.3 kB 94.3 kB ⚪ 0 B ⚪ 0 B ⚪ 0 B
assets/main-Hq2q-OtB.js 83.6 kB 83.6 kB ⚪ 0 B ⚪ 0 B ⚪ 0 B
assets/main-USAlAlnj.js 82 kB 82 kB ⚪ 0 B ⚪ 0 B ⚪ 0 B
assets/Media3DBottom-BN4TK3Zp.js 1.5 kB 1.5 kB ⚪ 0 B ⚪ 0 B ⚪ 0 B
assets/Media3DTop-m7_iYW7A.js 1.49 kB 1.49 kB ⚪ 0 B ⚪ 0 B ⚪ 0 B
assets/MediaAudioBottom-CykqvPWE.js 1.52 kB 1.52 kB ⚪ 0 B ⚪ 0 B ⚪ 0 B
assets/MediaAudioTop-CSwk_z5a.js 1.46 kB 1.46 kB ⚪ 0 B ⚪ 0 B ⚪ 0 B
assets/MediaImageBottom-B9-cic1t.js 1.57 kB 1.57 kB ⚪ 0 B ⚪ 0 B ⚪ 0 B
assets/MediaImageTop-DBacjcjH.js 1.75 kB 1.75 kB ⚪ 0 B ⚪ 0 B ⚪ 0 B
assets/MediaVideoBottom-teekWhUB.js 1.52 kB 1.52 kB ⚪ 0 B ⚪ 0 B ⚪ 0 B
assets/MediaVideoTop-Ct23Baus.js 2.76 kB 2.76 kB ⚪ 0 B ⚪ 0 B ⚪ 0 B
assets/nodeDefs-_Px5dSNW.js 306 kB 306 kB ⚪ 0 B ⚪ 0 B ⚪ 0 B
assets/nodeDefs-7z21KPoS.js 285 kB 285 kB ⚪ 0 B ⚪ 0 B ⚪ 0 B
assets/nodeDefs-Bw_Jitw_.js 101 B 101 B ⚪ 0 B ⚪ 0 B ⚪ 0 B
assets/nodeDefs-BWKZzBPK.js 346 kB 346 kB ⚪ 0 B ⚪ 0 B ⚪ 0 B
assets/nodeDefs-CGbgH4Yl.js 320 kB 320 kB ⚪ 0 B ⚪ 0 B ⚪ 0 B
assets/nodeDefs-CjjjdWkV.js 313 kB 313 kB ⚪ 0 B ⚪ 0 B ⚪ 0 B
assets/nodeDefs-CVrNtxvj.js 288 kB 288 kB ⚪ 0 B ⚪ 0 B ⚪ 0 B
assets/nodeDefs-DLRSA0IK.js 309 kB 309 kB ⚪ 0 B ⚪ 0 B ⚪ 0 B
assets/nodeDefs-DQV2gnwA.js 372 kB 372 kB ⚪ 0 B ⚪ 0 B ⚪ 0 B
assets/nodeDefs-ofqLG5vz.js 310 kB 310 kB ⚪ 0 B ⚪ 0 B ⚪ 0 B
assets/WidgetAudioUI-BXNhccNi.js 2.82 kB 2.82 kB ⚪ 0 B ⚪ 0 B ⚪ 0 B
assets/WidgetChart-DE8yMz8M.js 2.48 kB 2.48 kB ⚪ 0 B ⚪ 0 B ⚪ 0 B
assets/WidgetColorPicker-BfuX2Cyh.js 3.41 kB 3.41 kB ⚪ 0 B ⚪ 0 B ⚪ 0 B
assets/WidgetGalleria-Dk52fsdt.js 4.1 kB 4.1 kB ⚪ 0 B ⚪ 0 B ⚪ 0 B
assets/WidgetImageCompare-DXoIcmUZ.js 2.21 kB 2.21 kB ⚪ 0 B ⚪ 0 B ⚪ 0 B
assets/WidgetInputNumber-BsIcME1W.js 595 B 595 B ⚪ 0 B ⚪ 0 B ⚪ 0 B
assets/WidgetInputText-BexPeE8G.js 1.99 kB 1.99 kB ⚪ 0 B ⚪ 0 B ⚪ 0 B
assets/WidgetLegacy-B7ic1JQQ.js 364 B 364 B ⚪ 0 B ⚪ 0 B ⚪ 0 B
assets/WidgetMarkdown-Bctv8lwm.js 3.1 kB 3.1 kB ⚪ 0 B ⚪ 0 B ⚪ 0 B
assets/widgetPropFilter-BIbGSUAt.js 1.28 kB 1.28 kB ⚪ 0 B ⚪ 0 B ⚪ 0 B
assets/WidgetRecordAudio-CuylfOd6.js 20.4 kB 20.4 kB ⚪ 0 B ⚪ 0 B ⚪ 0 B
assets/WidgetSelect-DsI5tm7l.js 655 B 655 B ⚪ 0 B ⚪ 0 B ⚪ 0 B
assets/WidgetTextarea-U3TJTiVI.js 2.48 kB 2.48 kB ⚪ 0 B ⚪ 0 B ⚪ 0 B
assets/WidgetToggleSwitch-CPRhYPcc.js 1.58 kB 1.58 kB ⚪ 0 B ⚪ 0 B ⚪ 0 B

snomiao and others added 4 commits December 1, 2025 22:37
…ranch to facilitate debugging during development
…nches matching sno-* for better flexibility

chore(i18n-update-core.yaml): modify job condition to run on push events for improved automation
…and update condition for job execution to include sno- branches
@snomiao snomiao marked this pull request as ready for review December 2, 2025 02:57
@dosubot dosubot bot added the size:XXL This PR changes 1000+ lines, ignoring generated files. label Dec 2, 2025
@snomiao
Copy link
Member Author

snomiao commented Dec 2, 2025

this PR also solves #6943 (comment)

Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 5

Caution

Some comments are outside the diff and can’t be posted inline due to platform limitations.

⚠️ Outside diff range comments (1)
src/locales/en/nodeDefs.json (1)

1-14859: Add 'name' fields to 400+ unnamed outputs throughout the file for improved UI clarity, and fix grammatically incorrect "16:9 square" phrasing.

The audit confirms significant schema consistency issues:

  1. Unnamed outputs (400+ instances): Many nodes lack explicit name fields on their outputs (e.g., AddNoise.0, CheckpointLoaderSimple outputs 0/1/2, SplitImageWithAlpha outputs 0/1, PorterDuffImageComposite outputs 0/1). Adding descriptive names will improve usability and UI rendering.

  2. Grammatical error in GeminiImageNode (line 2839): Tooltip states "a 16:9 square is usually generated" — should be "a 16:9 or square aspect ratio is usually generated" to correctly convey the two separate options.

  3. KlingSingleImageVideoEffectNode and KlingStartEndFrameNode are current (not legacy) nodes and appear correctly defined.

  4. model_with_lora label exists only in the Japanese locale file, not in the English file under review.

🧹 Nitpick comments (16)
scripts/setup-i18n-globals.mjs (2)

34-43: Fix formatting for fallback class definitions.

The inline fallback classes have formatting issues flagged by Prettier. Consider reformatting:

-global.ResizeObserver = dom.window.ResizeObserver || class ResizeObserver {
-  observe() {}
-  unobserve() {}
-  disconnect() {}
-}
-global.IntersectionObserver = dom.window.IntersectionObserver || class IntersectionObserver {
-  observe() {}
-  unobserve() {}
-  disconnect() {}
-}
+global.ResizeObserver =
+  dom.window.ResizeObserver ||
+  class ResizeObserver {
+    observe() {}
+    unobserve() {}
+    disconnect() {}
+  }
+global.IntersectionObserver =
+  dom.window.IntersectionObserver ||
+  class IntersectionObserver {
+    observe() {}
+    unobserve() {}
+    disconnect() {}
+  }

11-15: Consider removing resources: 'usable' for faster test execution.

The resources: 'usable' option enables JSDOM to load external resources (scripts, images, etc.), which may not be necessary for i18n string collection and could slow down test execution. Consider whether this is needed:

 const dom = new JSDOM('<!DOCTYPE html><html><body></body></html>', {
   url: 'http://localhost:5173',
-  pretendToBeVisual: true,
-  resources: 'usable'
+  pretendToBeVisual: true
 })
scripts/babel-plugin-vite-define.cjs (2)

55-55: Remove unused execSync import.

execSync is imported from child_process but never used. This appears to be leftover from an abandoned approach to synchronously load the Vite config:

       if (viteDefines === null) {
         // Synchronously load if not already loaded
         // This is a workaround since Babel plugins don't support async pre()
-        const { execSync } = require('child_process')
         try {

90-98: Add parentheses for clarity in complex condition.

While the current logic is correct due to operator precedence, adding explicit parentheses improves readability and satisfies Prettier:

         if (
           path.isBindingIdentifier() ||
-          path.parent.type === 'MemberExpression' && path.parent.property === path.node ||
-          path.parent.type === 'ObjectProperty' && path.parent.key === path.node ||
+          (path.parent.type === 'MemberExpression' &&
+            path.parent.property === path.node) ||
+          (path.parent.type === 'ObjectProperty' &&
+            path.parent.key === path.node) ||
           path.parent.type === 'ClassMethod' ||
           path.parent.type === 'MethodDefinition'
         ) {
scripts/babel-plugin-inject-globals.cjs (1)

46-46: Consider downgrading to debug-level logging or removing.

The console.log message will appear for every matched file during compilation, which could be noisy in CI output. Consider using console.warn only for issues, or removing the log entirely since the injection is expected behavior:

-          console.log(`[babel-plugin-inject-globals] Injected setup into ${nodePath.basename(filename)}`)

Alternatively, if you want to keep tracing for debugging, you could make it conditional on an environment variable.

playwright.i18n.config.ts (1)

27-59: Avoid as any type assertion.

Per coding guidelines, as any should be avoided. Consider using TypeScript module augmentation to extend Playwright's config type:

+// Extend Playwright's config type for internal babelPlugins API
+declare module '@playwright/test' {
+  interface PlaywrightTestConfig {
+    '@playwright/test'?: {
+      babelPlugins?: Array<string | [string, Record<string, unknown>]>
+    }
+  }
+}
+
 const config = defineConfig({
   // ...existing config
 })

-;(config as any)['@playwright/test'] = {
+config['@playwright/test'] = {
   babelPlugins: [
     // ...
   ]
 }

Alternatively, if this is an undocumented internal API that may change, add a comment explaining why as any is necessary so future maintainers understand the context.

src/locales/en/nodeDefs.json (10)

18-22: Name the AddNoise output for UI clarity.

Currently output 0 only has tooltip:null. Consider a friendly name (e.g., "samples" or "latent") to align with other nodes and improve graph readability.

-    "outputs": {
-      "0": {
-        "tooltip": null
-      }
-    }
+    "outputs": {
+      "0": {
+        "name": "samples",
+        "tooltip": null
+      }
+    }

650-671: CenterCropImages: pluralize and clarify center behavior.

Tooltips say “Image to process.” while the port is a batch; also specify that crop is center-anchored.

-      "images": {
-        "name": "images",
-        "tooltip": "Image to process."
-      },
+      "images": {
+        "name": "images",
+        "tooltip": "Images to process (batch supported)."
+      },
@@
-      "width": {
+      "width": {
         "name": "width",
-        "tooltip": "Crop width."
+        "tooltip": "Center crop width (pixels)."
       },
@@
-      "height": {
+      "height": {
         "name": "height",
-        "tooltip": "Crop height."
+        "tooltip": "Center crop height (pixels)."
       }

3612-3649: ImageDeduplication: clarify threshold semantics and default.

State inclusive/exclusive and default value to reduce ambiguity in tests and docs.

-        "tooltip": "Similarity threshold (0-1). Higher means more similar. Images above this threshold are considered duplicates."
+        "tooltip": "Similarity threshold [0.0–1.0]. Higher = more similar. Images with similarity >= threshold are considered duplicates. Default: 0.95."

3675-3705: ImageGrid: document output size behavior.

Add how cell size and padding determine final grid dimensions to avoid user confusion.

-        "tooltip": "Processed images"
+        "tooltip": "Grid image. Final size = (columns * cell_width + (columns-1)*padding) by (rows * cell_height + (rows-1)*padding)."

4535-4566: Mark legacy Kling nodes as deprecated in display_name.

Helps users pick the right node and eases migration to Omni Pro.

-  "KlingSingleImageVideoEffectNode": {
-    "display_name": "Kling Video Effects",
+  "KlingSingleImageVideoEffectNode": {
+    "display_name": "Kling Video Effects (DEPRECATED)",
@@
-  "KlingStartEndFrameNode": {
-    "display_name": "Kling Start-End Frame to Video",
+  "KlingStartEndFrameNode": {
+    "display_name": "Kling Start-End Frame to Video (DEPRECATED)",

Also applies to: 4567-4611


9530-9544: Add tooltip for Preview3D.bg_image.

New input lacks help text; add minimal guidance.

-      "bg_image": {
-        "name": "bg_image"
-      },
+      "bg_image": {
+        "name": "bg_image",
+        "tooltip": "Background image used behind the rendered model."
+      },

9690-9718: RandomCropImages: pluralize and clarify randomness/seed.

Align with CenterCropImages pluralization and mention seed determinism.

-      "images": {
-        "name": "images",
-        "tooltip": "Image to process."
-      },
+      "images": {
+        "name": "images",
+        "tooltip": "Images to process (batch supported)."
+      },
@@
-      "seed": {
+      "seed": {
         "name": "seed",
-        "tooltip": "Random seed."
+        "tooltip": "Random seed (fixed seed = deterministic crops)."
       },

10345-10362: ResizeImagesByLonger/ShorterEdge: clarify proportional scaling.

State that the other edge scales to preserve aspect ratio.

-        "tooltip": "Target length for the longer edge."
+        "tooltip": "Target length for the longer edge; the other edge scales proportionally."
@@
-        "tooltip": "Target length for the shorter edge."
+        "tooltip": "Target length for the shorter edge; the other edge scales proportionally."

Also applies to: 10364-10381


14635-14677: Save/Load Wan API nodes: watermark/prompt_extend wording parity.

Ensure identical tooltip phrasing across text/image/video API nodes for consistency.

-        "tooltip": "Whether to add an \"AI generated\" watermark to the result."
+        "tooltip": "Whether to add an \"AI-generated\" watermark to the result."

Also applies to: 14678-14730


12518-12547: Verify ReplaceText overlap with StringReplace; TextToUppercase/TextToLowercase have no String equivalent.

ReplaceText and StringReplace both perform text replacement (find/replace). However, TextToUppercase and TextToLowercase are unique case-conversion utilities with no String-equivalent counterpart—they should not be flagged for consolidation. If ReplaceText duplicates StringReplace functionality, consider whether both variants are needed or if one should be removed.

📜 Review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 1351690 and bc04a88.

⛔ Files ignored due to path filters (1)
  • pnpm-lock.yaml is excluded by !**/pnpm-lock.yaml
📒 Files selected for processing (28)
  • .github/workflows/i18n-update-core.yaml (1 hunks)
  • knip.config.ts (1 hunks)
  • package.json (1 hunks)
  • playwright.i18n.config.ts (2 hunks)
  • pnpm-workspace.yaml (1 hunks)
  • scripts/babel-plugin-inject-globals.cjs (1 hunks)
  • scripts/babel-plugin-vite-define.cjs (1 hunks)
  • scripts/setup-i18n-globals.mjs (1 hunks)
  • src/locales/ar/main.json (0 hunks)
  • src/locales/ar/nodeDefs.json (0 hunks)
  • src/locales/en/main.json (2 hunks)
  • src/locales/en/nodeDefs.json (61 hunks)
  • src/locales/es/main.json (0 hunks)
  • src/locales/es/nodeDefs.json (0 hunks)
  • src/locales/fr/main.json (0 hunks)
  • src/locales/fr/nodeDefs.json (0 hunks)
  • src/locales/ja/main.json (0 hunks)
  • src/locales/ja/nodeDefs.json (0 hunks)
  • src/locales/ko/main.json (0 hunks)
  • src/locales/ko/nodeDefs.json (0 hunks)
  • src/locales/ru/main.json (0 hunks)
  • src/locales/ru/nodeDefs.json (0 hunks)
  • src/locales/tr/main.json (0 hunks)
  • src/locales/tr/nodeDefs.json (0 hunks)
  • src/locales/zh-TW/main.json (0 hunks)
  • src/locales/zh-TW/nodeDefs.json (0 hunks)
  • src/locales/zh/main.json (0 hunks)
  • src/locales/zh/nodeDefs.json (0 hunks)
💤 Files with no reviewable changes (18)
  • src/locales/ru/main.json
  • src/locales/ko/main.json
  • src/locales/ja/main.json
  • src/locales/zh/main.json
  • src/locales/tr/main.json
  • src/locales/zh-TW/main.json
  • src/locales/fr/main.json
  • src/locales/es/main.json
  • src/locales/ar/main.json
  • src/locales/ar/nodeDefs.json
  • src/locales/tr/nodeDefs.json
  • src/locales/ja/nodeDefs.json
  • src/locales/zh-TW/nodeDefs.json
  • src/locales/ru/nodeDefs.json
  • src/locales/zh/nodeDefs.json
  • src/locales/fr/nodeDefs.json
  • src/locales/ko/nodeDefs.json
  • src/locales/es/nodeDefs.json
🧰 Additional context used
📓 Path-based instructions (7)
**/*.{vue,ts,tsx}

📄 CodeRabbit inference engine (.cursorrules)

**/*.{vue,ts,tsx}: Leverage VueUse functions for performance-enhancing utilities
Use vue-i18n in Composition API for any string literals and place new translation entries in src/locales/en/main.json

Files:

  • knip.config.ts
  • playwright.i18n.config.ts
**/*.{ts,tsx,js}

📄 CodeRabbit inference engine (.cursorrules)

Use es-toolkit for utility functions

Files:

  • knip.config.ts
  • playwright.i18n.config.ts
**/*.{ts,tsx}

📄 CodeRabbit inference engine (.cursorrules)

Use TypeScript for type safety

**/*.{ts,tsx}: Never use any type - use proper TypeScript types
Never use as any type assertions - fix the underlying type issue

Files:

  • knip.config.ts
  • playwright.i18n.config.ts
**/*.{ts,tsx,js,vue}

📄 CodeRabbit inference engine (.cursorrules)

Implement proper error handling in components and services

**/*.{ts,tsx,js,vue}: Use 2-space indentation, single quotes, no semicolons, and maintain 80-character line width as configured in .prettierrc
Organize imports by sorting and grouping by plugin, and run pnpm format before committing

Files:

  • knip.config.ts
  • playwright.i18n.config.ts
**/*.{ts,tsx,js,jsx,vue}

📄 CodeRabbit inference engine (CLAUDE.md)

Use camelCase for variable and setting names in TypeScript/Vue files

Files:

  • knip.config.ts
  • playwright.i18n.config.ts
**/*.{ts,tsx,vue}

📄 CodeRabbit inference engine (CLAUDE.md)

**/*.{ts,tsx,vue}: Use const settingStore = useSettingStore() and settingStore.get('Comfy.SomeSetting') to retrieve settings in TypeScript/Vue files
Use await settingStore.set('Comfy.SomeSetting', newValue) to update settings in TypeScript/Vue files
Check server capabilities using api.serverSupportsFeature('feature_name') before using enhanced features
Use api.getServerFeature('config_name', defaultValue) to retrieve server feature configuration

Enforce ESLint rules for Vue + TypeScript including: no floating promises, no unused imports, and i18n raw text restrictions in templates

Files:

  • knip.config.ts
  • playwright.i18n.config.ts
**/*.ts

📄 CodeRabbit inference engine (CLAUDE.md)

**/*.ts: Define dynamic setting defaults using runtime context with functions in settings configuration
Use defaultsByInstallVersion property for gradual feature rollout based on version in settings configuration

Files:

  • knip.config.ts
  • playwright.i18n.config.ts
🧠 Learnings (26)
📓 Common learnings
Learnt from: CR
Repo: Comfy-Org/ComfyUI_frontend PR: 0
File: browser_tests/CLAUDE.md:0-0
Timestamp: 2025-11-24T19:47:22.909Z
Learning: Applies to browser_tests/**/*.{e2e,spec}.{ts,tsx,js,jsx} : Use Playwright fixtures for browser tests
Learnt from: CR
Repo: Comfy-Org/ComfyUI_frontend PR: 0
File: AGENTS.md:0-0
Timestamp: 2025-11-24T19:48:23.088Z
Learning: Use Vitest (with happy-dom) for unit and component tests, and Playwright for E2E tests
Learnt from: CR
Repo: Comfy-Org/ComfyUI_frontend PR: 0
File: tests-ui/CLAUDE.md:0-0
Timestamp: 2025-11-24T19:48:03.270Z
Learning: Applies to tests-ui/**/*.test.{js,ts,jsx,tsx} : Write tests for new features
Learnt from: CR
Repo: Comfy-Org/ComfyUI_frontend PR: 0
File: .cursorrules:0-0
Timestamp: 2025-11-24T19:46:52.279Z
Learning: Applies to **/*.{vue,ts,tsx} : Use vue-i18n in Composition API for any string literals and place new translation entries in src/locales/en/main.json
Learnt from: CR
Repo: Comfy-Org/ComfyUI_frontend PR: 0
File: src/CLAUDE.md:0-0
Timestamp: 2025-11-24T19:47:34.324Z
Learning: Applies to src/**/{components,composables}/**/*.{ts,tsx,vue} : Use vue-i18n for ALL user-facing strings by adding them to `src/locales/en/main.json`
Learnt from: CR
Repo: Comfy-Org/ComfyUI_frontend PR: 0
File: .github/copilot-instructions.md:0-0
Timestamp: 2025-11-24T19:47:02.860Z
Learning: Applies to src/**/*.{vue,ts} : Use vue-i18n in composition API for any string literals. Place new translation entries in src/locales/en/main.json
Learnt from: CR
Repo: Comfy-Org/ComfyUI_frontend PR: 0
File: src/components/CLAUDE.md:0-0
Timestamp: 2025-11-24T19:47:45.616Z
Learning: Applies to src/components/**/*.{vue,ts,js} : Use vue-i18n for ALL UI strings
Learnt from: CR
Repo: Comfy-Org/ComfyUI_frontend PR: 0
File: AGENTS.md:0-0
Timestamp: 2025-11-24T19:48:23.088Z
Learning: Applies to **/*.{ts,tsx,vue} : Enforce ESLint rules for Vue + TypeScript including: no floating promises, no unused imports, and i18n raw text restrictions in templates
Learnt from: CR
Repo: Comfy-Org/ComfyUI_frontend PR: 0
File: AGENTS.md:0-0
Timestamp: 2025-11-24T19:48:23.088Z
Learning: Applies to **/*.{ts,tsx,js,vue} : Organize imports by sorting and grouping by plugin, and run `pnpm format` before committing
Learnt from: CR
Repo: Comfy-Org/ComfyUI_frontend PR: 0
File: .cursor/rules/unit-test.mdc:0-0
Timestamp: 2025-11-24T19:48:09.318Z
Learning: Applies to test/**/*.{test,spec}.{js,ts,jsx,tsx} : Use `vitest` for unit testing in this project
📚 Learning: 2025-11-24T19:48:23.088Z
Learnt from: CR
Repo: Comfy-Org/ComfyUI_frontend PR: 0
File: AGENTS.md:0-0
Timestamp: 2025-11-24T19:48:23.088Z
Learning: Use `[skip ci]` in commit messages for locale-only updates when appropriate

Applied to files:

  • .github/workflows/i18n-update-core.yaml
📚 Learning: 2025-11-24T19:48:09.318Z
Learnt from: CR
Repo: Comfy-Org/ComfyUI_frontend PR: 0
File: .cursor/rules/unit-test.mdc:0-0
Timestamp: 2025-11-24T19:48:09.318Z
Learning: Applies to test/**/*.{test,spec}.{js,ts,jsx,tsx} : Prefer the use of `test.extend` over loose variables; import `test as baseTest` from `vitest`

Applied to files:

  • scripts/babel-plugin-vite-define.cjs
  • scripts/babel-plugin-inject-globals.cjs
  • playwright.i18n.config.ts
📚 Learning: 2025-11-24T19:48:09.318Z
Learnt from: CR
Repo: Comfy-Org/ComfyUI_frontend PR: 0
File: .cursor/rules/unit-test.mdc:0-0
Timestamp: 2025-11-24T19:48:09.318Z
Learning: Applies to test/**/*.{test,spec}.{js,ts,jsx,tsx} : Use `vitest` for unit testing in this project

Applied to files:

  • scripts/babel-plugin-vite-define.cjs
  • scripts/babel-plugin-inject-globals.cjs
  • package.json
  • playwright.i18n.config.ts
📚 Learning: 2025-11-24T19:48:23.088Z
Learnt from: CR
Repo: Comfy-Org/ComfyUI_frontend PR: 0
File: AGENTS.md:0-0
Timestamp: 2025-11-24T19:48:23.088Z
Learning: Applies to **/*.{ts,tsx,js,vue} : Organize imports by sorting and grouping by plugin, and run `pnpm format` before committing

Applied to files:

  • scripts/babel-plugin-inject-globals.cjs
  • knip.config.ts
  • pnpm-workspace.yaml
  • package.json
📚 Learning: 2025-11-24T19:48:03.270Z
Learnt from: CR
Repo: Comfy-Org/ComfyUI_frontend PR: 0
File: tests-ui/CLAUDE.md:0-0
Timestamp: 2025-11-24T19:48:03.270Z
Learning: Applies to tests-ui/**/*.test.{js,ts,jsx,tsx} : Mock external dependencies in tests

Applied to files:

  • scripts/babel-plugin-inject-globals.cjs
  • knip.config.ts
  • scripts/setup-i18n-globals.mjs
  • package.json
  • playwright.i18n.config.ts
📚 Learning: 2025-11-24T19:48:03.270Z
Learnt from: CR
Repo: Comfy-Org/ComfyUI_frontend PR: 0
File: tests-ui/CLAUDE.md:0-0
Timestamp: 2025-11-24T19:48:03.270Z
Learning: Applies to tests-ui/**/*.test.{js,ts,jsx,tsx} : Follow existing test patterns in the codebase

Applied to files:

  • scripts/babel-plugin-inject-globals.cjs
  • package.json
  • playwright.i18n.config.ts
📚 Learning: 2025-11-24T19:48:03.270Z
Learnt from: CR
Repo: Comfy-Org/ComfyUI_frontend PR: 0
File: tests-ui/CLAUDE.md:0-0
Timestamp: 2025-11-24T19:48:03.270Z
Learning: Applies to tests-ui/**/*.test.{js,ts,jsx,tsx} : Use existing test utilities rather than writing custom utilities

Applied to files:

  • scripts/babel-plugin-inject-globals.cjs
  • playwright.i18n.config.ts
📚 Learning: 2025-11-24T19:47:22.909Z
Learnt from: CR
Repo: Comfy-Org/ComfyUI_frontend PR: 0
File: browser_tests/CLAUDE.md:0-0
Timestamp: 2025-11-24T19:47:22.909Z
Learning: Applies to browser_tests/**/*.{e2e,spec}.{ts,tsx,js,jsx} : Use Playwright fixtures for browser tests

Applied to files:

  • scripts/babel-plugin-inject-globals.cjs
  • scripts/setup-i18n-globals.mjs
  • playwright.i18n.config.ts
📚 Learning: 2025-11-24T19:48:23.088Z
Learnt from: CR
Repo: Comfy-Org/ComfyUI_frontend PR: 0
File: AGENTS.md:0-0
Timestamp: 2025-11-24T19:48:23.088Z
Learning: Applies to **/*.{ts,tsx,vue} : Enforce ESLint rules for Vue + TypeScript including: no floating promises, no unused imports, and i18n raw text restrictions in templates

Applied to files:

  • knip.config.ts
  • package.json
📚 Learning: 2025-11-24T19:46:52.279Z
Learnt from: CR
Repo: Comfy-Org/ComfyUI_frontend PR: 0
File: .cursorrules:0-0
Timestamp: 2025-11-24T19:46:52.279Z
Learning: Applies to **/*.vue : Do not use deprecated PrimeVue components (Dropdown, OverlayPanel, Calendar, InputSwitch, Sidebar, Chips, TabMenu, Steps, InlineMessage). Use replacements: Select, Popover, DatePicker, ToggleSwitch, Drawer, AutoComplete, Tabs, Stepper, Message respectively

Applied to files:

  • knip.config.ts
📚 Learning: 2025-11-24T19:47:34.324Z
Learnt from: CR
Repo: Comfy-Org/ComfyUI_frontend PR: 0
File: src/CLAUDE.md:0-0
Timestamp: 2025-11-24T19:47:34.324Z
Learning: Applies to src/**/{components,composables}/**/*.{ts,tsx,vue} : Use vue-i18n for ALL user-facing strings by adding them to `src/locales/en/main.json`

Applied to files:

  • knip.config.ts
  • src/locales/en/main.json
📚 Learning: 2025-11-24T19:46:52.279Z
Learnt from: CR
Repo: Comfy-Org/ComfyUI_frontend PR: 0
File: .cursorrules:0-0
Timestamp: 2025-11-24T19:46:52.279Z
Learning: Applies to **/*.vue : Never use deprecated PrimeVue components (Dropdown, OverlayPanel, Calendar, InputSwitch, Sidebar, Chips, TabMenu, Steps, InlineMessage)

Applied to files:

  • knip.config.ts
📚 Learning: 2025-11-24T19:47:45.616Z
Learnt from: CR
Repo: Comfy-Org/ComfyUI_frontend PR: 0
File: src/components/CLAUDE.md:0-0
Timestamp: 2025-11-24T19:47:45.616Z
Learning: Applies to src/components/**/*.{vue,ts,js} : Use vue-i18n for ALL UI strings

Applied to files:

  • knip.config.ts
📚 Learning: 2025-11-24T19:46:52.279Z
Learnt from: CR
Repo: Comfy-Org/ComfyUI_frontend PR: 0
File: .cursorrules:0-0
Timestamp: 2025-11-24T19:46:52.279Z
Learning: Applies to **/*.{vue,ts,tsx} : Use vue-i18n in Composition API for any string literals and place new translation entries in src/locales/en/main.json

Applied to files:

  • knip.config.ts
  • src/locales/en/main.json
📚 Learning: 2025-11-24T19:47:02.860Z
Learnt from: CR
Repo: Comfy-Org/ComfyUI_frontend PR: 0
File: .github/copilot-instructions.md:0-0
Timestamp: 2025-11-24T19:47:02.860Z
Learning: Applies to src/**/*.{vue,ts} : Use vue-i18n in composition API for any string literals. Place new translation entries in src/locales/en/main.json

Applied to files:

  • knip.config.ts
  • src/locales/en/main.json
📚 Learning: 2025-11-24T19:47:34.324Z
Learnt from: CR
Repo: Comfy-Org/ComfyUI_frontend PR: 0
File: src/CLAUDE.md:0-0
Timestamp: 2025-11-24T19:47:34.324Z
Learning: Applies to src/**/*.{ts,tsx,vue} : Use es-toolkit for utility functions instead of other utility libraries

Applied to files:

  • knip.config.ts
  • package.json
📚 Learning: 2025-11-24T19:48:03.270Z
Learnt from: CR
Repo: Comfy-Org/ComfyUI_frontend PR: 0
File: tests-ui/CLAUDE.md:0-0
Timestamp: 2025-11-24T19:48:03.270Z
Learning: Applies to tests-ui/**/*.test.{js,ts,jsx,tsx} : Write tests for new features

Applied to files:

  • scripts/setup-i18n-globals.mjs
  • playwright.i18n.config.ts
📚 Learning: 2025-11-24T19:47:22.909Z
Learnt from: CR
Repo: Comfy-Org/ComfyUI_frontend PR: 0
File: browser_tests/CLAUDE.md:0-0
Timestamp: 2025-11-24T19:47:22.909Z
Learning: Applies to browser_tests/**/*.{e2e,spec}.{ts,tsx,js,jsx} : Test user workflows in browser tests

Applied to files:

  • scripts/setup-i18n-globals.mjs
  • playwright.i18n.config.ts
📚 Learning: 2025-11-24T19:47:22.909Z
Learnt from: CR
Repo: Comfy-Org/ComfyUI_frontend PR: 0
File: browser_tests/CLAUDE.md:0-0
Timestamp: 2025-11-24T19:47:22.909Z
Learning: Applies to browser_tests/**/*.{e2e,spec}.{ts,tsx,js,jsx} : Check assets/ directory for test data when writing tests

Applied to files:

  • scripts/setup-i18n-globals.mjs
  • playwright.i18n.config.ts
📚 Learning: 2025-11-24T19:46:52.279Z
Learnt from: CR
Repo: Comfy-Org/ComfyUI_frontend PR: 0
File: .cursorrules:0-0
Timestamp: 2025-11-24T19:46:52.279Z
Learning: Applies to **/*.{ts,tsx,js} : Use es-toolkit for utility functions

Applied to files:

  • package.json
📚 Learning: 2025-11-24T19:48:09.318Z
Learnt from: CR
Repo: Comfy-Org/ComfyUI_frontend PR: 0
File: .cursor/rules/unit-test.mdc:0-0
Timestamp: 2025-11-24T19:48:09.318Z
Learning: Applies to test/**/*.{test,spec}.{js,ts,jsx,tsx} : Tests should be cross-platform compatible using `path.resolve`, `path.join`, and `path.sep` for Windows, macOS, and Linux compatibility

Applied to files:

  • playwright.i18n.config.ts
📚 Learning: 2025-11-24T19:48:23.088Z
Learnt from: CR
Repo: Comfy-Org/ComfyUI_frontend PR: 0
File: AGENTS.md:0-0
Timestamp: 2025-11-24T19:48:23.088Z
Learning: Applies to browser_tests/**/*.{test,spec}.ts : Playwright E2E tests can use optional tags like `mobile` and `2x` which are respected by the Playwright configuration

Applied to files:

  • playwright.i18n.config.ts
📚 Learning: 2025-11-24T19:48:23.088Z
Learnt from: CR
Repo: Comfy-Org/ComfyUI_frontend PR: 0
File: AGENTS.md:0-0
Timestamp: 2025-11-24T19:48:23.088Z
Learning: Use Vitest (with happy-dom) for unit and component tests, and Playwright for E2E tests

Applied to files:

  • playwright.i18n.config.ts
📚 Learning: 2025-11-24T19:48:23.088Z
Learnt from: CR
Repo: Comfy-Org/ComfyUI_frontend PR: 0
File: AGENTS.md:0-0
Timestamp: 2025-11-24T19:48:23.088Z
Learning: Vitest test files should use coverage enabled with text, json, and html reporters as configured in `vitest.config.ts`

Applied to files:

  • playwright.i18n.config.ts
📚 Learning: 2025-11-24T19:47:22.909Z
Learnt from: CR
Repo: Comfy-Org/ComfyUI_frontend PR: 0
File: browser_tests/CLAUDE.md:0-0
Timestamp: 2025-11-24T19:47:22.909Z
Learning: Applies to browser_tests/**/*.{e2e,spec}.{ts,tsx,js,jsx} : Test across multiple viewports

Applied to files:

  • playwright.i18n.config.ts
🧬 Code graph analysis (2)
scripts/babel-plugin-inject-globals.cjs (1)
scripts/babel-plugin-vite-define.cjs (3)
  • require (10-10)
  • require (55-55)
  • path (9-9)
playwright.i18n.config.ts (1)
scripts/babel-plugin-vite-define.cjs (1)
  • path (9-9)
🪛 ESLint
scripts/babel-plugin-vite-define.cjs

[error] 9-9: A require() style import is forbidden.

(@typescript-eslint/no-require-imports)


[error] 9-9: 'require' is not defined.

(no-undef)


[error] 10-10: A require() style import is forbidden.

(@typescript-eslint/no-require-imports)


[error] 10-10: 'require' is not defined.

(no-undef)


[error] 23-23: '__dirname' is not defined.

(no-undef)


[error] 31-31: 'console' is not defined.

(no-undef)


[error] 31-31: Unexpected console statement. Only these console methods are allowed: warn, error.

(no-console)


[error] 31-31: Replace '[babel-plugin-vite-define]·Loaded·Vite·defines:',·Object.keys(viteDefines) with ⏎········'[babel-plugin-vite-define]·Loaded·Vite·defines:',⏎········Object.keys(viteDefines)⏎······

(prettier/prettier)


[error] 34-34: 'console' is not defined.

(no-undef)


[error] 38-38: 'console' is not defined.

(no-undef)


[error] 38-38: Replace '[babel-plugin-vite-define]·Error·loading·Vite·config:',·error with ⏎······'[babel-plugin-vite-define]·Error·loading·Vite·config:',⏎······error⏎····

(prettier/prettier)


[error] 44-44: 'module' is not defined.

(no-undef)


[error] 55-55: A require() style import is forbidden.

(@typescript-eslint/no-require-imports)


[error] 55-55: 'require' is not defined.

(no-undef)


[error] 67-67: 'console' is not defined.

(no-undef)


[error] 67-67: Unexpected console statement. Only these console methods are allowed: warn, error.

(no-console)


[error] 67-67: Replace '[babel-plugin-vite-define]·Using·default·defines·for·Playwright·tests' with ⏎············'[babel-plugin-vite-define]·Using·default·defines·for·Playwright·tests'⏎··········

(prettier/prettier)


[error] 69-69: 'console' is not defined.

(no-undef)


[error] 69-69: Replace '[babel-plugin-vite-define]·Error·setting·up·defines:',·error with ⏎············'[babel-plugin-vite-define]·Error·setting·up·defines:',⏎············error⏎··········

(prettier/prettier)


[error] 92-92: Replace path.parent.type·===·'MemberExpression'·&&·path.parent.property·===·path.node with (path.parent.type·===·'MemberExpression'·&&⏎············path.parent.property·===·path.node)

(prettier/prettier)


[error] 93-93: Replace path.parent.type·===·'ObjectProperty'·&&·path.parent.key·===·path.node with (path.parent.type·===·'ObjectProperty'·&&⏎············path.parent.key·===·path.node)

(prettier/prettier)


[error] 135-136: Delete ⏎·········

(prettier/prettier)


[error] 137-137: 'console' is not defined.

(no-undef)


[error] 137-137: Replace ``[babel-plugin-vite-define]·Unsupported·replacement·type·for·${name}:,·typeof·replacement with `⏎··············`[babel-plugin-vite-define]·Unsupported·replacement·type·for·${name}:`,⏎··············typeof·replacement⏎············`

(prettier/prettier)


[error] 143-143: 'console' is not defined.

(no-undef)


[error] 143-143: Replace ``[babel-plugin-vite-define]·Error·replacing·${name}:,·error with `⏎············`[babel-plugin-vite-define]·Error·replacing·${name}:`,⏎············error⏎··········`

(prettier/prettier)

scripts/babel-plugin-inject-globals.cjs

[error] 8-8: A require() style import is forbidden.

(@typescript-eslint/no-require-imports)


[error] 8-8: 'require' is not defined.

(no-undef)


[error] 10-10: 'module' is not defined.

(no-undef)


[error] 11-11: Replace ·filenamePattern·=·'collect-i18n-',·setupFile·=·'./setup-i18n-globals.mjs' with ⏎····filenamePattern·=·'collect-i18n-',⏎····setupFile·=·'./setup-i18n-globals.mjs'⏎·

(prettier/prettier)


[error] 46-46: 'console' is not defined.

(no-undef)


[error] 46-46: Unexpected console statement. Only these console methods are allowed: warn, error.

(no-console)


[error] 46-46: Replace [babel-plugin-inject-globals]·Injected·setup·into·${nodePath.basename(filename)} with ⏎············[babel-plugin-inject-globals]·Injected·setup·into·${nodePath.basename(filename)}⏎··········

(prettier/prettier)

scripts/setup-i18n-globals.mjs

[error] 8-8: Unable to resolve path to module 'jsdom'.

(import-x/no-unresolved)


[error] 18-18: 'global' is not defined.

(no-undef)


[error] 19-19: 'global' is not defined.

(no-undef)


[error] 22-22: 'global' is not defined.

(no-undef)


[error] 29-29: 'global' is not defined.

(no-undef)


[error] 30-30: 'global' is not defined.

(no-undef)


[error] 31-31: 'global' is not defined.

(no-undef)


[error] 32-32: 'global' is not defined.

(no-undef)


[error] 33-33: 'global' is not defined.

(no-undef)


[error] 34-34: 'global' is not defined.

(no-undef)


[error] 34-34: Replace ·dom.window.ResizeObserver·|| with ⏎··dom.window.ResizeObserver·||⏎·

(prettier/prettier)


[error] 35-35: Insert ··

(prettier/prettier)


[error] 36-36: Insert ··

(prettier/prettier)


[error] 37-37: Replace ·· with ····

(prettier/prettier)


[error] 38-38: Insert ··

(prettier/prettier)


[error] 39-39: 'global' is not defined.

(no-undef)


[error] 39-39: Replace ·dom.window.IntersectionObserver·|| with ⏎··dom.window.IntersectionObserver·||⏎·

(prettier/prettier)


[error] 40-40: Insert ··

(prettier/prettier)


[error] 41-41: Insert ··

(prettier/prettier)


[error] 42-42: Replace ·· with ····

(prettier/prettier)


[error] 43-43: Insert ··

(prettier/prettier)


[error] 46-46: 'global' is not defined.

(no-undef)


[error] 52-52: 'global' is not defined.

(no-undef)


[error] 60-60: 'global' is not defined.

(no-undef)


[error] 60-60: 'setTimeout' is not defined.

(no-undef)


[error] 61-61: 'global' is not defined.

(no-undef)


[error] 61-61: 'clearTimeout' is not defined.

(no-undef)

🔇 Additional comments (10)
src/locales/en/main.json (2)

1110-1110: Experimental feature label consolidation looks good.

The consolidation of multiple experimental Vue Nodes entries into a single "Experimental: Enable Nodes 2_0" key is appropriate and aligns with the feature reorganization.


1325-1327: Node category translations are correctly formatted and follow established patterns.

The three new translations (dataset, text, image) match the structure of existing nodeCategories entries. These are i18n entries for node categories that are auto-generated from backend node definitions via collect-i18n-node-defs.ts, not manually-defined node types in nodeDefs.json. The translations are valid and will be populated when the category collection script runs against nodes that declare these categories.

package.json (1)

79-79: LGTM!

The addition of babel-plugin-module-resolver as a dev dependency is correctly placed and uses the catalog reference consistently with other dependencies. This supports the new Babel plugin infrastructure for i18n test compilation.

pnpm-workspace.yaml (1)

49-49: LGTM!

The catalog entry for babel-plugin-module-resolver is properly sorted and uses a reasonable version range.

.github/workflows/i18n-update-core.yaml (1)

15-18: Consider removing the sno- branch trigger before merging.

The sno- prefix appears to be a developer-specific branch naming convention (likely for testing this PR). Keeping this condition in the workflow would cause the i18n update job to run for any future PR branches starting with sno-, which may not be intended behavior.

If this is for testing purposes only, consider removing line 18 before merging:

     if: |
       github.event_name == 'workflow_dispatch'
       || (github.event.pull_request.head.repo.full_name == github.repository && startsWith(github.head_ref, 'version-bump-')) 
-      || (github.event.pull_request.head.repo.full_name == github.repository && startsWith(github.head_ref, 'sno-')) 
knip.config.ts (1)

37-39: LGTM!

Good addition with a helpful comment explaining why the dependency is ignored. Knip cannot detect the usage since the plugin is referenced dynamically in the Playwright Babel configuration.

scripts/babel-plugin-inject-globals.cjs (1)

10-11: LGTM!

Good use of configurable options with sensible defaults. The plugin correctly handles the pattern matching and prevents duplicate imports.

playwright.i18n.config.ts (2)

2-5: LGTM!

Standard ESM pattern for computing __dirname since import.meta.url is the ESM equivalent.


7-23: LGTM!

The configuration is well-structured with appropriate timeouts and reuseExistingServer: true for CI efficiency.

src/locales/en/nodeDefs.json (1)

11610-11616: LGTM: SplitSigmas outputs are now named.

Clear “high_sigmas” and “low_sigmas” improve graph legibility without changing behavior. Nice.

Comment on lines +51 to +57
[
path.join(__dirname, 'scripts/babel-plugin-inject-globals.cjs'),
{
filenamePattern: 'collect-i18n-',
setupFile: './setup-i18n-globals.mjs'
}
]
Copy link
Contributor

Choose a reason for hiding this comment

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

⚠️ Potential issue | 🔴 Critical

🧩 Analysis chain

🏁 Script executed:

#!/bin/bash
echo "=== Checking setup file existence ==="
fd -t f 'setup-i18n-globals.mjs'

echo -e "\n=== Checking inject-globals plugin implementation ==="
cat scripts/babel-plugin-inject-globals.cjs 2>/dev/null || echo "File not found"

echo -e "\n=== Listing scripts directory ==="
ls -la scripts/ | grep -E '\.(cjs|mjs)$'

Repository: Comfy-Org/ComfyUI_frontend

Length of output: 1924


Use absolute path for setupFile to ensure correct resolution from test files.

The setupFile: './setup-i18n-globals.mjs' is a relative path that gets injected directly into test files as an import statement. Since test files are in the test/ directory, this relative path will fail to resolve. Use an absolute path instead:

    [
      path.join(__dirname, 'scripts/babel-plugin-inject-globals.cjs'),
      {
        filenamePattern: 'collect-i18n-',
-       setupFile: './setup-i18n-globals.mjs'
+       setupFile: path.join(__dirname, 'scripts/setup-i18n-globals.mjs')
      }
    ]
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
[
path.join(__dirname, 'scripts/babel-plugin-inject-globals.cjs'),
{
filenamePattern: 'collect-i18n-',
setupFile: './setup-i18n-globals.mjs'
}
]
[
path.join(__dirname, 'scripts/babel-plugin-inject-globals.cjs'),
{
filenamePattern: 'collect-i18n-',
setupFile: path.join(__dirname, 'scripts/setup-i18n-globals.mjs')
}
]
🤖 Prompt for AI Agents
In playwright.i18n.config.ts around lines 51 to 57, the plugin option uses a
relative setupFile ('./setup-i18n-globals.mjs') which will be injected into
tests and fail to resolve from the test/ directory; change it to an absolute
path (built from __dirname, e.g. path.join/__dirname or path.resolve to the
setup-i18n-globals.mjs file) so the injected import is an absolute path that
resolves regardless of the test file location.

Comment on lines +17 to +42
async function loadViteDefines() {
if (viteDefines !== null) {
return viteDefines
}

try {
const configFile = path.resolve(__dirname, '../vite.config.mts')
const result = await loadConfigFromFile(
{ command: 'build', mode: 'production' },
configFile
)

if (result && result.config && result.config.define) {
viteDefines = result.config.define
console.log('[babel-plugin-vite-define] Loaded Vite defines:', Object.keys(viteDefines))
} else {
viteDefines = {}
console.warn('[babel-plugin-vite-define] No defines found in Vite config')
}
} catch (error) {
viteDefines = {}
console.error('[babel-plugin-vite-define] Error loading Vite config:', error)
}

return viteDefines
}
Copy link
Contributor

Choose a reason for hiding this comment

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

🛠️ Refactor suggestion | 🟠 Major

Remove unused loadViteDefines function.

The loadViteDefines async function is never called. The plugin uses hardcoded defaults in the pre() hook instead. Consider removing this dead code to avoid confusion:

-let viteDefines = null
-
-/**
- * Load Vite config and extract define replacements
- */
-async function loadViteDefines() {
-  if (viteDefines !== null) {
-    return viteDefines
-  }
-
-  try {
-    const configFile = path.resolve(__dirname, '../vite.config.mts')
-    const result = await loadConfigFromFile(
-      { command: 'build', mode: 'production' },
-      configFile
-    )
-
-    if (result && result.config && result.config.define) {
-      viteDefines = result.config.define
-      console.log('[babel-plugin-vite-define] Loaded Vite defines:', Object.keys(viteDefines))
-    } else {
-      viteDefines = {}
-      console.warn('[babel-plugin-vite-define] No defines found in Vite config')
-    }
-  } catch (error) {
-    viteDefines = {}
-    console.error('[babel-plugin-vite-define] Error loading Vite config:', error)
-  }
-
-  return viteDefines
-}
+let viteDefines = null

Also remove the unused imports at the top:

 const path = require('path')
-const { loadConfigFromFile } = require('vite')
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
async function loadViteDefines() {
if (viteDefines !== null) {
return viteDefines
}
try {
const configFile = path.resolve(__dirname, '../vite.config.mts')
const result = await loadConfigFromFile(
{ command: 'build', mode: 'production' },
configFile
)
if (result && result.config && result.config.define) {
viteDefines = result.config.define
console.log('[babel-plugin-vite-define] Loaded Vite defines:', Object.keys(viteDefines))
} else {
viteDefines = {}
console.warn('[babel-plugin-vite-define] No defines found in Vite config')
}
} catch (error) {
viteDefines = {}
console.error('[babel-plugin-vite-define] Error loading Vite config:', error)
}
return viteDefines
}
let viteDefines = null
🧰 Tools
🪛 ESLint

[error] 23-23: '__dirname' is not defined.

(no-undef)


[error] 31-31: 'console' is not defined.

(no-undef)


[error] 31-31: Unexpected console statement. Only these console methods are allowed: warn, error.

(no-console)


[error] 31-31: Replace '[babel-plugin-vite-define]·Loaded·Vite·defines:',·Object.keys(viteDefines) with ⏎········'[babel-plugin-vite-define]·Loaded·Vite·defines:',⏎········Object.keys(viteDefines)⏎······

(prettier/prettier)


[error] 34-34: 'console' is not defined.

(no-undef)


[error] 38-38: 'console' is not defined.

(no-undef)


[error] 38-38: Replace '[babel-plugin-vite-define]·Error·loading·Vite·config:',·error with ⏎······'[babel-plugin-vite-define]·Error·loading·Vite·config:',⏎······error⏎····

(prettier/prettier)

🤖 Prompt for AI Agents
In scripts/babel-plugin-vite-define.cjs around lines 17 to 42, remove the unused
async function loadViteDefines (and its internal logic) because it's never
called; also remove any now-unused imports at the top of the file that were only
required by this function (e.g., loadConfigFromFile, path or similar) so there
are no dead functions or unused imports left; ensure any remaining references to
viteDefines are preserved or replaced by the existing hardcoded defaults in
pre().

Comment on lines 2838 to 2840
"name": "aspect_ratio",
"tooltip": "If set to 'auto', matches your input image's aspect ratio; if no image is provided, generates a 1:1 square."
"tooltip": "If set to 'auto', matches your input image's aspect ratio; if no image is provided, a 16:9 square is usually generated."
},
Copy link
Contributor

Choose a reason for hiding this comment

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

🛠️ Refactor suggestion | 🟠 Major

Fix Gemini aspect ratio tooltip (“16:9 square”).

Square is 1:1; 16:9 is widescreen. Suggest:

-        "tooltip": "If set to 'auto', matches your input image's aspect ratio; if no image is provided, a 16:9 square is usually generated."
+        "tooltip": "If set to 'auto', matches your input image's aspect ratio; if no image is provided, a 1:1 square is usually generated."
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
"name": "aspect_ratio",
"tooltip": "If set to 'auto', matches your input image's aspect ratio; if no image is provided, generates a 1:1 square."
"tooltip": "If set to 'auto', matches your input image's aspect ratio; if no image is provided, a 16:9 square is usually generated."
},
"name": "aspect_ratio",
"tooltip": "If set to 'auto', matches your input image's aspect ratio; if no image is provided, a 1:1 square is usually generated."
},
🤖 Prompt for AI Agents
In src/locales/en/nodeDefs.json around lines 2838 to 2840, the tooltip text for
"aspect_ratio" incorrectly calls "16:9" a square; update the tooltip to replace
"16:9 square" with a correct phrase such as "16:9 widescreen" or "16:9
rectangle" so the message reads that if no image is provided a 16:9 widescreen
(not square) image is usually generated; keep punctuation and quotation style
consistent with surrounding entries.

Comment on lines +4449 to +4540
"display_name": "Kling Omni Image to Video (Pro)",
"description": "Use up to 7 reference images to generate a video with the latest Kling model.",
"inputs": {
"model_name": {
"name": "model_name"
},
"prompt": {
"name": "prompt",
"tooltip": "A text prompt describing the video content. This can include both positive and negative descriptions."
},
"aspect_ratio": {
"name": "aspect_ratio"
},
"duration": {
"name": "duration"
},
"reference_images": {
"name": "reference_images",
"tooltip": "Up to 7 reference images."
}
},
"outputs": {
"0": {
"tooltip": null
}
}
},
"KlingOmniProTextToVideoNode": {
"display_name": "Kling Omni Text to Video (Pro)",
"description": "Use text prompts to generate videos with the latest Kling model.",
"inputs": {
"model_name": {
"name": "model_name"
},
"prompt": {
"name": "prompt",
"tooltip": "A text prompt describing the video content. This can include both positive and negative descriptions."
},
"aspect_ratio": {
"name": "aspect_ratio"
},
"duration": {
"name": "duration"
}
},
"outputs": {
"0": {
"tooltip": null
}
}
},
"KlingOmniProVideoToVideoNode": {
"display_name": "Kling Omni Video to Video (Pro)",
"description": "Use a video and up to 4 reference images to generate a video with the latest Kling model.",
"inputs": {
"model_name": {
"name": "model_name"
},
"prompt": {
"name": "prompt",
"tooltip": "A text prompt describing the video content. This can include both positive and negative descriptions."
},
"aspect_ratio": {
"name": "aspect_ratio"
},
"duration": {
"name": "duration"
},
"reference_video": {
"name": "reference_video",
"tooltip": "Video to use as a reference."
},
"keep_original_sound": {
"name": "keep_original_sound"
},
"reference_images": {
"name": "reference_images",
"tooltip": "Up to 4 additional reference images."
}
},
"outputs": {
"0": {
"tooltip": null
}
}
},
"KlingSingleImageVideoEffectNode": {
"display_name": "Kling Video Effects",
"description": "Achieve different special effects when generating a video based on the effect_scene.",
"inputs": {
"image": {
"name": "image",
Copy link
Contributor

Choose a reason for hiding this comment

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

⚠️ Potential issue | 🟠 Major

🧩 Analysis chain

🏁 Script executed:

#!/bin/bash
# Find references to legacy Kling nodes mentioned in the comment
rg -nP 'KlingSingleImageVideoEffectNode|KlingStartEndFrameNode'

Repository: Comfy-Org/ComfyUI_frontend

Length of output: 2589


🏁 Script executed:

#!/bin/bash
# Search for all Kling node definitions in nodeDefs.json
rg -n 'Kling.*Node.*":' src/locales/en/nodeDefs.json | head -40

Repository: Comfy-Org/ComfyUI_frontend

Length of output: 724


🏁 Script executed:

#!/bin/bash
# Check the file size and structure around the added content
wc -l src/locales/en/nodeDefs.json
# Also look for any deprecation patterns in the file
rg -n 'deprecated|deprecated_in_favor_of|legacy' src/locales/en/nodeDefs.json | head -20

Repository: Comfy-Org/ComfyUI_frontend

Length of output: 178


🏁 Script executed:

#!/bin/bash
# Check if new Pro nodes have pricing entries
rg -n 'KlingOmniPro.*Node.*:' src/composables/node/useNodePricing.ts | head -20

Repository: Comfy-Org/ComfyUI_frontend

Length of output: 52


🏁 Script executed:

#!/bin/bash
# Look for any deprecation patterns in the TypeScript codebase
rg -n 'deprecated|isDeprecated' src/ -t ts --max-count 20

Repository: Comfy-Org/ComfyUI_frontend

Length of output: 15868


🏁 Script executed:

#!/bin/bash
# Check what the relationship is between legacy and Pro nodes - do they have similar inputs?
cat src/locales/en/nodeDefs.json | sed -n '4535,4566p'

Repository: Comfy-Org/ComfyUI_frontend

Length of output: 930


🏁 Script executed:

#!/bin/bash
# Verify new Pro nodes don't have pricing entries yet
rg -n 'KlingOmniPro' src/composables/node/useNodePricing.ts

Repository: Comfy-Org/ComfyUI_frontend

Length of output: 52


Add deprecated flag to legacy Kling nodes; coordinate with pricing and test updates.

The codebase has an established deprecation mechanism (deprecated: boolean in nodeDefSchema). Since Omni Pro nodes supersede the legacy variants, add "deprecated": true to KlingSingleImageVideoEffectNode and KlingStartEndFrameNode in all locale files. This will automatically hide them from the palette unless explicitly enabled.

Before deprecating, ensure pricing entries exist for the new Pro nodes in src/composables/node/useNodePricing.ts (currently missing), and update or maintain test cases in tests-ui/tests/composables/node/useNodePricing.test.ts that reference the legacy nodes.

🤖 Prompt for AI Agents
In src/locales/en/nodeDefs.json around lines 4449-4540, add "deprecated": true
to the KlingSingleImageVideoEffectNode and KlingStartEndFrameNode entries (and
mirror this change across all locale nodeDefs files) so the legacy nodes are
hidden by the deprecation mechanism; then add pricing entries for the new Pro
nodes (KlingOmniProImageToVideoNode, KlingOmniProTextToVideoNode,
KlingOmniProVideoToVideoNode) in src/composables/node/useNodePricing.ts and
update tests in tests-ui/tests/composables/node/useNodePricing.test.ts to
reference the new Pro nodes (or adjust assertions) so pricing and tests remain
consistent with the deprecation change.

Comment on lines +5479 to 5482
"name": "model",
"tooltip": "The modified diffusion model."
}
}
Copy link
Contributor

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:

sed -n '5470,5490p' src/locales/en/nodeDefs.json

Repository: Comfy-Org/ComfyUI_frontend

Length of output: 603


🏁 Script executed:

rg -nP 'model_with_lora' --max-count=20

Repository: Comfy-Org/ComfyUI_frontend

Length of output: 138


🏁 Script executed:

rg -nP '"model"' src/locales/en/nodeDefs.json | head -20

Repository: Comfy-Org/ComfyUI_frontend

Length of output: 560


🏁 Script executed:

rg -nP 'nodeDefs|outputs.*name' src --type=ts --type=tsx --type=js --max-count=30

Repository: Comfy-Org/ComfyUI_frontend

Length of output: 97


🏁 Script executed:

grep -n "model_with_lora" src/locales/ja/nodeDefs.json

Repository: Comfy-Org/ComfyUI_frontend

Length of output: 109


🏁 Script executed:

rg -nP 'nodeDefs' src --type=ts --type=js | head -20

Repository: Comfy-Org/ComfyUI_frontend

Length of output: 1599


🏁 Script executed:

rg -nP 'outputs.*name|name.*output' src --type=ts --type=js | head -20

Repository: Comfy-Org/ComfyUI_frontend

Length of output: 2068


🏁 Script executed:

fd -e ts -e js src | head -5

Repository: Comfy-Org/ComfyUI_frontend

Length of output: 52


🏁 Script executed:

rg -nP 'model_with_lora' --type=ts --type=js

Repository: Comfy-Org/ComfyUI_frontend

Length of output: 52


🏁 Script executed:

rg -nP 'LoraModelonly' src --type=ts --type=js

Repository: Comfy-Org/ComfyUI_frontend

Length of output: 52


Update Japanese locale to match English output name change.

The English locale was renamed from model_with_lora to model in the output definition, but the Japanese locale (ja/nodeDefs.json, line 11534) still has the old name. While no code hardcodes this string, the output names are read by the UI layer, so translations should remain consistent across locales.

Update src/locales/ja/nodeDefs.json line 11534 to align with the English version.

🤖 Prompt for AI Agents
In src/locales/ja/nodeDefs.json around line 11534, the output name still uses
the old key "model_with_lora"; update that entry so its "name" value matches the
English change to "model" (and ensure the "tooltip" remains the appropriate
Japanese translation of "The modified diffusion model."), keeping JSON syntax
and localization formatting intact.

@DrJKL
Copy link
Contributor

DrJKL commented Dec 2, 2025

Converting to draft as a backup.

@DrJKL DrJKL marked this pull request as draft December 2, 2025 03:37
@snomiao
Copy link
Member Author

snomiao commented Dec 2, 2025

closed, can open later if needed :D @DrJKL

@snomiao snomiao closed this Dec 2, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

size:XXL This PR changes 1000+ lines, ignoring generated files.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants