Line data Source code
1 : import type { TemplateInput } from './templateSchema'
2 :
3 : export interface LogoInfo {
4 : /** Provider name(s) matching index_logo.json. String for single, array for stacked logos. */
5 : provider: string | string[]
6 : /** Tailwind positioning classes */
7 : position?: string
8 : }
9 :
10 : export interface TemplateInfo {
11 : name: string
12 : io?: { inputs?: TemplateInput[] }
13 : /**
14 : * Optional title which is used as the fallback if the name is not in the locales dictionary.
15 : */
16 : title?: string
17 : tutorialUrl?: string
18 : mediaType: string
19 : mediaSubtype: string
20 : thumbnailVariant?: string
21 : description: string
22 : localizedTitle?: string
23 : localizedDescription?: string
24 : isEssential?: boolean
25 : /**
26 : * Whether App Mode is this template's default view, from the workflow's own
27 : * `extra.linearMode`. Supplied by `templates/index.json`; absent means a node
28 : * graph. Do not fall back to the `.app` filename suffix, which is wrong in
29 : * both directions (see the App badge in WorkflowTemplateSelectorDialog).
30 : */
31 : isApp?: boolean
32 : sourceModule?: string
33 : tags?: string[]
34 : models?: string[]
35 : date?: string
36 : useCase?: string
37 : license?: string
38 : /**
39 : * Estimated VRAM requirement in bytes.
40 : */
41 : vram?: number
42 : size?: number
43 : /**
44 : * Whether this template uses open source models. When false, indicates partner/API node templates.
45 : */
46 : openSource?: boolean
47 : /**
48 : * Array of custom node package IDs required for this template (from Custom Node Registry).
49 : * Templates with this field will be hidden on local installations temporarily.
50 : */
51 : requiresCustomNodes?: string[]
52 : /**
53 : * Curator override applied to search relevance and the "Recommended" sort.
54 : * Anything from -5 to 5, and an absent value, is neutral; promotion starts at
55 : * 6 and demotion at -6, both saturating at a magnitude of 1000.
56 : * See docs/TEMPLATE_RANKING.md.
57 : */
58 : searchRank?: number
59 : /**
60 : * Usage score based on real world usage statistics.
61 : * Used for popular templates sort and for "Recommended" sort boost.
62 : */
63 : usage?: number
64 : /**
65 : * Manage template's visibility across different distributions by specifying which distributions it should be included on.
66 : * If not specified, the template will be included on all distributions.
67 : */
68 : includeOnDistributions?: TemplateIncludeOnDistributionEnum[]
69 : /**
70 : * Logo overlays to display on the template thumbnail.
71 : */
72 : logos?: LogoInfo[]
73 : }
74 :
75 2356 : export enum TemplateIncludeOnDistributionEnum {
76 2356 : Cloud = 'cloud',
77 2356 : Local = 'local',
78 2356 : Desktop = 'desktop',
79 2356 : Mac = 'mac',
80 2356 : Windows = 'windows'
81 : }
82 :
83 : export interface WorkflowTemplates {
84 : moduleName: string
85 : templates: TemplateInfo[]
86 : title: string
87 : localizedTitle?: string
88 : category?: string
89 : type?: string
90 : icon?: string
91 : isEssential?: boolean
92 : }
93 :
94 : export interface TemplateGroup {
95 : label: string
96 : icon?: string
97 : modules: WorkflowTemplates[]
98 : }
99 :
100 : export type TemplateTypeFilter = 'all' | 'nodeGraph' | 'apps'
|