Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix nodes with only optional inputs #978

Merged
merged 5 commits into from
Sep 25, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
44 changes: 44 additions & 0 deletions browser_tests/assets/only_optional_inputs.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
{
"last_node_id": 11,
"last_link_id": 9,
"nodes": [
{
"id": 11,
"type": "DevToolsNodeWithOnlyOptionalInput",
"pos": {
"0": 150,
"1": 464.2916564941406
},
"size": {
"0": 400,
"1": 200
},
"flags": {},
"order": 0,
"mode": 0,
"inputs": [
{
"name": "clip",
"type": "CLIP",
"link": null,
"shape": 7,
"label": "clip"
}
],
"outputs": [],
"properties": {
"Node name for S&R": "DevToolsNodeWithOnlyOptionalInput"
},
"widgets_values": [
""
]
}
],
"links": [],
"groups": [],
"config": {},
"extra": {
"groupNodes": {}
},
"version": 0.4
}
9 changes: 9 additions & 0 deletions browser_tests/nodeDisplay.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -23,4 +23,13 @@ test.describe('Optional input', () => {
await comfyPage.loadWorkflow('force_input')
await expect(comfyPage.canvas).toHaveScreenshot('force_input.png')
})

test('Only optional inputs', async ({ comfyPage }) => {
await comfyPage.loadWorkflow('only_optional_inputs')
expect(await comfyPage.getGraphNodesCount()).toBe(1)
expect(comfyPage.page.locator('.comfy-missing-nodes')).not.toBeVisible()

// If the node's multiline text widget is visible, then it was loaded successfully
expect(comfyPage.page.locator('.comfy-multiline-input')).toHaveCount(1)
})
})
6 changes: 2 additions & 4 deletions src/i18n.ts
Original file line number Diff line number Diff line change
Expand Up @@ -163,14 +163,12 @@ const messages = {
},
menu: {
batchCount: '批次数量',
batchCountTooltip:
'工作流生成次数',
batchCountTooltip: '工作流生成次数',
autoQueue: '自动执行',
disabled: '禁用',
disabledTooltip: '工作流将不会自动执行',
instant: '实时',
instantTooltip:
'工作流将会在生成完成后立即执行',
instantTooltip: '工作流将会在生成完成后立即执行',
change: '变动',
changeTooltip: '工作流将会在改变后执行',
queueWorkflow: '执行工作流',
Expand Down
2 changes: 1 addition & 1 deletion src/scripts/app.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2017,7 +2017,7 @@ export class ComfyApp {
for (const inputName in inputs) {
const inputData = inputs[inputName]
const type = inputData[0]
const inputIsRequired = inputName in requiredInputs
const inputIsRequired = requiredInputs && inputName in requiredInputs

let widgetCreated = true
const widgetType = self.getWidgetType(inputData, inputName)
Expand Down
Loading