Skip to content

Commit 9a3530d

Browse files
webfilteredgithub-actions
andauthored
Add initial edit model button (static) (#4276)
Co-authored-by: github-actions <[email protected]>
1 parent 4c17712 commit 9a3530d

File tree

19 files changed

+761
-1
lines changed

19 files changed

+761
-1
lines changed

src/components/graph/SelectionToolbox.vue

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@
1010
<ColorPickerButton />
1111
<BypassButton />
1212
<PinButton />
13+
<EditModelButton />
1314
<MaskEditorButton />
1415
<DeleteButton />
1516
<RefreshButton />
Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
<template>
2+
<Button
3+
v-show="canvasStore.nodeSelected || canvasStore.groupSelected"
4+
v-tooltip.top="{
5+
value: t('commands.Comfy_Canvas_AddEditModelStep.label'),
6+
showDelay: 1000
7+
}"
8+
severity="secondary"
9+
text
10+
icon="pi pi-pen-to-square"
11+
@click="() => commandStore.execute('Comfy.Canvas.AddEditModelStep')"
12+
/>
13+
</template>
14+
15+
<script setup lang="ts">
16+
import Button from 'primevue/button'
17+
import { useI18n } from 'vue-i18n'
18+
19+
import { useCommandStore } from '@/stores/commandStore'
20+
import { useCanvasStore } from '@/stores/graphStore'
21+
22+
const { t } = useI18n()
23+
const commandStore = useCommandStore()
24+
const canvasStore = useCanvasStore()
25+
</script>

src/composables/useCoreCommands.ts

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@ import {
1414
import { t } from '@/i18n'
1515
import { api } from '@/scripts/api'
1616
import { app } from '@/scripts/app'
17+
import { addFluxKontextGroupNode } from '@/scripts/fluxKontextEditNode'
1718
import { useDialogService } from '@/services/dialogService'
1819
import { useLitegraphService } from '@/services/litegraphService'
1920
import { useWorkflowService } from '@/services/workflowService'
@@ -718,6 +719,17 @@ export function useCoreCommands(): ComfyCommand[] {
718719
label: 'Move Selected Nodes Right',
719720
versionAdded: moveSelectedNodesVersionAdded,
720721
function: () => moveSelectedNodes(([x, y], gridSize) => [x + gridSize, y])
722+
},
723+
{
724+
id: 'Comfy.Canvas.AddEditModelStep',
725+
icon: 'pi pi-pen-to-square',
726+
label: 'Add Edit Model Step',
727+
versionAdded: '1.23.3',
728+
function: async () => {
729+
const node = app.canvas.selectedItems.values().next().value
730+
if (!(node instanceof LGraphNode)) return
731+
await addFluxKontextGroupNode(node)
732+
}
721733
}
722734
]
723735

src/extensions/core/groupNodeManage.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,8 @@ import {
77
import { useToastStore } from '@/stores/toastStore'
88

99
import { type ComfyApp, app } from '../../scripts/app'
10-
import { $el, ComfyDialog } from '../../scripts/ui'
10+
import { $el } from '../../scripts/ui'
11+
import { ComfyDialog } from '../../scripts/ui/dialog'
1112
import { DraggableList } from '../../scripts/ui/draggableList'
1213
import { GroupNodeConfig, GroupNodeHandler } from './groupNode'
1314
import './groupNodeManage.css'

src/locales/en/commands.json

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,9 @@
3838
"Comfy_BrowseTemplates": {
3939
"label": "Browse Templates"
4040
},
41+
"Comfy_Canvas_AddEditModelStep": {
42+
"label": "Add Edit Model Step"
43+
},
4144
"Comfy_Canvas_DeleteSelectedItems": {
4245
"label": "Delete Selected Items"
4346
},

src/locales/en/main.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -793,6 +793,7 @@
793793
"Reinstall": "Reinstall",
794794
"Restart": "Restart",
795795
"Browse Templates": "Browse Templates",
796+
"Add Edit Model Step": "Add Edit Model Step",
796797
"Delete Selected Items": "Delete Selected Items",
797798
"Fit view to selected nodes": "Fit view to selected nodes",
798799
"Move Selected Nodes Down": "Move Selected Nodes Down",

src/locales/es/commands.json

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,9 @@
3838
"Comfy_BrowseTemplates": {
3939
"label": "Explorar plantillas"
4040
},
41+
"Comfy_Canvas_AddEditModelStep": {
42+
"label": "Agregar paso de edición de modelo"
43+
},
4144
"Comfy_Canvas_DeleteSelectedItems": {
4245
"label": "Eliminar elementos seleccionados"
4346
},

src/locales/es/main.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -684,6 +684,7 @@
684684
},
685685
"menuLabels": {
686686
"About ComfyUI": "Acerca de ComfyUI",
687+
"Add Edit Model Step": "Agregar paso de edición de modelo",
687688
"Browse Templates": "Explorar plantillas",
688689
"Bypass/Unbypass Selected Nodes": "Evitar/No evitar nodos seleccionados",
689690
"Canvas Toggle Link Visibility": "Alternar visibilidad de enlace en lienzo",

src/locales/fr/commands.json

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,9 @@
3838
"Comfy_BrowseTemplates": {
3939
"label": "Parcourir les modèles"
4040
},
41+
"Comfy_Canvas_AddEditModelStep": {
42+
"label": "Ajouter/Modifier une étape de modèle"
43+
},
4144
"Comfy_Canvas_DeleteSelectedItems": {
4245
"label": "Supprimer les éléments sélectionnés"
4346
},

src/locales/fr/main.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -684,6 +684,7 @@
684684
},
685685
"menuLabels": {
686686
"About ComfyUI": "À propos de ComfyUI",
687+
"Add Edit Model Step": "Ajouter une étape d’édition de modèle",
687688
"Browse Templates": "Parcourir les modèles",
688689
"Bypass/Unbypass Selected Nodes": "Contourner/Ne pas contourner les nœuds sélectionnés",
689690
"Canvas Toggle Link Visibility": "Basculer la visibilité du lien de la toile",

0 commit comments

Comments
 (0)