mirror of
https://github.com/Comfy-Org/ComfyUI_frontend.git
synced 2026-01-26 19:09:52 +00:00
cleanup: remove the legacy mask editor and all related code (#7370)
## Summary Removes the legacy mask editor. May also want to remove the "Beta" tags on all the current mask editor components/mentions in the app now as well. ## Context Telemetry data shows zero users using the legacy mask editor. It has been considerable time since we switched to the new one, and there really is no reason to use the legacy version given how lacking it is. In https://github.com/Comfy-Org/ComfyUI_frontend/pull/7332 (v1.35.2 - Dec 11, 2025), we added a final warning that the legacy mask editor is being removed. On 1.36, this PR can be merged, as more than enough warning will have been given. ┆Issue is synchronized with this [Notion page](https://www.notion.so/PR-7370-cleanup-remove-the-legacy-mask-editor-and-all-related-code-2c66d73d365081d58fbed0f3c84bcb0d) by [Unito](https://www.unito.io)
This commit is contained in:
@@ -46,7 +46,6 @@
|
||||
# Mask Editor
|
||||
/src/extensions/core/maskeditor.ts @trsommer @brucew4yn3rp
|
||||
/src/extensions/core/maskEditorLayerFilenames.ts @trsommer @brucew4yn3rp
|
||||
/src/extensions/core/maskEditorOld.ts @trsommer @brucew4yn3rp
|
||||
|
||||
# 3D
|
||||
/src/extensions/core/load3d.ts @jtydhr88
|
||||
|
||||
@@ -9,11 +9,7 @@ interface ShimResult {
|
||||
const SKIP_WARNING_FILES = new Set(['scripts/app', 'scripts/api'])
|
||||
|
||||
/** Files that will be removed in v1.34 */
|
||||
const DEPRECATED_FILES = [
|
||||
'scripts/ui',
|
||||
'extensions/core/maskEditorOld',
|
||||
'extensions/core/groupNode'
|
||||
] as const
|
||||
const DEPRECATED_FILES = ['scripts/ui', 'extensions/core/groupNode'] as const
|
||||
|
||||
function getWarningMessage(
|
||||
fileKey: string,
|
||||
|
||||
@@ -41,7 +41,6 @@ The following table lists ALL core extensions in the system as of 2025-01-30:
|
||||
| groupOptions.ts | Handles group node configuration options | Graph |
|
||||
| index.ts | Main extension registration and coordination | Core |
|
||||
| load3d.ts | Supports 3D model loading and visualization | 3D |
|
||||
| maskEditorOld.ts | Legacy mask editor implementation | Image |
|
||||
| maskeditor.ts | Implements the mask editor for image masking operations | Image |
|
||||
| nodeTemplates.ts | Provides node template functionality | Templates |
|
||||
| noteNode.ts | Adds note nodes for documentation within workflows | Graph |
|
||||
@@ -178,4 +177,4 @@ For more detailed information about ComfyUI's extension system, refer to the off
|
||||
- [JavaScript Settings](https://docs.comfy.org/custom-nodes/js/javascript_settings)
|
||||
- [JavaScript Examples](https://docs.comfy.org/custom-nodes/js/javascript_examples)
|
||||
|
||||
Also, check the main [README.md](https://github.com/Comfy-Org/ComfyUI_frontend#developer-apis) section on Developer APIs for the latest information on extension APIs and features.
|
||||
Also, check the main [README.md](https://github.com/Comfy-Org/ComfyUI_frontend#developer-apis) section on Developer APIs for the latest information on extension APIs and features.
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@@ -1,26 +1,10 @@
|
||||
import _ from 'es-toolkit/compat'
|
||||
import type { LGraphNode } from '@/lib/litegraph/src/litegraph'
|
||||
|
||||
import { t } from '@/i18n'
|
||||
import { useMaskEditor } from '@/composables/maskeditor/useMaskEditor'
|
||||
import { useToastStore } from '@/platform/updates/common/toastStore'
|
||||
import { app } from '@/scripts/app'
|
||||
import { ComfyApp } from '@/scripts/app'
|
||||
import { useDialogStore } from '@/stores/dialogStore'
|
||||
import { useMaskEditorStore } from '@/stores/maskEditorStore'
|
||||
import { ClipspaceDialog } from './clipspace'
|
||||
import { MaskEditorDialogOld } from './maskEditorOld'
|
||||
|
||||
const warnLegacyMaskEditorDeprecation = () => {
|
||||
const warningMessage = t('toastMessages.legacyMaskEditorDeprecated')
|
||||
console.warn(`[Comfy.MaskEditor] ${warningMessage}`)
|
||||
useToastStore().add({
|
||||
severity: 'warn',
|
||||
summary: 'Alert',
|
||||
detail: warningMessage,
|
||||
life: 4096
|
||||
})
|
||||
}
|
||||
import { useDialogStore } from '@/stores/dialogStore'
|
||||
import { useMaskEditor } from '@/composables/maskeditor/useMaskEditor'
|
||||
|
||||
function openMaskEditor(node: LGraphNode): void {
|
||||
if (!node) {
|
||||
@@ -33,56 +17,23 @@ function openMaskEditor(node: LGraphNode): void {
|
||||
return
|
||||
}
|
||||
|
||||
const useNewEditor = app.extensionManager.setting.get(
|
||||
'Comfy.MaskEditor.UseNewEditor'
|
||||
)
|
||||
|
||||
if (useNewEditor) {
|
||||
useMaskEditor().openMaskEditor(node)
|
||||
} else {
|
||||
warnLegacyMaskEditorDeprecation()
|
||||
// Use old editor
|
||||
ComfyApp.copyToClipspace(node)
|
||||
// @ts-expect-error clipspace_return_node is an extension property added at runtime
|
||||
ComfyApp.clipspace_return_node = node
|
||||
const dlg = MaskEditorDialogOld.getInstance() as any
|
||||
if (dlg?.isOpened && !dlg.isOpened()) {
|
||||
dlg.show()
|
||||
}
|
||||
}
|
||||
useMaskEditor().openMaskEditor(node)
|
||||
}
|
||||
|
||||
// Check if the dialog is already opened
|
||||
function isOpened(): boolean {
|
||||
const useNewEditor = app.extensionManager.setting.get(
|
||||
'Comfy.MaskEditor.UseNewEditor'
|
||||
)
|
||||
if (useNewEditor) {
|
||||
return useDialogStore().isDialogOpen('global-mask-editor')
|
||||
} else {
|
||||
return (MaskEditorDialogOld.instance as any)?.isOpened?.() ?? false
|
||||
}
|
||||
return useDialogStore().isDialogOpen('global-mask-editor')
|
||||
}
|
||||
|
||||
app.registerExtension({
|
||||
name: 'Comfy.MaskEditor',
|
||||
settings: [
|
||||
{
|
||||
id: 'Comfy.MaskEditor.UseNewEditor',
|
||||
category: ['Mask Editor', 'NewEditor'],
|
||||
name: 'Use new mask editor',
|
||||
tooltip: 'Switch to the new mask editor interface',
|
||||
type: 'boolean',
|
||||
defaultValue: true,
|
||||
experimental: true
|
||||
},
|
||||
{
|
||||
id: 'Comfy.MaskEditor.BrushAdjustmentSpeed',
|
||||
category: ['Mask Editor', 'BrushAdjustment', 'Sensitivity'],
|
||||
name: 'Brush adjustment speed multiplier',
|
||||
tooltip:
|
||||
'Controls how quickly the brush size and hardness change when adjusting. Higher values mean faster changes.',
|
||||
experimental: true,
|
||||
type: 'slider',
|
||||
attrs: {
|
||||
min: 0.1,
|
||||
@@ -99,8 +50,7 @@ app.registerExtension({
|
||||
tooltip:
|
||||
'When enabled, brush adjustments will only affect size OR hardness based on which direction you move more',
|
||||
type: 'boolean',
|
||||
defaultValue: true,
|
||||
experimental: true
|
||||
defaultValue: true
|
||||
}
|
||||
],
|
||||
commands: [
|
||||
@@ -128,36 +78,7 @@ app.registerExtension({
|
||||
label: 'Decrease Brush Size in MaskEditor',
|
||||
function: () => changeBrushSize((old) => _.clamp(old - 4, 1, 100))
|
||||
}
|
||||
],
|
||||
init() {
|
||||
// Support for old editor clipspace integration
|
||||
const openMaskEditorFromClipspace = () => {
|
||||
const useNewEditor = app.extensionManager.setting.get(
|
||||
'Comfy.MaskEditor.UseNewEditor'
|
||||
)
|
||||
if (!useNewEditor) {
|
||||
warnLegacyMaskEditorDeprecation()
|
||||
const dlg = MaskEditorDialogOld.getInstance() as any
|
||||
if (dlg?.isOpened && !dlg.isOpened()) {
|
||||
dlg.show()
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
const context_predicate = (): boolean => {
|
||||
return !!(
|
||||
ComfyApp.clipspace &&
|
||||
ComfyApp.clipspace.imgs &&
|
||||
ComfyApp.clipspace.imgs.length > 0
|
||||
)
|
||||
}
|
||||
|
||||
ClipspaceDialog.registerButton(
|
||||
'MaskEditor',
|
||||
context_predicate,
|
||||
openMaskEditorFromClipspace
|
||||
)
|
||||
}
|
||||
]
|
||||
})
|
||||
|
||||
const changeBrushSize = async (sizeChanger: (oldSize: number) => number) => {
|
||||
|
||||
@@ -1567,7 +1567,6 @@
|
||||
"Mask Editor": "محرر القناع",
|
||||
"Menu": "القائمة",
|
||||
"ModelLibrary": "مكتبة النماذج",
|
||||
"NewEditor": "المحرر الجديد",
|
||||
"Node": "العقدة",
|
||||
"Node Search Box": "مربع بحث العقد",
|
||||
"Node Widget": "أداة العقدة",
|
||||
|
||||
@@ -181,10 +181,6 @@
|
||||
"name": "تقييد تعديل الفرشاة إلى المحور السائد",
|
||||
"tooltip": "عند التمكين، تؤثر التعديلات على الحجم أو الصلابة فقط بناءً على الاتجاه الذي تتحرك فيه أكثر."
|
||||
},
|
||||
"Comfy_MaskEditor_UseNewEditor": {
|
||||
"name": "استخدام محرر القناع الجديد",
|
||||
"tooltip": "التحويل إلى واجهة محرر القناع الجديدة"
|
||||
},
|
||||
"Comfy_ModelLibrary_AutoLoadAll": {
|
||||
"name": "تحميل جميع مجلدات النماذج تلقائيًا",
|
||||
"tooltip": "إذا كانت صحيحة، سيتم تحميل جميع المجلدات عند فتح مكتبة النماذج (قد يسبب تأخيرًا أثناء التحميل). إذا كانت خاطئة، يتم تحميل مجلدات النماذج على مستوى الجذر فقط عند النقر عليها."
|
||||
|
||||
@@ -1203,7 +1203,6 @@
|
||||
"Locale": "Locale",
|
||||
"Mask Editor": "Mask Editor",
|
||||
"BrushAdjustment": "Brush Adjustment",
|
||||
"NewEditor": "New Editor",
|
||||
"ModelLibrary": "Model Library",
|
||||
"NodeLibrary": "Node Library",
|
||||
"Node Search Box": "Node Search Box",
|
||||
@@ -2428,4 +2427,4 @@
|
||||
"recentReleases": "Recent releases",
|
||||
"helpCenterMenu": "Help Center Menu"
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -205,10 +205,6 @@
|
||||
"name": "Lock brush adjustment to dominant axis",
|
||||
"tooltip": "When enabled, brush adjustments will only affect size OR hardness based on which direction you move more"
|
||||
},
|
||||
"Comfy_MaskEditor_UseNewEditor": {
|
||||
"name": "Use new mask editor",
|
||||
"tooltip": "Switch to the new mask editor interface"
|
||||
},
|
||||
"Comfy_ModelLibrary_AutoLoadAll": {
|
||||
"name": "Automatically load all model folders",
|
||||
"tooltip": "If true, all folders will load as soon as you open the model library (this may cause delays while it loads). If false, root level model folders will only load once you click on them."
|
||||
@@ -464,4 +460,4 @@
|
||||
"pysssss_SnapToGrid": {
|
||||
"name": "Always snap to grid"
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1567,7 +1567,6 @@
|
||||
"Mask Editor": "Editor de Máscara",
|
||||
"Menu": "Menú",
|
||||
"ModelLibrary": "Biblioteca de Modelos",
|
||||
"NewEditor": "Nuevo Editor",
|
||||
"Node": "Nodo",
|
||||
"Node Search Box": "Caja de Búsqueda de Nodo",
|
||||
"Node Widget": "Widget de Nodo",
|
||||
|
||||
@@ -181,10 +181,6 @@
|
||||
"name": "Bloquear ajuste del pincel al eje dominante",
|
||||
"tooltip": "Cuando está habilitado, los ajustes del pincel solo afectarán el tamaño O la dureza según la dirección en la que te muevas más"
|
||||
},
|
||||
"Comfy_MaskEditor_UseNewEditor": {
|
||||
"name": "Usar nuevo editor de máscara",
|
||||
"tooltip": "Cambiar a la nueva interfaz del editor de máscaras"
|
||||
},
|
||||
"Comfy_ModelLibrary_AutoLoadAll": {
|
||||
"name": "Cargar automáticamente todas las carpetas de modelos",
|
||||
"tooltip": "Si es verdadero, todas las carpetas se cargarán tan pronto como abras la biblioteca de modelos (esto puede causar retrasos mientras se carga). Si es falso, las carpetas de modelos de nivel raíz solo se cargarán una vez que hagas clic en ellas."
|
||||
|
||||
@@ -1567,7 +1567,6 @@
|
||||
"Mask Editor": "Éditeur de Masque",
|
||||
"Menu": "Menu",
|
||||
"ModelLibrary": "Bibliothèque de Modèles",
|
||||
"NewEditor": "Nouvel Éditeur",
|
||||
"Node": "Nœud",
|
||||
"Node Search Box": "Boîte de Recherche de Nœud",
|
||||
"Node Widget": "Widget de Nœud",
|
||||
|
||||
@@ -181,10 +181,6 @@
|
||||
"name": "Verrouiller l'ajustement du pinceau sur l'axe dominant",
|
||||
"tooltip": "Lorsqu'il est activé, les ajustements du pinceau n'affecteront que la taille OU la dureté en fonction de la direction dans laquelle vous bougez le plus"
|
||||
},
|
||||
"Comfy_MaskEditor_UseNewEditor": {
|
||||
"name": "Utiliser le nouvel éditeur de masque",
|
||||
"tooltip": "Passer à la nouvelle interface de l'éditeur de masque"
|
||||
},
|
||||
"Comfy_ModelLibrary_AutoLoadAll": {
|
||||
"name": "Charger automatiquement tous les dossiers de modèles",
|
||||
"tooltip": "Si vrai, tous les dossiers seront chargés dès que vous ouvrez la bibliothèque de modèles (cela peut causer des retards pendant le chargement). Si faux, les dossiers de modèles de niveau racine ne seront chargés que lorsque vous cliquerez dessus."
|
||||
|
||||
@@ -1567,7 +1567,6 @@
|
||||
"Mask Editor": "マスクエディタ",
|
||||
"Menu": "メニュー",
|
||||
"ModelLibrary": "モデルライブラリ",
|
||||
"NewEditor": "新しいエディタ",
|
||||
"Node": "ノード",
|
||||
"Node Search Box": "ノード検索ボックス",
|
||||
"Node Widget": "ノードウィジェット",
|
||||
|
||||
@@ -181,10 +181,6 @@
|
||||
"name": "ブラシ調整を優先軸に固定する",
|
||||
"tooltip": "有効にすると、ブラシの調整は、どの方向に多く動かすかに基づいて、サイズまたは硬さのいずれかにのみ影響します。"
|
||||
},
|
||||
"Comfy_MaskEditor_UseNewEditor": {
|
||||
"name": "新しいマスクエディタを使用する",
|
||||
"tooltip": "新しいマスクエディタインターフェースに切り替えます。"
|
||||
},
|
||||
"Comfy_ModelLibrary_AutoLoadAll": {
|
||||
"name": "すべてのモデルフォルダーを自動的に読み込む",
|
||||
"tooltip": "trueの場合、モデルライブラリを開くとすぐにすべてのフォルダーが読み込まれます(これにより読み込み中に遅延が発生する可能性があります)。falseの場合、ルートレベルのモデルフォルダーはクリックするまで読み込まれません。"
|
||||
|
||||
@@ -1567,7 +1567,6 @@
|
||||
"Mask Editor": "마스크 편집기",
|
||||
"Menu": "메뉴",
|
||||
"ModelLibrary": "모델 라이브러리",
|
||||
"NewEditor": "새 편집기",
|
||||
"Node": "노드",
|
||||
"Node Search Box": "노드 검색 상자",
|
||||
"Node Widget": "노드 위젯",
|
||||
|
||||
@@ -181,10 +181,6 @@
|
||||
"name": "브러시 조정을 지배 축에 고정",
|
||||
"tooltip": "활성화하면 브러시 조정이 이동하는 방향에 따라 크기 또는 경도에만 영향을 미칩니다."
|
||||
},
|
||||
"Comfy_MaskEditor_UseNewEditor": {
|
||||
"name": "새 마스크 편집기 사용",
|
||||
"tooltip": "새 마스크 편집기 인터페이스로 전환"
|
||||
},
|
||||
"Comfy_ModelLibrary_AutoLoadAll": {
|
||||
"name": "모든 모델 폴더 자동 로드",
|
||||
"tooltip": "참이면 모든 폴더가 모델 라이브러리를 열 때 즉시 로드됩니다 (로드하는 동안 지연이 발생할 수 있습니다). 거짓이면 루트 수준 모델 폴더는 클릭할 때만 로드됩니다."
|
||||
|
||||
@@ -1567,7 +1567,6 @@
|
||||
"Mask Editor": "Редактор масок",
|
||||
"Menu": "Меню",
|
||||
"ModelLibrary": "Библиотека моделей",
|
||||
"NewEditor": "Новый редактор",
|
||||
"Node": "Нода",
|
||||
"Node Search Box": "Поисковая строка нод",
|
||||
"Node Widget": "Виджет ноды",
|
||||
|
||||
@@ -181,10 +181,6 @@
|
||||
"name": "Закрепить регулировку кисти по доминирующей оси",
|
||||
"tooltip": "При включении регулировки кисти будет влиять только на размер или жёсткость в зависимости от того, в каком направлении вы двигаетесь больше"
|
||||
},
|
||||
"Comfy_MaskEditor_UseNewEditor": {
|
||||
"name": "Использовать новый редактор масок",
|
||||
"tooltip": "Переключиться на новый интерфейс редактора масок"
|
||||
},
|
||||
"Comfy_ModelLibrary_AutoLoadAll": {
|
||||
"name": "Автоматически загружать все папки моделей",
|
||||
"tooltip": "Если true, все папки будут загружены, как только вы откроете библиотеку моделей (это может вызвать задержки при загрузке). Если false, корневые папки моделей будут загружены только после нажатия на них."
|
||||
|
||||
@@ -1567,7 +1567,6 @@
|
||||
"Mask Editor": "Maske Düzenleyici",
|
||||
"Menu": "Menü",
|
||||
"ModelLibrary": "Model Kütüphanesi",
|
||||
"NewEditor": "Yeni Düzenleyici",
|
||||
"Node": "Düğüm",
|
||||
"Node Search Box": "Düğüm Arama Kutusu",
|
||||
"Node Widget": "Düğüm Widget'ı",
|
||||
|
||||
@@ -181,10 +181,6 @@
|
||||
"name": "Fırça ayarını baskın eksene kilitle",
|
||||
"tooltip": "Etkinleştirildiğinde, fırça ayarları yalnızca daha fazla hareket ettiğiniz yöne bağlı olarak boyutu VEYA sertliği etkileyecektir"
|
||||
},
|
||||
"Comfy_MaskEditor_UseNewEditor": {
|
||||
"name": "Yeni maske düzenleyiciyi kullan",
|
||||
"tooltip": "Yeni maske düzenleyici arayüzüne geç"
|
||||
},
|
||||
"Comfy_ModelLibrary_AutoLoadAll": {
|
||||
"name": "Tüm model klasörlerini otomatik olarak yükle",
|
||||
"tooltip": "Doğruysa, model kütüphanesini açar açmaz tüm klasörler yüklenecektir (bu, yüklenirken gecikmelere neden olabilir). Yanlışsa, kök düzeyindeki model klasörleri yalnızca üzerlerine tıkladığınızda yüklenecektir."
|
||||
|
||||
@@ -1567,7 +1567,6 @@
|
||||
"Mask Editor": "遮罩編輯器",
|
||||
"Menu": "選單",
|
||||
"ModelLibrary": "模型庫",
|
||||
"NewEditor": "新編輯器",
|
||||
"Node": "節點",
|
||||
"Node Search Box": "節點搜尋框",
|
||||
"Node Widget": "節點元件",
|
||||
|
||||
@@ -181,10 +181,6 @@
|
||||
"name": "鎖定筆刷調整至主軸",
|
||||
"tooltip": "啟用後,筆刷調整只會根據你移動較多的方向,分別影響大小或硬度"
|
||||
},
|
||||
"Comfy_MaskEditor_UseNewEditor": {
|
||||
"name": "使用新遮罩編輯器",
|
||||
"tooltip": "切換到新遮罩編輯器介面"
|
||||
},
|
||||
"Comfy_ModelLibrary_AutoLoadAll": {
|
||||
"name": "自動載入所有模型資料夾",
|
||||
"tooltip": "若為開啟,當你打開模型庫時,所有資料夾將自動載入(這可能會導致載入時延遲)。若為關閉,只有在你點擊根目錄下的模型資料夾時才會載入。"
|
||||
|
||||
@@ -1567,7 +1567,6 @@
|
||||
"Mask Editor": "遮罩编辑器",
|
||||
"Menu": "菜单",
|
||||
"ModelLibrary": "模型库",
|
||||
"NewEditor": "新编辑器",
|
||||
"Node": "节点",
|
||||
"Node Search Box": "节点搜索框",
|
||||
"Node Widget": "节点组件",
|
||||
|
||||
@@ -181,10 +181,6 @@
|
||||
"name": "将画笔调整锁定到主轴",
|
||||
"tooltip": "启用后,画笔调整将仅根据您移动的方向影响大小或硬度。"
|
||||
},
|
||||
"Comfy_MaskEditor_UseNewEditor": {
|
||||
"name": "使用新画笔编辑器",
|
||||
"tooltip": "切换到新的画笔编辑器界面"
|
||||
},
|
||||
"Comfy_ModelLibrary_AutoLoadAll": {
|
||||
"name": "自动加载所有模型文件夹",
|
||||
"tooltip": "开启后,打开模型库会加载所有文件夹内的模型(可能导致卡顿)。关闭后,仅加载当前文件夹内的模型。"
|
||||
|
||||
@@ -497,7 +497,6 @@ const zSettings = z.object({
|
||||
'Comfy-Desktop.UV.PythonInstallMirror': z.string(),
|
||||
'Comfy-Desktop.UV.PypiInstallMirror': z.string(),
|
||||
'Comfy-Desktop.UV.TorchInstallMirror': z.string(),
|
||||
'Comfy.MaskEditor.UseNewEditor': z.boolean(),
|
||||
'Comfy.MaskEditor.BrushAdjustmentSpeed': z.number(),
|
||||
'Comfy.MaskEditor.UseDominantAxis': z.boolean(),
|
||||
'Comfy.Load3D.ShowGrid': z.boolean(),
|
||||
|
||||
Reference in New Issue
Block a user