mirror of
https://github.com/invoke-ai/InvokeAI
synced 2024-08-30 20:32:17 +00:00
feat(ui): add UI-level nodes denylist
This simply hides nodes from the workflow editor. The nodes will still work if an API request is made with them. For example, you could hide `iterate` nodes from the workflow editor, but if the Linear UI makes use of those nodes, they will still function. - Update `AppConfig` with optional property `nodesDenylist: string[]` - If provided, nodes are filtered out by `type` in the workflow editor
This commit is contained in:
committed by
Kent Keirsey
parent
dc771d9645
commit
7254a6a517
@ -60,11 +60,15 @@ const isNotInDenylist = (schema: InvocationSchemaObject) =>
|
||||
!invocationDenylist.includes(schema.properties.type.default);
|
||||
|
||||
export const parseSchema = (
|
||||
openAPI: OpenAPIV3.Document
|
||||
openAPI: OpenAPIV3.Document,
|
||||
nodesDenylistExtra: string[] = []
|
||||
): Record<string, InvocationTemplate> => {
|
||||
const filteredSchemas = Object.values(openAPI.components?.schemas ?? {})
|
||||
.filter(isInvocationSchemaObject)
|
||||
.filter(isNotInDenylist);
|
||||
.filter(isNotInDenylist)
|
||||
.filter(
|
||||
(schema) => !nodesDenylistExtra.includes(schema.properties.type.default)
|
||||
);
|
||||
|
||||
const invocations = filteredSchemas.reduce<
|
||||
Record<string, InvocationTemplate>
|
||||
|
Reference in New Issue
Block a user