Skip to content

Commit

Permalink
Merge branch 'main' of github.com:jbilcke-hf/clapper
Browse files Browse the repository at this point in the history
  • Loading branch information
jbilcke-hf committed Aug 27, 2024
2 parents 2ef7f4c + 7dd23bb commit 21f95fb
Showing 1 changed file with 12 additions and 4 deletions.
16 changes: 12 additions & 4 deletions packages/app/src/services/settings/workflows/parseWorkflow.ts
Original file line number Diff line number Diff line change
Expand Up @@ -49,10 +49,18 @@ export function parseWorkflow(
throw new Error(`the workflow data seems invalid`)
}
if (maybeWorkflow.engine == ClapWorkflowEngine.COMFYUI_WORKFLOW) {
const { inputFields, inputValues } =
convertComfyUiWorkflowApiToClapWorkflow(maybeWorkflow.data)
maybeWorkflow.inputFields = inputFields
maybeWorkflow.inputValues = inputValues
// The `data` comfyui workflow doesn't have info about custom
// inputFields/inputValues, it gets only the default ones based on the nodes
const {
inputFields: defaultInputFields,
inputValues: defaultInputValues,
} = convertComfyUiWorkflowApiToClapWorkflow(maybeWorkflow.data)
// Use the already existing inputFields/inputValues, otherwise use the default
// ones based on the raw comfyui workflow data
maybeWorkflow.inputFields =
maybeWorkflow.inputFields || defaultInputFields
maybeWorkflow.inputValues =
maybeWorkflow.inputValues || defaultInputValues
}
return maybeWorkflow
} catch (err) {
Expand Down

0 comments on commit 21f95fb

Please sign in to comment.