mirror of
https://github.com/Comfy-Org/ComfyUI_frontend.git
synced 2026-04-20 14:30:41 +00:00
fix: add missing fields to publish workflow API request
Add models, custom_nodes, tutorial_url, and metadata fields to the publish workflow request body to match the backend API spec. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
@@ -46,11 +46,15 @@ vi.mock(
|
||||
name: '',
|
||||
description: '',
|
||||
tags: [],
|
||||
models: [],
|
||||
customNodes: [],
|
||||
thumbnailType: 'image',
|
||||
thumbnailFile: null,
|
||||
comparisonBeforeFile: null,
|
||||
comparisonAfterFile: null,
|
||||
exampleImages: []
|
||||
exampleImages: [],
|
||||
tutorialUrl: '',
|
||||
metadata: {}
|
||||
}),
|
||||
isFirstStep: ref(false),
|
||||
isLastStep: ref(true),
|
||||
|
||||
@@ -47,11 +47,15 @@ function createDefaultFormData(): ComfyHubPublishFormData {
|
||||
name: 'Test Workflow',
|
||||
description: '',
|
||||
tags: [],
|
||||
models: [],
|
||||
customNodes: [],
|
||||
thumbnailType: 'image',
|
||||
thumbnailFile: null,
|
||||
comparisonBeforeFile: null,
|
||||
comparisonAfterFile: null,
|
||||
exampleImages: []
|
||||
exampleImages: [],
|
||||
tutorialUrl: '',
|
||||
metadata: {}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -54,11 +54,15 @@ function createFormData(
|
||||
name: 'Demo workflow',
|
||||
description: 'A demo workflow',
|
||||
tags: ['demo'],
|
||||
models: [],
|
||||
customNodes: [],
|
||||
thumbnailType: 'image',
|
||||
thumbnailFile: null,
|
||||
comparisonBeforeFile: null,
|
||||
comparisonAfterFile: null,
|
||||
exampleImages: [],
|
||||
tutorialUrl: '',
|
||||
metadata: {},
|
||||
...overrides
|
||||
}
|
||||
}
|
||||
|
||||
@@ -108,10 +108,18 @@ export function useComfyHubPublishSubmission() {
|
||||
assetIds,
|
||||
description: formData.description || undefined,
|
||||
tags: formData.tags.length > 0 ? normalizeTags(formData.tags) : undefined,
|
||||
models: formData.models.length > 0 ? formData.models : undefined,
|
||||
customNodes:
|
||||
formData.customNodes.length > 0 ? formData.customNodes : undefined,
|
||||
thumbnailType,
|
||||
thumbnailTokenOrUrl,
|
||||
thumbnailComparisonTokenOrUrl,
|
||||
sampleImageTokensOrUrls
|
||||
sampleImageTokensOrUrls,
|
||||
tutorialUrl: formData.tutorialUrl || undefined,
|
||||
metadata:
|
||||
Object.keys(formData.metadata).length > 0
|
||||
? formData.metadata
|
||||
: undefined
|
||||
})
|
||||
}
|
||||
|
||||
|
||||
@@ -27,11 +27,15 @@ function createDefaultFormData(): ComfyHubPublishFormData {
|
||||
name: workflowStore.activeWorkflow?.filename ?? '',
|
||||
description: '',
|
||||
tags: [],
|
||||
models: [],
|
||||
customNodes: [],
|
||||
thumbnailType: 'image',
|
||||
thumbnailFile: null,
|
||||
comparisonBeforeFile: null,
|
||||
comparisonAfterFile: null,
|
||||
exampleImages: []
|
||||
exampleImages: [],
|
||||
tutorialUrl: '',
|
||||
metadata: {}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -25,10 +25,14 @@ interface PublishWorkflowInput {
|
||||
assetIds: string[]
|
||||
description?: string
|
||||
tags?: string[]
|
||||
models?: string[]
|
||||
customNodes?: string[]
|
||||
thumbnailType?: ThumbnailTypeInput
|
||||
thumbnailTokenOrUrl?: string
|
||||
thumbnailComparisonTokenOrUrl?: string
|
||||
sampleImageTokensOrUrls?: string[]
|
||||
tutorialUrl?: string
|
||||
metadata?: Record<string, unknown>
|
||||
}
|
||||
|
||||
function normalizeThumbnailType(type: ThumbnailTypeInput): HubThumbnailType {
|
||||
@@ -174,12 +178,16 @@ export function useComfyHubService() {
|
||||
asset_ids: input.assetIds,
|
||||
description: input.description,
|
||||
tags: input.tags,
|
||||
models: input.models,
|
||||
custom_nodes: input.customNodes,
|
||||
thumbnail_type: input.thumbnailType
|
||||
? normalizeThumbnailType(input.thumbnailType)
|
||||
: undefined,
|
||||
thumbnail_token_or_url: input.thumbnailTokenOrUrl,
|
||||
thumbnail_comparison_token_or_url: input.thumbnailComparisonTokenOrUrl,
|
||||
sample_image_tokens_or_urls: input.sampleImageTokensOrUrls
|
||||
sample_image_tokens_or_urls: input.sampleImageTokensOrUrls,
|
||||
tutorial_url: input.tutorialUrl,
|
||||
metadata: input.metadata
|
||||
}
|
||||
|
||||
const response = await api.fetchApi('/hub/workflows', {
|
||||
|
||||
@@ -12,9 +12,13 @@ export interface ComfyHubPublishFormData {
|
||||
name: string
|
||||
description: string
|
||||
tags: string[]
|
||||
models: string[]
|
||||
customNodes: string[]
|
||||
thumbnailType: ThumbnailType
|
||||
thumbnailFile: File | null
|
||||
comparisonBeforeFile: File | null
|
||||
comparisonAfterFile: File | null
|
||||
exampleImages: ExampleImage[]
|
||||
tutorialUrl: string
|
||||
metadata: Record<string, unknown>
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user