Skip to content
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
17 changes: 17 additions & 0 deletions browser_tests/fixtures/helpers/ExecutionHelper.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,10 @@ import type {
PromptFailureResponse
} from '@comfyorg/api-client/types'
import type { NodeProgressState } from '@comfyorg/api-client/executionTypes'
import type {
PromptOutputsSkippedFrame,
PromptOutputsSkippedNodeError
} from '@comfyorg/ingest-types'
import type { RawJobListItem } from '@comfyorg/api-client/jobTypes'
import type { ComfyPage } from '@e2e/fixtures/ComfyPage'
import { createMockJob } from '@e2e/fixtures/helpers/AssetsHelper'
Expand Down Expand Up @@ -255,6 +259,19 @@ export class ExecutionHelper {
)
}

/** Send `prompt_outputs_skipped` WS event for outputs Cloud skipped. */
outputsSkipped(
jobId: string,
nodeErrors: Record<string, PromptOutputsSkippedNodeError>
): void {
this.requireWs().send(
JSON.stringify({
type: 'prompt_outputs_skipped',
data: { prompt_id: jobId, node_errors: nodeErrors }
} satisfies PromptOutputsSkippedFrame)
)
}

/** Send `execution_interrupted` WS event (user-initiated stop). */
executionInterrupted(jobId: string, nodeId: string): void {
this.requireWs().send(
Expand Down
30 changes: 29 additions & 1 deletion browser_tests/tests/execution.spec.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import { mergeTests } from '@playwright/test'

import type { NodeError } from '@comfyorg/api-client/types'
import type { PromptOutputsSkippedNodeError } from '@comfyorg/ingest-types'
import {
comfyExpect as expect,
comfyPageFixture
Expand All @@ -25,7 +26,8 @@ type PromptRequestBody = {
prompt?: Record<string, PromptRequestNode>
}

function buildPreviewAnyValidationError(): NodeError {
function buildPreviewAnyValidationError(): NodeError &
PromptOutputsSkippedNodeError {
return {
class_type: 'PreviewAny',
dependent_outputs: [VALIDATION_ERROR_NODE_ID],
Expand Down Expand Up @@ -174,6 +176,32 @@ test.describe('Execution validation errors', { tag: '@workflow' }, () => {
await expect(errorOverlay).toBeVisible()
})

test('marks the outputs a run skipped as node errors', async ({
comfyPage,
getWebSocket
}) => {
await comfyPage.workflow.loadWorkflow('execution/partial_execution')

const ws = await getWebSocket()
const exec = new ExecutionHelper(comfyPage, ws)
const jobId = await exec.run()
exec.executionStart(jobId)
exec.outputsSkipped(jobId, {
[VALIDATION_ERROR_NODE_ID]: buildPreviewAnyValidationError()
})

await expect
.poll(() => getValidationErrorMessage(comfyPage))
.toBe(VALIDATION_ERROR_MESSAGE)
const errorOverlay = comfyPage.page.getByTestId(
TestIds.dialogs.errorOverlay
)
await expect(errorOverlay).toBeVisible()
await expect(errorOverlay).toContainText(
'Preview as Text is missing a required input: source'
)
})

test(
'renders cloud node errors when optional details are omitted',
{ tag: '@cloud' },
Expand Down
5 changes: 4 additions & 1 deletion packages/api-client/src/ComfyApi.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,8 @@ import type {
GetI18nResponse,
ModelDownloadData,
ModelFile,
PostAssetsFromWorkflowResponse
PostAssetsFromWorkflowResponse,
PromptOutputsSkippedData
} from '@comfyorg/ingest-types'
import {
zGetEmbeddingsResponse,
Expand Down Expand Up @@ -205,6 +206,7 @@ interface BackendApiCalls {
execution_error: ExecutionErrorWsMessage
execution_interrupted: ExecutionInterruptedWsMessage
execution_cached: ExecutionCachedWsMessage
prompt_outputs_skipped: PromptOutputsSkippedData
logs: LogsWsMessage
/** Binary preview/progress data */
b_preview: Blob
Expand Down Expand Up @@ -1147,6 +1149,7 @@ export class ComfyApi extends EventTarget {
case 'execution_interrupted':
case 'execution_cached':
case 'execution_success':
case 'prompt_outputs_skipped':
case 'progress':
case 'progress_state':
case 'executed':
Expand Down
40 changes: 40 additions & 0 deletions packages/ingest-types/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -229,6 +229,17 @@ export type {
BillingStatus,
BillingStatusResponse,
BillingTaxId,
Budget,
BudgetAlert,
BudgetChange,
BudgetCreateRequest,
BudgetHistory,
BudgetList,
BudgetMode,
BudgetRepeat,
BudgetScopeKind,
BudgetUpdateRequest,
BudgetWriteResult,
BulkRevokeApiKeysResponse,
BulkRevokeWorkspaceMemberApiKeysData,
BulkRevokeWorkspaceMemberApiKeysError,
Expand Down Expand Up @@ -373,6 +384,11 @@ export type {
CreateAssetFromHashResponses,
CreateAssetResponse,
CreateAssetResponses,
CreateBillingBudgetData,
CreateBillingBudgetError,
CreateBillingBudgetErrors,
CreateBillingBudgetResponse,
CreateBillingBudgetResponses,
CreateBillingHandoffData,
CreateBillingHandoffError,
CreateBillingHandoffErrors,
Expand Down Expand Up @@ -491,6 +507,11 @@ export type {
DeleteAssetErrors,
DeleteAssetResponse,
DeleteAssetResponses,
DeleteBillingBudgetData,
DeleteBillingBudgetError,
DeleteBillingBudgetErrors,
DeleteBillingBudgetResponse,
DeleteBillingBudgetResponses,
DeleteCccItemData,
DeleteCccItemError,
DeleteCccItemErrors,
Expand Down Expand Up @@ -671,6 +692,11 @@ export type {
GetBillingBalanceErrors,
GetBillingBalanceResponse,
GetBillingBalanceResponses,
GetBillingBudgetHistoryData,
GetBillingBudgetHistoryError,
GetBillingBudgetHistoryErrors,
GetBillingBudgetHistoryResponse,
GetBillingBudgetHistoryResponses,
GetBillingCapabilitiesData,
GetBillingCapabilitiesError,
GetBillingCapabilitiesErrors,
Expand Down Expand Up @@ -1211,6 +1237,11 @@ export type {
ListAssetsResponse2,
ListAssetsResponses,
ListAssetsResponseWritable,
ListBillingBudgetsData,
ListBillingBudgetsError,
ListBillingBudgetsErrors,
ListBillingBudgetsResponse,
ListBillingBudgetsResponses,
ListCccAdminItemsData,
ListCccAdminItemsError,
ListCccAdminItemsErrors,
Expand Down Expand Up @@ -1435,6 +1466,10 @@ export type {
PreviousPlan,
PromptErrorResponse,
PromptInfo,
PromptOutputsSkippedData,
PromptOutputsSkippedFrame,
PromptOutputsSkippedNodeError,
PromptOutputsSkippedValidationError,
PromptRequest,
PromptResponse,
ProviderCatalogResponse,
Expand Down Expand Up @@ -1670,6 +1705,11 @@ export type {
UpdateAssetErrors,
UpdateAssetResponse,
UpdateAssetResponses,
UpdateBillingBudgetData,
UpdateBillingBudgetError,
UpdateBillingBudgetErrors,
UpdateBillingBudgetResponse,
UpdateBillingBudgetResponses,
UpdateBillingCompanyDetailsData,
UpdateBillingCompanyDetailsError,
UpdateBillingCompanyDetailsErrors,
Expand Down
Loading
Loading