From 1a066c706240dbafcac2ad22e6764454f6e075a9 Mon Sep 17 00:00:00 2001 From: Terry Jia Date: Sun, 13 Apr 2025 19:44:47 -0400 Subject: [PATCH 01/13] [3d] move default values of showPreview, showGrid, cameraType to settings panel (#3443) Co-authored-by: github-actions --- src/extensions/core/load3d.ts | 34 ++++++++++++++++++- .../core/load3d/Load3DConfiguration.ts | 13 +++++-- src/locales/en/main.json | 6 +++- src/locales/en/settings.json | 16 +++++++++ src/locales/es/main.json | 4 +++ src/locales/es/settings.json | 16 +++++++++ src/locales/fr/main.json | 4 +++ src/locales/fr/settings.json | 16 +++++++++ src/locales/ja/main.json | 4 +++ src/locales/ja/settings.json | 16 +++++++++ src/locales/ko/main.json | 4 +++ src/locales/ko/settings.json | 16 +++++++++ src/locales/ru/main.json | 4 +++ src/locales/ru/settings.json | 16 +++++++++ src/locales/zh/main.json | 4 +++ src/locales/zh/settings.json | 16 +++++++++ src/schemas/apiSchema.ts | 3 ++ 17 files changed, 187 insertions(+), 5 deletions(-) diff --git a/src/extensions/core/load3d.ts b/src/extensions/core/load3d.ts index 47026a0c19..2749e62967 100644 --- a/src/extensions/core/load3d.ts +++ b/src/extensions/core/load3d.ts @@ -18,7 +18,39 @@ import { generateUUID } from '@/utils/formatUtil' useExtensionService().registerExtension({ name: 'Comfy.Load3D', - + settings: [ + { + id: 'Comfy.Load3D.ShowGrid', + category: ['3D', 'Scene', 'Initial Grid Visibility'], + name: 'Initial Grid Visibility', + tooltip: + 'Controls whether the grid is visible by default when a new 3D widget is created. This default can still be toggled individually for each widget after creation.', + type: 'boolean', + defaultValue: true, + experimental: true + }, + { + id: 'Comfy.Load3D.ShowPreview', + category: ['3D', 'Scene', 'Initial Preview Visibility'], + name: 'Initial Preview Visibility', + tooltip: + 'Controls whether the preview screen is visible by default when a new 3D widget is created. This default can still be toggled individually for each widget after creation.', + type: 'boolean', + defaultValue: true, + experimental: true + }, + { + id: 'Comfy.Load3D.CameraType', + category: ['3D', 'Camera', 'Initial Camera Type'], + name: 'Initial Camera Type', + tooltip: + 'Controls whether the camera is perspective or orthographic by default when a new 3D widget is created. This default can still be toggled individually for each widget after creation.', + type: 'combo', + options: ['perspective', 'orthographic'], + defaultValue: 'perspective', + experimental: true + } + ], getCustomWidgets() { return { LOAD_3D(node) { diff --git a/src/extensions/core/load3d/Load3DConfiguration.ts b/src/extensions/core/load3d/Load3DConfiguration.ts index 88a5124d41..9f1a917649 100644 --- a/src/extensions/core/load3d/Load3DConfiguration.ts +++ b/src/extensions/core/load3d/Load3DConfiguration.ts @@ -3,6 +3,7 @@ import type { IWidget } from '@comfyorg/litegraph' import Load3d from '@/extensions/core/load3d/Load3d' import Load3dUtils from '@/extensions/core/load3d/Load3dUtils' import { api } from '@/scripts/api' +import { useSettingStore } from '@/stores/settingStore' class Load3DConfiguration { constructor(private load3d: Load3d) {} @@ -72,15 +73,21 @@ class Load3DConfiguration { private setupDefaultProperties() { const cameraType = this.load3d.loadNodeProperty( 'Camera Type', - 'perspective' + useSettingStore().get('Comfy.Load3D.CameraType') ) this.load3d.toggleCamera(cameraType) - const showGrid = this.load3d.loadNodeProperty('Show Grid', true) + const showGrid = this.load3d.loadNodeProperty( + 'Show Grid', + useSettingStore().get('Comfy.Load3D.ShowGrid') + ) this.load3d.toggleGrid(showGrid) - const showPreview = this.load3d.loadNodeProperty('Show Preview', true) + const showPreview = this.load3d.loadNodeProperty( + 'Show Preview', + useSettingStore().get('Comfy.Load3D.ShowPreview') + ) this.load3d.togglePreview(showPreview) diff --git a/src/locales/en/main.json b/src/locales/en/main.json index 0d814b659c..c891467d21 100644 --- a/src/locales/en/main.json +++ b/src/locales/en/main.json @@ -716,7 +716,11 @@ "CustomColorPalettes": "Custom Color Palettes", "UV": "UV", "ContextMenu": "Context Menu", - "Reroute": "Reroute" + "Reroute": "Reroute", + "Load 3D": "Load 3D", + "Camera": "Camera", + "Scene": "Scene", + "3D": "3D" }, "serverConfigItems": { "listen": { diff --git a/src/locales/en/settings.json b/src/locales/en/settings.json index 3ba830e881..6ad5c6a141 100644 --- a/src/locales/en/settings.json +++ b/src/locales/en/settings.json @@ -108,6 +108,22 @@ "Hidden": "Hidden" } }, + "Comfy_Load3D_CameraType": { + "name": "Initial Camera Type", + "tooltip": "Controls whether the camera is perspective or orthographic by default when a new 3D widget is created. This default can still be toggled individually for each widget after creation.", + "options": { + "perspective": "perspective", + "orthographic": "orthographic" + } + }, + "Comfy_Load3D_ShowGrid": { + "name": "Initial Grid Visibility", + "tooltip": "Controls whether the grid is visible by default when a new 3D widget is created. This default can still be toggled individually for each widget after creation." + }, + "Comfy_Load3D_ShowPreview": { + "name": "Initial Preview Visibility", + "tooltip": "Controls whether the preview screen is visible by default when a new 3D widget is created. This default can still be toggled individually for each widget after creation." + }, "Comfy_Locale": { "name": "Language" }, diff --git a/src/locales/es/main.json b/src/locales/es/main.json index 4a17a0d18d..a542dfffbb 100644 --- a/src/locales/es/main.json +++ b/src/locales/es/main.json @@ -812,9 +812,11 @@ "troubleshoot": "Solucionar problemas" }, "settingsCategories": { + "3D": "3D", "About": "Acerca de", "Appearance": "Apariencia", "BrushAdjustment": "Ajuste de Pincel", + "Camera": "Cámara", "Canvas": "Lienzo", "ColorPalette": "Paleta de Colores", "Comfy": "Comfy", @@ -831,6 +833,7 @@ "Link": "Enlace", "LinkRelease": "Liberación de Enlace", "LiteGraph": "Lite Graph", + "Load 3D": "Cargar 3D", "Locale": "Localización", "Mask Editor": "Editor de Máscara", "Menu": "Menú", @@ -845,6 +848,7 @@ "QueueButton": "Botón de Cola", "Reroute": "Reenrutar", "RerouteBeta": "Reroute Beta", + "Scene": "Escena", "Server": "Servidor", "Server-Config": "Configuración del Servidor", "Settings": "Configuraciones", diff --git a/src/locales/es/settings.json b/src/locales/es/settings.json index 225a750af6..92f9158cf7 100644 --- a/src/locales/es/settings.json +++ b/src/locales/es/settings.json @@ -108,6 +108,22 @@ "Straight": "Recto" } }, + "Comfy_Load3D_CameraType": { + "name": "Tipo de Cámara", + "options": { + "orthographic": "ortográfica", + "perspective": "perspectiva" + }, + "tooltip": "Controla si la cámara es perspectiva u ortográfica por defecto cuando se crea un nuevo widget 3D. Este valor predeterminado aún puede ser alternado individualmente para cada widget después de su creación." + }, + "Comfy_Load3D_ShowGrid": { + "name": "Mostrar Cuadrícula", + "tooltip": "Cambiar para mostrar cuadrícula por defecto" + }, + "Comfy_Load3D_ShowPreview": { + "name": "Mostrar Previsualización", + "tooltip": "Cambiar para mostrar previsualización por defecto" + }, "Comfy_Locale": { "name": "Idioma" }, diff --git a/src/locales/fr/main.json b/src/locales/fr/main.json index 16e3f7765b..5173ba68b6 100644 --- a/src/locales/fr/main.json +++ b/src/locales/fr/main.json @@ -812,9 +812,11 @@ "troubleshoot": "Dépannage" }, "settingsCategories": { + "3D": "3D", "About": "À Propos", "Appearance": "Apparence", "BrushAdjustment": "Ajustement de Brosse", + "Camera": "Caméra", "Canvas": "Toile", "ColorPalette": "Palette de Couleurs", "Comfy": "Confort", @@ -831,6 +833,7 @@ "Link": "Lien", "LinkRelease": "Libération de Lien", "LiteGraph": "Lite Graph", + "Load 3D": "Charger 3D", "Locale": "Locale", "Mask Editor": "Éditeur de Masque", "Menu": "Menu", @@ -845,6 +848,7 @@ "QueueButton": "Bouton de File d'Attente", "Reroute": "Réacheminement", "RerouteBeta": "Reroute Beta", + "Scene": "Scène", "Server": "Serveur", "Server-Config": "Config-Serveur", "Settings": "Paramètres", diff --git a/src/locales/fr/settings.json b/src/locales/fr/settings.json index 78302a11c4..3a812a1eb1 100644 --- a/src/locales/fr/settings.json +++ b/src/locales/fr/settings.json @@ -108,6 +108,22 @@ "Straight": "Droit" } }, + "Comfy_Load3D_CameraType": { + "name": "Type de Caméra", + "options": { + "orthographic": "orthographique", + "perspective": "perspective" + }, + "tooltip": "Contrôle si la caméra est en perspective ou orthographique par défaut lorsqu'un nouveau widget 3D est créé. Ce défaut peut toujours être basculé individuellement pour chaque widget après sa création." + }, + "Comfy_Load3D_ShowGrid": { + "name": "Afficher la Grille", + "tooltip": "Basculer pour afficher la grille par défaut" + }, + "Comfy_Load3D_ShowPreview": { + "name": "Afficher l'Aperçu", + "tooltip": "Basculer pour afficher l'aperçu par défaut" + }, "Comfy_Locale": { "name": "Langue" }, diff --git a/src/locales/ja/main.json b/src/locales/ja/main.json index fa316a2743..4e217dcd43 100644 --- a/src/locales/ja/main.json +++ b/src/locales/ja/main.json @@ -812,9 +812,11 @@ "troubleshoot": "トラブルシューティング" }, "settingsCategories": { + "3D": "3D", "About": "情報", "Appearance": "外観", "BrushAdjustment": "ブラシ調整", + "Camera": "カメラ", "Canvas": "キャンバス", "ColorPalette": "カラーパレット", "Comfy": "Comfy", @@ -831,6 +833,7 @@ "Link": "リンク", "LinkRelease": "リンク解除", "LiteGraph": "Lite Graph", + "Load 3D": "3Dを読み込む", "Locale": "ロケール", "Mask Editor": "マスクエディタ", "Menu": "メニュー", @@ -845,6 +848,7 @@ "QueueButton": "キューボタン", "Reroute": "リルート", "RerouteBeta": "ルート変更ベータ", + "Scene": "シーン", "Server": "サーバー", "Server-Config": "サーバー設定", "Settings": "設定", diff --git a/src/locales/ja/settings.json b/src/locales/ja/settings.json index 524d01287b..450315b011 100644 --- a/src/locales/ja/settings.json +++ b/src/locales/ja/settings.json @@ -108,6 +108,22 @@ "Straight": "ストレート" } }, + "Comfy_Load3D_CameraType": { + "name": "カメラタイプ", + "options": { + "orthographic": "オルソグラフィック", + "perspective": "パースペクティブ" + }, + "tooltip": "新しい3Dウィジェットが作成されたときに、デフォルトでカメラが透視投影か平行投影かを制御します。このデフォルトは、作成後に各ウィジェットごとに個別に切り替えることができます。" + }, + "Comfy_Load3D_ShowGrid": { + "name": "グリッドを表示", + "tooltip": "デフォルトでグリッドを表示するには切り替えます" + }, + "Comfy_Load3D_ShowPreview": { + "name": "プレビューを表示", + "tooltip": "デフォルトでプレビューを表示するには切り替えます" + }, "Comfy_Locale": { "name": "言語" }, diff --git a/src/locales/ko/main.json b/src/locales/ko/main.json index c3ad3ea8dd..7c06dc5161 100644 --- a/src/locales/ko/main.json +++ b/src/locales/ko/main.json @@ -812,9 +812,11 @@ "troubleshoot": "문제 해결" }, "settingsCategories": { + "3D": "3D", "About": "정보", "Appearance": "모양", "BrushAdjustment": "브러시 조정", + "Camera": "카메라", "Canvas": "캔버스", "ColorPalette": "색상 팔레트", "Comfy": "Comfy", @@ -831,6 +833,7 @@ "Link": "링크", "LinkRelease": "링크 해제", "LiteGraph": "LiteGraph", + "Load 3D": "3D 불러오기", "Locale": "언어 설정", "Mask Editor": "마스크 편집기", "Menu": "메뉴", @@ -845,6 +848,7 @@ "QueueButton": "실행 큐 버튼", "Reroute": "경유점", "RerouteBeta": "경유점 (베타)", + "Scene": "장면", "Server": "서버", "Server-Config": "서버 구성", "Settings": "설정", diff --git a/src/locales/ko/settings.json b/src/locales/ko/settings.json index b03e00a40e..ced69ece4c 100644 --- a/src/locales/ko/settings.json +++ b/src/locales/ko/settings.json @@ -108,6 +108,22 @@ "Straight": "직선" } }, + "Comfy_Load3D_CameraType": { + "name": "카메라 유형", + "options": { + "orthographic": "직교법", + "perspective": "원근법" + }, + "tooltip": "새로운 3D 위젯이 생성될 때 카메라가 기본적으로 원근법 또는 직교법을 사용하는지를 제어합니다. 이 기본값은 생성 후 각 위젯별로 개별적으로 전환할 수 있습니다." + }, + "Comfy_Load3D_ShowGrid": { + "name": "그리드 표시", + "tooltip": "기본적으로 그리드를 표시하도록 전환" + }, + "Comfy_Load3D_ShowPreview": { + "name": "미리보기 표시", + "tooltip": "기본적으로 미리보기를 표시하도록 전환" + }, "Comfy_Locale": { "name": "언어" }, diff --git a/src/locales/ru/main.json b/src/locales/ru/main.json index 26e33eb570..01c1fc20f0 100644 --- a/src/locales/ru/main.json +++ b/src/locales/ru/main.json @@ -812,9 +812,11 @@ "troubleshoot": "Устранение неполадок" }, "settingsCategories": { + "3D": "3D", "About": "О программе", "Appearance": "Внешний вид", "BrushAdjustment": "Настройка кисти", + "Camera": "Камера", "Canvas": "Холст", "ColorPalette": "Цветовая палитра", "Comfy": "Comfy", @@ -831,6 +833,7 @@ "Link": "Ссылка", "LinkRelease": "Освобождение ссылки", "LiteGraph": "Lite Graph", + "Load 3D": "Загрузить 3D", "Locale": "Локализация", "Mask Editor": "Редактор масок", "Menu": "Меню", @@ -845,6 +848,7 @@ "QueueButton": "Кнопка очереди", "Reroute": "Перенаправление", "RerouteBeta": "Бета-версия перенаправления", + "Scene": "Сцена", "Server": "Сервер", "Server-Config": "Настройки сервера", "Settings": "Настройки", diff --git a/src/locales/ru/settings.json b/src/locales/ru/settings.json index ad7a598c52..808bb5e384 100644 --- a/src/locales/ru/settings.json +++ b/src/locales/ru/settings.json @@ -108,6 +108,22 @@ "Straight": "Прямой" } }, + "Comfy_Load3D_CameraType": { + "name": "Тип камеры", + "options": { + "orthographic": "ортографическая", + "perspective": "перспективная" + }, + "tooltip": "Управляет тем, является ли камера перспективной или ортографической по умолчанию при создании нового 3D-виджета. Это значение по умолчанию все еще может быть переключено индивидуально для каждого виджета после его создания." + }, + "Comfy_Load3D_ShowGrid": { + "name": "Показать сетку", + "tooltip": "Переключиться, чтобы показывать сетку по умолчанию" + }, + "Comfy_Load3D_ShowPreview": { + "name": "Показать предварительный просмотр", + "tooltip": "Переключиться, чтобы показывать предварительный просмотр по умолчанию" + }, "Comfy_Locale": { "name": "Язык" }, diff --git a/src/locales/zh/main.json b/src/locales/zh/main.json index aaa38fde44..7263b9e2f0 100644 --- a/src/locales/zh/main.json +++ b/src/locales/zh/main.json @@ -812,9 +812,11 @@ "troubleshoot": "故障排除" }, "settingsCategories": { + "3D": "3D", "About": "关于", "Appearance": "外观", "BrushAdjustment": "画笔调整", + "Camera": "相机", "Canvas": "画布", "ColorPalette": "色彩主题", "Comfy": "Comfy", @@ -831,6 +833,7 @@ "Link": "连线", "LinkRelease": "释放链接", "LiteGraph": "画面", + "Load 3D": "加载3D", "Locale": "区域设置", "Mask Editor": "遮罩编辑器", "Menu": "菜单", @@ -845,6 +848,7 @@ "QueueButton": "执行按钮", "Reroute": "重新路由", "RerouteBeta": "转接点 Beta", + "Scene": "场景", "Server": "服务器", "Server-Config": "服务器配置", "Settings": "设置", diff --git a/src/locales/zh/settings.json b/src/locales/zh/settings.json index c73bc2f450..9e2cc72b78 100644 --- a/src/locales/zh/settings.json +++ b/src/locales/zh/settings.json @@ -108,6 +108,22 @@ "Straight": "直角线" } }, + "Comfy_Load3D_CameraType": { + "name": "摄像机类型", + "options": { + "orthographic": "正交", + "perspective": "透视" + }, + "tooltip": "控制创建新的3D小部件时,默认的相机是透视还是正交。这个默认设置仍然可以在创建后为每个小部件单独切换。" + }, + "Comfy_Load3D_ShowGrid": { + "name": "显示网格", + "tooltip": "默认显示网格开关" + }, + "Comfy_Load3D_ShowPreview": { + "name": "显示预览", + "tooltip": "默认显示预览开关" + }, "Comfy_Locale": { "name": "语言" }, diff --git a/src/schemas/apiSchema.ts b/src/schemas/apiSchema.ts index 0fd0383f57..69fb8b2b7b 100644 --- a/src/schemas/apiSchema.ts +++ b/src/schemas/apiSchema.ts @@ -440,6 +440,9 @@ const zSettings = z.object({ 'Comfy.MaskEditor.UseNewEditor': z.boolean(), 'Comfy.MaskEditor.BrushAdjustmentSpeed': z.number(), 'Comfy.MaskEditor.UseDominantAxis': z.boolean(), + 'Comfy.Load3D.ShowGrid': z.boolean(), + 'Comfy.Load3D.ShowPreview': z.boolean(), + 'Comfy.Load3D.CameraType': z.enum(['perspective', 'orthographic']), 'pysssss.SnapToGrid': z.boolean(), /** VHS setting is used for queue video preview support. */ 'VHS.AdvancedPreviews': z.boolean(), From 1631665efbb7f6f791e4c1b3fd1ac215a53ad003 Mon Sep 17 00:00:00 2001 From: Benjamin Lu Date: Mon, 14 Apr 2025 13:24:13 -0400 Subject: [PATCH 02/13] Fix minor typo (#3456) Co-authored-by: Benjamin Lu --- src/constants/desktopMaintenanceTasks.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/constants/desktopMaintenanceTasks.ts b/src/constants/desktopMaintenanceTasks.ts index 526886d3e5..082a62045c 100644 --- a/src/constants/desktopMaintenanceTasks.ts +++ b/src/constants/desktopMaintenanceTasks.ts @@ -18,7 +18,7 @@ export const DESKTOP_MAINTENANCE_TASKS: Readonly[] = [ shortDescription: 'Change the application base path.', errorDescription: 'Unable to open the base path. Please select a new one.', description: - 'The base path is the default location where ComfyUI stores data. It is the location fo the python environment, and may also contain models, custom nodes, and other extensions.', + 'The base path is the default location where ComfyUI stores data. It is the location for the python environment, and may also contain models, custom nodes, and other extensions.', isInstallationFix: true, button: { icon: PrimeIcons.QUESTION, From 851739a768898bbe50d05f10115e20e4c4fc961e Mon Sep 17 00:00:00 2001 From: Chenlei Hu Date: Mon, 14 Apr 2025 17:49:17 -0400 Subject: [PATCH 03/13] [API Node] Sign in required dialog (#3457) Co-authored-by: github-actions --- .cursorrules | 9 +++ public/assets/images/Comfy_Logo_x32.png | Bin 0 -> 2904 bytes .../common/ApiNodesCostBreakdown.vue | 75 ++++++++++++++++++ .../dialog/content/ApiNodesSignInContent.vue | 43 ++++++++++ .../dialog/header/ComfyOrgHeader.vue | 6 ++ src/locales/en/main.json | 13 ++- src/locales/es/main.json | 11 +++ src/locales/fr/main.json | 11 +++ src/locales/ja/main.json | 11 +++ src/locales/ko/main.json | 11 +++ src/locales/ru/main.json | 11 +++ src/locales/zh/main.json | 11 +++ src/services/dialogService.ts | 32 ++++++++ src/types/apiNodeTypes.ts | 4 + 14 files changed, 247 insertions(+), 1 deletion(-) create mode 100644 public/assets/images/Comfy_Logo_x32.png create mode 100644 src/components/common/ApiNodesCostBreakdown.vue create mode 100644 src/components/dialog/content/ApiNodesSignInContent.vue create mode 100644 src/components/dialog/header/ComfyOrgHeader.vue create mode 100644 src/types/apiNodeTypes.ts diff --git a/.cursorrules b/.cursorrules index 912921e62c..61be15792f 100644 --- a/.cursorrules +++ b/.cursorrules @@ -8,6 +8,15 @@ const vue3CompositionApiBestPractices = [ "Use watch and watchEffect for side effects", "Implement lifecycle hooks with onMounted, onUpdated, etc.", "Utilize provide/inject for dependency injection", + "Use vue 3.5 style of default prop declaration. Example: + +const { nodes, showTotal = true } = defineProps<{ + nodes: ApiNodeCost[] + showTotal?: boolean +}>() + +", + "Organize vue component in