comfy-ts 2.20.2 → 2.22.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +17 -1
- package/dist/{ServeApp-B469W26E.js → ServeApp-DuxYdaZZ.js} +142 -7
- package/dist/ServeApp-DuxYdaZZ.js.map +1 -0
- package/dist/cli.js +5 -5
- package/dist/{exampleAssets-yBLaKXLq.js → exampleAssets-1NHndnNB.js} +59 -17
- package/dist/exampleAssets-1NHndnNB.js.map +1 -0
- package/dist/{findDefinedWorkflow-B90-xFxX.js → findDefinedWorkflow-CRsBTTJK.js} +2 -2
- package/dist/{findDefinedWorkflow-B90-xFxX.js.map → findDefinedWorkflow-CRsBTTJK.js.map} +1 -1
- package/dist/index.cjs +118 -19
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +90 -9
- package/dist/index.d.ts +90 -9
- package/dist/index.js +117 -20
- package/dist/index.js.map +1 -1
- package/dist/{run-run-C-dDD9Dc.js → run-run-Y5ZI48vV.js} +5 -5
- package/dist/{run-run-C-dDD9Dc.js.map → run-run-Y5ZI48vV.js.map} +1 -1
- package/dist/{run-serve-CsEYPGm9.js → run-serve-CICU_wTL.js} +4 -4
- package/dist/{run-serve-CsEYPGm9.js.map → run-serve-CICU_wTL.js.map} +1 -1
- package/dist/{run-tui-bsmja4hi.js → run-tui-CViJXsHL.js} +4 -4
- package/dist/{run-tui-bsmja4hi.js.map → run-tui-CViJXsHL.js.map} +1 -1
- package/dist/{schemaDrift-DaWsE-mt.js → schemaDrift-CzjaIwZX.js} +53 -20
- package/dist/schemaDrift-CzjaIwZX.js.map +1 -0
- package/dist/serve-web.js +204 -47
- package/dist/web.d.ts +90 -9
- package/dist/web.js +117 -20
- package/dist/web.js.map +1 -1
- package/examples/README.md +2 -0
- package/examples/depth-explorer/models.ts +722 -0
- package/examples/depth-explorer/serve.ts +140 -0
- package/examples/depth-explorer/thumbs/bae.webp +0 -0
- package/examples/depth-explorer/thumbs/da3-mono-large.webp +0 -0
- package/examples/depth-explorer/thumbs/dav1-vitl.webp +0 -0
- package/examples/depth-explorer/thumbs/dav2-vitl.webp +0 -0
- package/examples/depth-explorer/thumbs/dsine.webp +0 -0
- package/examples/depth-explorer/thumbs/iid-albedo.webp +0 -0
- package/examples/depth-explorer/thumbs/iid-metalness.webp +0 -0
- package/examples/depth-explorer/thumbs/iid-roughness.webp +0 -0
- package/examples/depth-explorer/thumbs/iid-shading.webp +0 -0
- package/examples/depth-explorer/thumbs/iid-specular.webp +0 -0
- package/examples/depth-explorer/thumbs/leres.webp +0 -0
- package/examples/depth-explorer/thumbs/lotus-depth.webp +0 -0
- package/examples/depth-explorer/thumbs/marigold2-albedo.webp +0 -0
- package/examples/depth-explorer/thumbs/marigold2-depth.webp +0 -0
- package/examples/depth-explorer/thumbs/marigold2-normal.webp +0 -0
- package/examples/depth-explorer/thumbs/metric3d-depth.webp +0 -0
- package/examples/depth-explorer/thumbs/metric3d-normal.webp +0 -0
- package/examples/depth-explorer/thumbs/midas-normal.webp +0 -0
- package/examples/depth-explorer/thumbs/midas.webp +0 -0
- package/examples/depth-explorer/thumbs/moge2-depth.webp +0 -0
- package/examples/depth-explorer/thumbs/moge2-normal.webp +0 -0
- package/examples/depth-explorer/thumbs/zoe-da.webp +0 -0
- package/examples/depth-explorer/thumbs/zoe.webp +0 -0
- package/examples/depth-explorer/web/App.tsx +457 -0
- package/examples/depth-explorer/web/gl.ts +202 -0
- package/examples/depth-explorer/web/index.html +14 -0
- package/examples/depth-explorer/web/main.tsx +19 -0
- package/examples/depth-explorer/web/pixels.ts +86 -0
- package/examples/depth-explorer/web/state.ts +329 -0
- package/examples/depth-explorer/web/styles.css +366 -0
- package/examples/depth-explorer/web/tsconfig.json +16 -0
- package/examples/rvion/17-relight.cflow.ts +110 -0
- package/package.json +3 -2
- package/src/cli/serve/ServeApp.ts +79 -4
- package/src/cli/serve/describeVar.ts +12 -1
- package/src/cli/serve/resultHistory.ts +6 -1
- package/src/cli/serve/thumbs.ts +66 -0
- package/src/cli/serve/web/api.ts +5 -1
- package/src/cli/serve/web/components/Gallery.tsx +2 -0
- package/src/cli/serve/web/components/controls/BasicControls.tsx +14 -17
- package/src/cli/serve/web/components/controls/MediaControl.tsx +62 -9
- package/src/cli/serve/web/components/controls/RichSelect.tsx +262 -0
- package/src/cli/serve/web/state/RunSt.poll.test.ts +4 -1
- package/src/cli/serve/web/state/choiceButtons.ts +26 -2
- package/src/cli/serve/web/styles.ts +39 -0
- package/src/cli/serve/web/widgets/OutputWidgets.tsx +19 -0
- package/src/cli/serve/web/widgets/RelightSt.ts +113 -0
- package/src/cli/serve/web/widgets/RelightWidget.tsx +305 -0
- package/src/cli/serve/web/widgets/relightGl.ts +305 -0
- package/src/cli/serve/web/widgets/widgetStyles.ts +19 -0
- package/src/coreExports.ts +9 -0
- package/src/host/ComfyHost.ts +21 -0
- package/src/host/leastBusy.ts +37 -0
- package/src/state.ts +6 -0
- package/src/vars/ComfyVars.ts +32 -2
- package/src/vars/DefinedWorkflow.ts +42 -21
- package/src/vars/outputWidgets.ts +47 -0
- package/dist/ServeApp-B469W26E.js.map +0 -1
- package/dist/exampleAssets-yBLaKXLq.js.map +0 -1
- package/dist/schemaDrift-DaWsE-mt.js.map +0 -1
|
@@ -0,0 +1,722 @@
|
|
|
1
|
+
// the catalog: every depth / normal / material estimator the explorer knows, one ComfyUI graph each.
|
|
2
|
+
// an entry runs only when the host has its nodes AND its weight files (checked live, see `availability`).
|
|
3
|
+
// depth outputs follow one convention so the grid compares like with like: near = white.
|
|
4
|
+
import { fileURLToPath } from 'node:url'
|
|
5
|
+
import type { BaseNode, BaseNodeFactory, ChoiceOptionLook, ComfyWorkflow } from 'comfy-ts'
|
|
6
|
+
|
|
7
|
+
export type HostId = 'windows-1'
|
|
8
|
+
type W = ComfyWorkflow<HostId>
|
|
9
|
+
type B = W['builder']
|
|
10
|
+
type Img = Comfy.Windows1.Accepts['IMAGE']
|
|
11
|
+
|
|
12
|
+
export type ModelKind = 'depth' | 'normal' | 'material'
|
|
13
|
+
|
|
14
|
+
/** a weight file the graph names, and where to get it when the host lacks it */
|
|
15
|
+
export type WeightFile = { node: string; input: string; file: string; folder: string; url: string }
|
|
16
|
+
|
|
17
|
+
export type ModelEntry = {
|
|
18
|
+
id: string
|
|
19
|
+
label: string
|
|
20
|
+
family: string
|
|
21
|
+
year: number
|
|
22
|
+
/** when it came out, as precise as known: `2025-11` */
|
|
23
|
+
date: string
|
|
24
|
+
/** its weights on disk */
|
|
25
|
+
size: string
|
|
26
|
+
/** 1 (rough) to 5 (the best of its kind), judged on the explorer's samples */
|
|
27
|
+
quality: number
|
|
28
|
+
/** one run at detail 768 on an RTX class GPU, weights loaded */
|
|
29
|
+
speed: string
|
|
30
|
+
/** materials: the map it gives the relight widget */
|
|
31
|
+
map?: 'albedo' | 'roughness' | 'metalness' | 'specular' | 'shading'
|
|
32
|
+
kind: ModelKind
|
|
33
|
+
/** classic = pre 2023 baselines, off by default */
|
|
34
|
+
tier: 'modern' | 'classic'
|
|
35
|
+
blurb: string
|
|
36
|
+
nodes: string[]
|
|
37
|
+
/** weights the host must list; controlnet_aux nodes download theirs on first run instead */
|
|
38
|
+
files: WeightFile[]
|
|
39
|
+
/** the node pack downloads its weights on the first run (slow once) */
|
|
40
|
+
autoDownload?: boolean
|
|
41
|
+
/** the graph up to its output image; the server adds the websocket save node */
|
|
42
|
+
build: (b: B, image: Img, p: { detail: number; wf: W }) => Img | BaseNode
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
const auxNodes = (name: string): string[] => [name]
|
|
46
|
+
|
|
47
|
+
/** multiple of 14 closest to `detail` (vit patch size) */
|
|
48
|
+
const mult14 = (n: number): number => Math.max(140, Math.round(n / 14) * 14)
|
|
49
|
+
|
|
50
|
+
const DA3_FILE: WeightFile = {
|
|
51
|
+
node: 'LoadDA3Model',
|
|
52
|
+
input: 'model_name',
|
|
53
|
+
file: 'depth_anything_3_mono_large.safetensors',
|
|
54
|
+
folder: 'geometry_estimation',
|
|
55
|
+
url: 'https://huggingface.co/Comfy-Org/Depth-Anything-3/resolve/main/geometry_estimation/depth_anything_3_mono_large.safetensors',
|
|
56
|
+
}
|
|
57
|
+
const MOGE_FILE: WeightFile = {
|
|
58
|
+
node: 'LoadMoGeModel',
|
|
59
|
+
input: 'model_name',
|
|
60
|
+
file: 'moge_2_vitl_normal_fp16.safetensors',
|
|
61
|
+
folder: 'geometry_estimation',
|
|
62
|
+
url: 'https://huggingface.co/Comfy-Org/MoGe/resolve/main/geometry_estimation/moge_2_vitl_normal_fp16.safetensors',
|
|
63
|
+
}
|
|
64
|
+
const LOTUS_FILES: WeightFile[] = [
|
|
65
|
+
{
|
|
66
|
+
node: 'UNETLoader',
|
|
67
|
+
input: 'unet_name',
|
|
68
|
+
file: 'lotus-depth-d-v1-1.safetensors',
|
|
69
|
+
folder: 'diffusion_models',
|
|
70
|
+
url: 'https://huggingface.co/Comfy-Org/lotus/resolve/main/lotus-depth-d-v1-1.safetensors',
|
|
71
|
+
},
|
|
72
|
+
{
|
|
73
|
+
node: 'VAELoader',
|
|
74
|
+
input: 'vae_name',
|
|
75
|
+
file: 'SD1.5\\vae-ft-mse-840000-ema-pruned.safetensors',
|
|
76
|
+
folder: 'vae',
|
|
77
|
+
url: 'https://huggingface.co/stabilityai/sd-vae-ft-mse-original/resolve/main/vae-ft-mse-840000-ema-pruned.safetensors',
|
|
78
|
+
},
|
|
79
|
+
]
|
|
80
|
+
const MARIGOLD_BASE = 'https://huggingface.co/Comfy-Org/marigold-v2-0/resolve/main'
|
|
81
|
+
type MarigoldTask = 'depth_log_stage2' | 'normals' | 'albedo'
|
|
82
|
+
const condOf = (task: MarigoldTask): string => (task === 'depth_log_stage2' ? 'depth' : task)
|
|
83
|
+
const marigoldFiles = (task: MarigoldTask): WeightFile[] => [
|
|
84
|
+
{
|
|
85
|
+
node: 'UNETLoader',
|
|
86
|
+
input: 'unet_name',
|
|
87
|
+
file: 'qwen_image_edit_2509_int8_convrot.safetensors',
|
|
88
|
+
folder: 'diffusion_models',
|
|
89
|
+
url: `${MARIGOLD_BASE}/diffusion_models/qwen_image_edit_2509_int8_convrot.safetensors`,
|
|
90
|
+
},
|
|
91
|
+
{
|
|
92
|
+
node: 'LoraLoaderModelOnly',
|
|
93
|
+
input: 'lora_name',
|
|
94
|
+
file: `marigold_v2_${task}.safetensors`,
|
|
95
|
+
folder: 'loras',
|
|
96
|
+
url: `${MARIGOLD_BASE}/loras/marigold_v2_${task}.safetensors`,
|
|
97
|
+
},
|
|
98
|
+
{
|
|
99
|
+
node: 'VAELoader',
|
|
100
|
+
input: 'vae_name',
|
|
101
|
+
file: `marigold_v2_${task}_vae.safetensors`,
|
|
102
|
+
folder: 'vae',
|
|
103
|
+
url: `${MARIGOLD_BASE}/vae/marigold_v2_${task}_vae.safetensors`,
|
|
104
|
+
},
|
|
105
|
+
{
|
|
106
|
+
node: 'ConditioningLoader',
|
|
107
|
+
input: 'conditioning_name',
|
|
108
|
+
file: `marigold_v2_${condOf(task)}_conditioning.safetensors`,
|
|
109
|
+
folder: 'embeddings',
|
|
110
|
+
url: `${MARIGOLD_BASE}/embeddings/marigold_v2_${condOf(task)}_conditioning.safetensors`,
|
|
111
|
+
},
|
|
112
|
+
]
|
|
113
|
+
|
|
114
|
+
/** v⁴ on the float tensor, before the 8 bit save. DA3 renders LINEAR depth (near = 1), where a
|
|
115
|
+
* near subject fits in ~20 grey levels; the other models output disparity, which spends its range
|
|
116
|
+
* near. Two exact squarings (ImageBlend multiply at factor 1) give a comparable curve. */
|
|
117
|
+
const pow4 = (b: B, v: Img): Img => {
|
|
118
|
+
const sq = (x: Img): Img => b.ImageBlend({ image1: x, image2: x, blend_factor: 1, blend_mode: 'multiply' })
|
|
119
|
+
return sq(sq(v))
|
|
120
|
+
}
|
|
121
|
+
|
|
122
|
+
const da3Geometry = (b: B, image: Img, detail: number) =>
|
|
123
|
+
b.DA3Inference({
|
|
124
|
+
da3_model: b.LoadDA3Model({ model_name: 'depth_anything_3_mono_large.safetensors', weight_dtype: 'default' }),
|
|
125
|
+
image,
|
|
126
|
+
resolution: mult14(detail),
|
|
127
|
+
resize_method: 'upper_bound_resize',
|
|
128
|
+
mode: 'mono',
|
|
129
|
+
})
|
|
130
|
+
|
|
131
|
+
/** MoGe resolution_level 0..9 from the shared detail setting */
|
|
132
|
+
const mogeLevel = (detail: number): number => (detail <= 512 ? 5 : detail <= 768 ? 7 : 9)
|
|
133
|
+
const mogeGeometry = (b: B, image: Img, detail: number) =>
|
|
134
|
+
b.MoGeInference({
|
|
135
|
+
moge_model: b.LoadMoGeModel({ model_name: 'moge_2_vitl_normal_fp16.safetensors' }),
|
|
136
|
+
image,
|
|
137
|
+
resolution_level: mogeLevel(detail),
|
|
138
|
+
fov_x_degrees: 0,
|
|
139
|
+
batch_size: 1,
|
|
140
|
+
force_projection: true,
|
|
141
|
+
apply_mask: false,
|
|
142
|
+
refine_steps: 0,
|
|
143
|
+
})
|
|
144
|
+
|
|
145
|
+
/** a factory of the base (untyped) builder, or a loud error naming the node */
|
|
146
|
+
function base(wf: W, name: string): BaseNodeFactory {
|
|
147
|
+
const f = wf.builderBase[name]
|
|
148
|
+
if (f == null) throw new Error(`this host has no ${name} node`)
|
|
149
|
+
return f
|
|
150
|
+
}
|
|
151
|
+
|
|
152
|
+
/** the Marigold v2 blueprint (Comfy-Org): one flow step on a qwen image edit base + a task lora.
|
|
153
|
+
* built on the BASE builder: its weight names are not in the host sdk until they are downloaded */
|
|
154
|
+
const marigold = (wf: W, image: Img, task: MarigoldTask): BaseNode => {
|
|
155
|
+
const [unet, lora, vaeFile, cond] = marigoldFiles(task)
|
|
156
|
+
if (unet == null || lora == null || vaeFile == null || cond == null) throw new Error('marigold files table broken')
|
|
157
|
+
const vae = base(wf, 'VAELoader')({ vae_name: vaeFile.file })
|
|
158
|
+
const model = base(
|
|
159
|
+
wf,
|
|
160
|
+
'ModelSamplingAuraFlow',
|
|
161
|
+
)({
|
|
162
|
+
model: base(
|
|
163
|
+
wf,
|
|
164
|
+
'LoraLoaderModelOnly',
|
|
165
|
+
)({
|
|
166
|
+
model: base(wf, 'UNETLoader')({ unet_name: unet.file, weight_dtype: 'default' }),
|
|
167
|
+
lora_name: lora.file,
|
|
168
|
+
strength_model: 1,
|
|
169
|
+
}),
|
|
170
|
+
shift: 1.73,
|
|
171
|
+
})
|
|
172
|
+
const latent = base(
|
|
173
|
+
wf,
|
|
174
|
+
'SamplerCustomAdvanced',
|
|
175
|
+
)({
|
|
176
|
+
noise: base(wf, 'DisableNoise')({}),
|
|
177
|
+
guider: base(
|
|
178
|
+
wf,
|
|
179
|
+
'BasicGuider',
|
|
180
|
+
)({ model, conditioning: base(wf, 'ConditioningLoader')({ conditioning_name: cond.file }) }),
|
|
181
|
+
sampler: base(wf, 'KSamplerSelect')({ sampler_name: 'euler' }),
|
|
182
|
+
sigmas: base(wf, 'ManualSigmas')({ sigmas: '0.5, 0' }),
|
|
183
|
+
latent_image: base(wf, 'VAEEncode')({ pixels: image, vae }),
|
|
184
|
+
})
|
|
185
|
+
const samples = latent.outputs.output
|
|
186
|
+
if (samples == null) throw new Error('SamplerCustomAdvanced has no `output` slot on this host')
|
|
187
|
+
return base(
|
|
188
|
+
wf,
|
|
189
|
+
'MarigoldV2PostProcess',
|
|
190
|
+
)({
|
|
191
|
+
image: base(wf, 'VAEDecode')({ samples, vae }),
|
|
192
|
+
prediction: task === 'depth_log_stage2' ? 'depth' : task,
|
|
193
|
+
})
|
|
194
|
+
}
|
|
195
|
+
|
|
196
|
+
/** Marigold IID through kijai/ComfyUI-Marigold (diffusers pipeline, weights in models/diffusers).
|
|
197
|
+
* appearance → [albedo, material (R roughness, G metalness)]; lighting → [albedo, diffuse shading,
|
|
198
|
+
* non diffuse residual]. One run per (image, settings): every map entry reuses it from the cache */
|
|
199
|
+
const IID_NODES = ['MarigoldModelLoader', 'MarigoldDepthEstimation_v2']
|
|
200
|
+
const iid = (b: B, image: Img, detail: number, which: 'appearance' | 'lighting'): Img =>
|
|
201
|
+
b['Marigold.MarigoldDepthEstimation_v2']({
|
|
202
|
+
marigold_model: b['Marigold.MarigoldModelLoader']({ model: `prs-eth/marigold-iid-${which}-v1-1` }),
|
|
203
|
+
image,
|
|
204
|
+
seed: 1,
|
|
205
|
+
denoise_steps: 4,
|
|
206
|
+
ensemble_size: 1,
|
|
207
|
+
processing_resolution: Math.round(detail / 8) * 8,
|
|
208
|
+
scheduler: 'DDIMScheduler',
|
|
209
|
+
use_taesd_vae: false,
|
|
210
|
+
})
|
|
211
|
+
const batchItem = (b: B, batch: Img, ix: number): Img => b.ImageFromBatch({ image: batch, batch_index: ix, length: 1 })
|
|
212
|
+
const channel = (b: B, image: Img, c: 'red' | 'green'): Img =>
|
|
213
|
+
b.MaskToImage({ mask: b.ImageToMask({ image, channel: c }) })
|
|
214
|
+
|
|
215
|
+
export const MODELS: ModelEntry[] = [
|
|
216
|
+
// ── depth, modern ──────────────────────────────────────────────
|
|
217
|
+
{
|
|
218
|
+
id: 'da3-mono-large',
|
|
219
|
+
date: '2025-11',
|
|
220
|
+
size: '1.3 GB',
|
|
221
|
+
quality: 5,
|
|
222
|
+
speed: '~2 s',
|
|
223
|
+
label: 'Depth Anything 3',
|
|
224
|
+
family: 'mono large',
|
|
225
|
+
year: 2025,
|
|
226
|
+
kind: 'depth',
|
|
227
|
+
tier: 'modern',
|
|
228
|
+
blurb: 'ByteDance, any-view geometry; the mono variant, shown on a disparity-like curve',
|
|
229
|
+
nodes: ['LoadDA3Model', 'DA3Inference', 'DA3Render', 'ImageBlend'],
|
|
230
|
+
files: [DA3_FILE],
|
|
231
|
+
build: (b, image, p) => {
|
|
232
|
+
const linear = b.DA3Render({
|
|
233
|
+
da3_geometry: da3Geometry(b, image, p.detail),
|
|
234
|
+
output: 'depth',
|
|
235
|
+
'output.normalization': 'v2_style',
|
|
236
|
+
'output.apply_sky_clip': true,
|
|
237
|
+
})
|
|
238
|
+
return pow4(b, linear)
|
|
239
|
+
},
|
|
240
|
+
},
|
|
241
|
+
{
|
|
242
|
+
id: 'moge2-depth',
|
|
243
|
+
date: '2025-07',
|
|
244
|
+
size: '0.7 GB',
|
|
245
|
+
quality: 5,
|
|
246
|
+
speed: '~1.5 s',
|
|
247
|
+
label: 'MoGe-2',
|
|
248
|
+
family: 'ViT-L depth',
|
|
249
|
+
year: 2025,
|
|
250
|
+
kind: 'depth',
|
|
251
|
+
tier: 'modern',
|
|
252
|
+
blurb: 'Microsoft, metric point maps from one image; depth half',
|
|
253
|
+
nodes: ['LoadMoGeModel', 'MoGeInference', 'MoGeRender'],
|
|
254
|
+
files: [MOGE_FILE],
|
|
255
|
+
build: (b, image, p) => b.MoGeRender({ moge_geometry: mogeGeometry(b, image, p.detail), output: 'depth' }),
|
|
256
|
+
},
|
|
257
|
+
{
|
|
258
|
+
id: 'marigold2-depth',
|
|
259
|
+
date: '2026',
|
|
260
|
+
size: '22.5 GB',
|
|
261
|
+
quality: 4,
|
|
262
|
+
speed: '~30 s',
|
|
263
|
+
label: 'Marigold v2',
|
|
264
|
+
family: 'depth',
|
|
265
|
+
year: 2026,
|
|
266
|
+
kind: 'depth',
|
|
267
|
+
tier: 'modern',
|
|
268
|
+
blurb: 'diffusion depth on a Qwen Image Edit base, one step (a ~20 GB base model)',
|
|
269
|
+
nodes: ['UNETLoader', 'LoraLoaderModelOnly', 'ConditioningLoader', 'MarigoldV2PostProcess'],
|
|
270
|
+
files: marigoldFiles('depth_log_stage2'),
|
|
271
|
+
build: (_b, image, p) => marigold(p.wf, image, 'depth_log_stage2'),
|
|
272
|
+
},
|
|
273
|
+
{
|
|
274
|
+
id: 'lotus-depth',
|
|
275
|
+
date: '2024-09',
|
|
276
|
+
size: '2.1 GB',
|
|
277
|
+
quality: 4,
|
|
278
|
+
speed: '~9 s',
|
|
279
|
+
label: 'Lotus',
|
|
280
|
+
family: 'depth-d v1.1',
|
|
281
|
+
year: 2024,
|
|
282
|
+
kind: 'depth',
|
|
283
|
+
tier: 'modern',
|
|
284
|
+
blurb: 'diffusion depth in one step on an SD2 base (the Comfy-Org template)',
|
|
285
|
+
nodes: ['UNETLoader', 'LotusConditioning', 'SetFirstSigma'],
|
|
286
|
+
files: LOTUS_FILES,
|
|
287
|
+
build: (b, image, p) => {
|
|
288
|
+
const model = b.UNETLoader({ unet_name: 'lotus-depth-d-v1-1.safetensors', weight_dtype: 'default' })
|
|
289
|
+
const vae = b.VAELoader({ vae_name: 'SD1.5\\vae-ft-mse-840000-ema-pruned.safetensors' })
|
|
290
|
+
const pixels = b.ImageScaleToTotalPixels({
|
|
291
|
+
image,
|
|
292
|
+
upscale_method: 'lanczos',
|
|
293
|
+
megapixels: (p.detail * p.detail) / 1e6,
|
|
294
|
+
resolution_steps: 8,
|
|
295
|
+
})
|
|
296
|
+
const latent = b.SamplerCustomAdvanced({
|
|
297
|
+
noise: b.DisableNoise({}),
|
|
298
|
+
guider: b.BasicGuider({ model, conditioning: b.LotusConditioning({}) }),
|
|
299
|
+
sampler: b.KSamplerSelect({ sampler_name: 'euler' }),
|
|
300
|
+
sigmas: b.SetFirstSigma({
|
|
301
|
+
sigmas: b.BasicScheduler({ model, scheduler: 'normal', steps: 1, denoise: 1 }),
|
|
302
|
+
sigma: 999,
|
|
303
|
+
}),
|
|
304
|
+
latent_image: b.VAEEncode({ pixels, vae }),
|
|
305
|
+
})
|
|
306
|
+
return b.ImageInvert({ image: b.VAEDecode({ samples: latent.outputs.output, vae }) })
|
|
307
|
+
},
|
|
308
|
+
},
|
|
309
|
+
{
|
|
310
|
+
id: 'dav2-vitl',
|
|
311
|
+
date: '2024-06',
|
|
312
|
+
size: '1.3 GB',
|
|
313
|
+
quality: 4,
|
|
314
|
+
speed: '~1 s',
|
|
315
|
+
label: 'Depth Anything V2',
|
|
316
|
+
family: 'ViT-L',
|
|
317
|
+
year: 2024,
|
|
318
|
+
kind: 'depth',
|
|
319
|
+
tier: 'modern',
|
|
320
|
+
blurb: 'the default relative depth of 2024, fine edges',
|
|
321
|
+
nodes: auxNodes('DepthAnythingV2Preprocessor'),
|
|
322
|
+
files: [],
|
|
323
|
+
autoDownload: true,
|
|
324
|
+
build: (b, image, p) =>
|
|
325
|
+
b['controlnet_aux.DepthAnythingV2Preprocessor']({
|
|
326
|
+
image,
|
|
327
|
+
ckpt_name: 'depth_anything_v2_vitl.pth',
|
|
328
|
+
resolution: p.detail,
|
|
329
|
+
}),
|
|
330
|
+
},
|
|
331
|
+
{
|
|
332
|
+
id: 'metric3d-depth',
|
|
333
|
+
date: '2024-03',
|
|
334
|
+
size: '1.6 GB',
|
|
335
|
+
quality: 4,
|
|
336
|
+
speed: '~7 s',
|
|
337
|
+
label: 'Metric3D v2',
|
|
338
|
+
family: 'ViT-L depth',
|
|
339
|
+
year: 2024,
|
|
340
|
+
kind: 'depth',
|
|
341
|
+
tier: 'modern',
|
|
342
|
+
blurb: 'metric depth and normals from one model, focal length aware',
|
|
343
|
+
nodes: auxNodes('Metric3D-DepthMapPreprocessor'),
|
|
344
|
+
files: [],
|
|
345
|
+
autoDownload: true,
|
|
346
|
+
build: (b, image, p) =>
|
|
347
|
+
b['controlnet_aux.Metric3D-DepthMapPreprocessor']({
|
|
348
|
+
image,
|
|
349
|
+
backbone: 'vit-large',
|
|
350
|
+
fx: 1000,
|
|
351
|
+
fy: 1000,
|
|
352
|
+
resolution: p.detail,
|
|
353
|
+
}),
|
|
354
|
+
},
|
|
355
|
+
{
|
|
356
|
+
id: 'zoe-da',
|
|
357
|
+
date: '2024-01',
|
|
358
|
+
size: '1.3 GB',
|
|
359
|
+
quality: 3,
|
|
360
|
+
speed: '~4 s',
|
|
361
|
+
label: 'ZoeDepth × Depth Anything',
|
|
362
|
+
family: 'metric',
|
|
363
|
+
year: 2024,
|
|
364
|
+
kind: 'depth',
|
|
365
|
+
tier: 'modern',
|
|
366
|
+
blurb: 'Depth Anything V1 backbone with the Zoe metric head (outdoor)',
|
|
367
|
+
nodes: auxNodes('Zoe_DepthAnythingPreprocessor'),
|
|
368
|
+
files: [],
|
|
369
|
+
autoDownload: true,
|
|
370
|
+
build: (b, image, p) =>
|
|
371
|
+
b['controlnet_aux.Zoe_DepthAnythingPreprocessor']({ image, environment: 'outdoor', resolution: p.detail }),
|
|
372
|
+
},
|
|
373
|
+
{
|
|
374
|
+
id: 'dav1-vitl',
|
|
375
|
+
date: '2024-01',
|
|
376
|
+
size: '1.3 GB',
|
|
377
|
+
quality: 3,
|
|
378
|
+
speed: '~2 s',
|
|
379
|
+
label: 'Depth Anything V1',
|
|
380
|
+
family: 'ViT-L',
|
|
381
|
+
year: 2024,
|
|
382
|
+
kind: 'depth',
|
|
383
|
+
tier: 'modern',
|
|
384
|
+
blurb: 'the first Depth Anything, for comparison with V2 and 3',
|
|
385
|
+
nodes: auxNodes('DepthAnythingPreprocessor'),
|
|
386
|
+
files: [],
|
|
387
|
+
autoDownload: true,
|
|
388
|
+
build: (b, image, p) =>
|
|
389
|
+
b['controlnet_aux.DepthAnythingPreprocessor']({
|
|
390
|
+
image,
|
|
391
|
+
ckpt_name: 'depth_anything_vitl14.pth',
|
|
392
|
+
resolution: p.detail,
|
|
393
|
+
}),
|
|
394
|
+
},
|
|
395
|
+
// ── depth, classic ─────────────────────────────────────────────
|
|
396
|
+
{
|
|
397
|
+
id: 'zoe',
|
|
398
|
+
date: '2023-02',
|
|
399
|
+
size: '1.4 GB',
|
|
400
|
+
quality: 2,
|
|
401
|
+
speed: '~3 s',
|
|
402
|
+
label: 'ZoeDepth',
|
|
403
|
+
family: 'N+K',
|
|
404
|
+
year: 2023,
|
|
405
|
+
kind: 'depth',
|
|
406
|
+
tier: 'classic',
|
|
407
|
+
blurb: 'metric depth on a MiDaS backbone',
|
|
408
|
+
nodes: auxNodes('Zoe-DepthMapPreprocessor'),
|
|
409
|
+
files: [],
|
|
410
|
+
autoDownload: true,
|
|
411
|
+
build: (b, image, p) => b['controlnet_aux.Zoe-DepthMapPreprocessor']({ image, resolution: p.detail }),
|
|
412
|
+
},
|
|
413
|
+
{
|
|
414
|
+
id: 'leres',
|
|
415
|
+
date: '2021',
|
|
416
|
+
size: '0.8 GB',
|
|
417
|
+
quality: 2,
|
|
418
|
+
speed: '~3 s',
|
|
419
|
+
label: 'LeReS',
|
|
420
|
+
family: 'boost',
|
|
421
|
+
year: 2021,
|
|
422
|
+
kind: 'depth',
|
|
423
|
+
tier: 'classic',
|
|
424
|
+
blurb: 'monocular depth, the ControlNet 1.1 baseline',
|
|
425
|
+
nodes: auxNodes('LeReS-DepthMapPreprocessor'),
|
|
426
|
+
files: [],
|
|
427
|
+
autoDownload: true,
|
|
428
|
+
build: (b, image, p) =>
|
|
429
|
+
b['controlnet_aux.LeReS-DepthMapPreprocessor']({
|
|
430
|
+
image,
|
|
431
|
+
rm_nearest: 0,
|
|
432
|
+
rm_background: 0,
|
|
433
|
+
boost: 'disable',
|
|
434
|
+
resolution: p.detail,
|
|
435
|
+
}),
|
|
436
|
+
},
|
|
437
|
+
{
|
|
438
|
+
id: 'midas',
|
|
439
|
+
date: '2021',
|
|
440
|
+
size: '0.5 GB',
|
|
441
|
+
quality: 2,
|
|
442
|
+
speed: '~1 s',
|
|
443
|
+
label: 'MiDaS',
|
|
444
|
+
family: 'v3 DPT',
|
|
445
|
+
year: 2021,
|
|
446
|
+
kind: 'depth',
|
|
447
|
+
tier: 'classic',
|
|
448
|
+
blurb: 'the ControlNet era baseline',
|
|
449
|
+
nodes: auxNodes('MiDaS-DepthMapPreprocessor'),
|
|
450
|
+
files: [],
|
|
451
|
+
autoDownload: true,
|
|
452
|
+
build: (b, image, p) =>
|
|
453
|
+
b['controlnet_aux.MiDaS-DepthMapPreprocessor']({
|
|
454
|
+
image,
|
|
455
|
+
a: Math.PI * 2,
|
|
456
|
+
bg_threshold: 0.1,
|
|
457
|
+
resolution: p.detail,
|
|
458
|
+
}),
|
|
459
|
+
},
|
|
460
|
+
// ── normals ────────────────────────────────────────────────────
|
|
461
|
+
{
|
|
462
|
+
id: 'moge2-normal',
|
|
463
|
+
date: '2025-07',
|
|
464
|
+
size: '0.7 GB, shared',
|
|
465
|
+
quality: 5,
|
|
466
|
+
speed: '~0.3 s after depth',
|
|
467
|
+
label: 'MoGe-2',
|
|
468
|
+
family: 'ViT-L normal',
|
|
469
|
+
year: 2025,
|
|
470
|
+
kind: 'normal',
|
|
471
|
+
tier: 'modern',
|
|
472
|
+
blurb: 'normals from the same MoGe-2 pass (OpenGL, green up)',
|
|
473
|
+
nodes: ['LoadMoGeModel', 'MoGeInference', 'MoGeRender'],
|
|
474
|
+
files: [MOGE_FILE],
|
|
475
|
+
build: (b, image, p) =>
|
|
476
|
+
b.MoGeRender({ moge_geometry: mogeGeometry(b, image, p.detail), output: 'normal_opengl' }),
|
|
477
|
+
},
|
|
478
|
+
{
|
|
479
|
+
id: 'marigold2-normal',
|
|
480
|
+
date: '2026',
|
|
481
|
+
size: '22.5 GB',
|
|
482
|
+
quality: 3,
|
|
483
|
+
speed: '~27 s',
|
|
484
|
+
label: 'Marigold v2',
|
|
485
|
+
family: 'normals',
|
|
486
|
+
year: 2026,
|
|
487
|
+
kind: 'normal',
|
|
488
|
+
tier: 'modern',
|
|
489
|
+
blurb: 'diffusion normals on a Qwen Image Edit base (a ~20 GB base model)',
|
|
490
|
+
nodes: ['UNETLoader', 'LoraLoaderModelOnly', 'ConditioningLoader', 'MarigoldV2PostProcess'],
|
|
491
|
+
files: marigoldFiles('normals'),
|
|
492
|
+
build: (_b, image, p) => marigold(p.wf, image, 'normals'),
|
|
493
|
+
},
|
|
494
|
+
{
|
|
495
|
+
id: 'dsine',
|
|
496
|
+
date: '2024-03',
|
|
497
|
+
size: '0.3 GB',
|
|
498
|
+
quality: 4,
|
|
499
|
+
speed: '~2 s',
|
|
500
|
+
label: 'DSINE',
|
|
501
|
+
family: 'normal',
|
|
502
|
+
year: 2024,
|
|
503
|
+
kind: 'normal',
|
|
504
|
+
tier: 'modern',
|
|
505
|
+
blurb: 'surface normals with per pixel ray direction, strong on indoor scenes',
|
|
506
|
+
nodes: auxNodes('DSINE-NormalMapPreprocessor'),
|
|
507
|
+
files: [],
|
|
508
|
+
autoDownload: true,
|
|
509
|
+
build: (b, image, p) =>
|
|
510
|
+
b['controlnet_aux.DSINE-NormalMapPreprocessor']({ image, fov: 60, iterations: 5, resolution: p.detail }),
|
|
511
|
+
},
|
|
512
|
+
{
|
|
513
|
+
id: 'metric3d-normal',
|
|
514
|
+
date: '2024-03',
|
|
515
|
+
size: '1.6 GB',
|
|
516
|
+
quality: 4,
|
|
517
|
+
speed: '~7 s',
|
|
518
|
+
label: 'Metric3D v2',
|
|
519
|
+
family: 'ViT-L normal',
|
|
520
|
+
year: 2024,
|
|
521
|
+
kind: 'normal',
|
|
522
|
+
tier: 'modern',
|
|
523
|
+
blurb: 'normals from the Metric3D joint depth and normal model',
|
|
524
|
+
nodes: auxNodes('Metric3D-NormalMapPreprocessor'),
|
|
525
|
+
files: [],
|
|
526
|
+
autoDownload: true,
|
|
527
|
+
build: (b, image, p) =>
|
|
528
|
+
b['controlnet_aux.Metric3D-NormalMapPreprocessor']({
|
|
529
|
+
image,
|
|
530
|
+
backbone: 'vit-large',
|
|
531
|
+
fx: 1000,
|
|
532
|
+
fy: 1000,
|
|
533
|
+
resolution: p.detail,
|
|
534
|
+
}),
|
|
535
|
+
},
|
|
536
|
+
{
|
|
537
|
+
id: 'bae',
|
|
538
|
+
date: '2021',
|
|
539
|
+
size: '0.3 GB',
|
|
540
|
+
quality: 2,
|
|
541
|
+
speed: '~1 s',
|
|
542
|
+
label: 'BAE',
|
|
543
|
+
family: 'normal',
|
|
544
|
+
year: 2021,
|
|
545
|
+
kind: 'normal',
|
|
546
|
+
tier: 'classic',
|
|
547
|
+
blurb: 'the ControlNet 1.1 normal estimator',
|
|
548
|
+
nodes: auxNodes('BAE-NormalMapPreprocessor'),
|
|
549
|
+
files: [],
|
|
550
|
+
autoDownload: true,
|
|
551
|
+
build: (b, image, p) => b['controlnet_aux.BAE-NormalMapPreprocessor']({ image, resolution: p.detail }),
|
|
552
|
+
},
|
|
553
|
+
{
|
|
554
|
+
id: 'midas-normal',
|
|
555
|
+
date: '2021',
|
|
556
|
+
size: '0.5 GB',
|
|
557
|
+
quality: 1,
|
|
558
|
+
speed: '~1 s',
|
|
559
|
+
label: 'MiDaS',
|
|
560
|
+
family: 'normal from depth',
|
|
561
|
+
year: 2021,
|
|
562
|
+
kind: 'normal',
|
|
563
|
+
tier: 'classic',
|
|
564
|
+
blurb: 'normals differentiated from the MiDaS depth',
|
|
565
|
+
nodes: auxNodes('MiDaS-NormalMapPreprocessor'),
|
|
566
|
+
files: [],
|
|
567
|
+
autoDownload: true,
|
|
568
|
+
build: (b, image, p) =>
|
|
569
|
+
b['controlnet_aux.MiDaS-NormalMapPreprocessor']({
|
|
570
|
+
image,
|
|
571
|
+
a: Math.PI * 2,
|
|
572
|
+
bg_threshold: 0.1,
|
|
573
|
+
resolution: p.detail,
|
|
574
|
+
}),
|
|
575
|
+
},
|
|
576
|
+
// ── materials ──────────────────────────────────────────────────
|
|
577
|
+
{
|
|
578
|
+
id: 'marigold2-albedo',
|
|
579
|
+
date: '2026',
|
|
580
|
+
size: '22.5 GB',
|
|
581
|
+
quality: 3,
|
|
582
|
+
speed: '~25 s',
|
|
583
|
+
map: 'albedo',
|
|
584
|
+
label: 'Marigold v2',
|
|
585
|
+
family: 'albedo',
|
|
586
|
+
year: 2026,
|
|
587
|
+
kind: 'material',
|
|
588
|
+
tier: 'modern',
|
|
589
|
+
blurb: 'the colour without its lighting, on the Qwen Image Edit base',
|
|
590
|
+
nodes: ['UNETLoader', 'LoraLoaderModelOnly', 'ConditioningLoader', 'MarigoldV2PostProcess'],
|
|
591
|
+
files: marigoldFiles('albedo'),
|
|
592
|
+
build: (_b, image, p) => marigold(p.wf, image, 'albedo'),
|
|
593
|
+
},
|
|
594
|
+
{
|
|
595
|
+
id: 'iid-albedo',
|
|
596
|
+
date: '2025',
|
|
597
|
+
size: '2.5 GB',
|
|
598
|
+
quality: 4,
|
|
599
|
+
speed: '~6 s',
|
|
600
|
+
map: 'albedo',
|
|
601
|
+
label: 'Marigold IID',
|
|
602
|
+
family: 'appearance albedo',
|
|
603
|
+
year: 2025,
|
|
604
|
+
kind: 'material',
|
|
605
|
+
tier: 'modern',
|
|
606
|
+
blurb: 'intrinsic decomposition: the colour of the surface, lighting removed',
|
|
607
|
+
nodes: IID_NODES,
|
|
608
|
+
files: [],
|
|
609
|
+
autoDownload: true,
|
|
610
|
+
build: (b, image, p) => batchItem(b, iid(b, image, p.detail, 'appearance'), 0),
|
|
611
|
+
},
|
|
612
|
+
{
|
|
613
|
+
id: 'iid-roughness',
|
|
614
|
+
date: '2025',
|
|
615
|
+
size: '2.5 GB, shared',
|
|
616
|
+
quality: 3,
|
|
617
|
+
speed: '~6 s',
|
|
618
|
+
map: 'roughness',
|
|
619
|
+
label: 'Marigold IID',
|
|
620
|
+
family: 'roughness',
|
|
621
|
+
year: 2025,
|
|
622
|
+
kind: 'material',
|
|
623
|
+
tier: 'modern',
|
|
624
|
+
blurb: 'white = rough (fur, stone), black = glossy',
|
|
625
|
+
nodes: IID_NODES,
|
|
626
|
+
files: [],
|
|
627
|
+
autoDownload: true,
|
|
628
|
+
build: (b, image, p) => channel(b, batchItem(b, iid(b, image, p.detail, 'appearance'), 1), 'red'),
|
|
629
|
+
},
|
|
630
|
+
{
|
|
631
|
+
id: 'iid-metalness',
|
|
632
|
+
date: '2025',
|
|
633
|
+
size: '2.5 GB, shared',
|
|
634
|
+
quality: 3,
|
|
635
|
+
speed: '~6 s',
|
|
636
|
+
map: 'metalness',
|
|
637
|
+
label: 'Marigold IID',
|
|
638
|
+
family: 'metalness',
|
|
639
|
+
year: 2025,
|
|
640
|
+
kind: 'material',
|
|
641
|
+
tier: 'modern',
|
|
642
|
+
blurb: 'white = metal',
|
|
643
|
+
nodes: IID_NODES,
|
|
644
|
+
files: [],
|
|
645
|
+
autoDownload: true,
|
|
646
|
+
build: (b, image, p) => channel(b, batchItem(b, iid(b, image, p.detail, 'appearance'), 1), 'green'),
|
|
647
|
+
},
|
|
648
|
+
{
|
|
649
|
+
id: 'iid-shading',
|
|
650
|
+
date: '2025',
|
|
651
|
+
size: '2.5 GB, shared',
|
|
652
|
+
quality: 4,
|
|
653
|
+
speed: '~6 s',
|
|
654
|
+
map: 'shading',
|
|
655
|
+
label: 'Marigold IID',
|
|
656
|
+
family: 'lighting shading',
|
|
657
|
+
year: 2025,
|
|
658
|
+
kind: 'material',
|
|
659
|
+
tier: 'modern',
|
|
660
|
+
blurb: 'the diffuse light and the shadows the scene casts, colour removed',
|
|
661
|
+
nodes: IID_NODES,
|
|
662
|
+
files: [],
|
|
663
|
+
autoDownload: true,
|
|
664
|
+
build: (b, image, p) => batchItem(b, iid(b, image, p.detail, 'lighting'), 1),
|
|
665
|
+
},
|
|
666
|
+
{
|
|
667
|
+
id: 'iid-specular',
|
|
668
|
+
date: '2025',
|
|
669
|
+
size: '2.5 GB',
|
|
670
|
+
quality: 4,
|
|
671
|
+
speed: '~6 s',
|
|
672
|
+
map: 'specular',
|
|
673
|
+
label: 'Marigold IID',
|
|
674
|
+
family: 'lighting residual',
|
|
675
|
+
year: 2025,
|
|
676
|
+
kind: 'material',
|
|
677
|
+
tier: 'modern',
|
|
678
|
+
blurb: 'the light that is not diffuse: reflections and highlights',
|
|
679
|
+
nodes: IID_NODES,
|
|
680
|
+
files: [],
|
|
681
|
+
autoDownload: true,
|
|
682
|
+
build: (b, image, p) => batchItem(b, iid(b, image, p.detail, 'lighting'), 2),
|
|
683
|
+
},
|
|
684
|
+
]
|
|
685
|
+
|
|
686
|
+
/** an entry as one row of the panel's dropdown (`.ui({ options })`): its name, what it is, its
|
|
687
|
+
* output on the lioness sample as the picture, when it came out, its weights, a 1..5 quality */
|
|
688
|
+
export function optionLook(m: ModelEntry): ChoiceOptionLook {
|
|
689
|
+
return {
|
|
690
|
+
label: `${m.label} ${m.family}`,
|
|
691
|
+
description: m.blurb,
|
|
692
|
+
thumb: fileURLToPath(new URL(`./thumbs/${m.id}.webp`, import.meta.url)),
|
|
693
|
+
date: m.date,
|
|
694
|
+
size: m.size,
|
|
695
|
+
speed: m.speed,
|
|
696
|
+
quality: m.quality,
|
|
697
|
+
...(m.tier === 'classic' ? { tags: ['classic'] } : {}),
|
|
698
|
+
}
|
|
699
|
+
}
|
|
700
|
+
|
|
701
|
+
/** raw object_info, as the host schema keeps it */
|
|
702
|
+
type ObjectInfo = Record<string, { input?: { required?: Record<string, unknown>; optional?: Record<string, unknown> } }>
|
|
703
|
+
|
|
704
|
+
/** the options of a COMBO input in both object_info spellings: [[...]] and ['COMBO', { options }] */
|
|
705
|
+
function comboOptions(info: ObjectInfo, node: string, input: string): string[] {
|
|
706
|
+
const def = info[node]?.input
|
|
707
|
+
const slot = def?.required?.[input] ?? def?.optional?.[input]
|
|
708
|
+
if (!Array.isArray(slot)) return []
|
|
709
|
+
const head: unknown = slot[0]
|
|
710
|
+
if (Array.isArray(head)) return head.filter((x): x is string => typeof x === 'string')
|
|
711
|
+
const meta: unknown = slot[1]
|
|
712
|
+
const opts: unknown = typeof meta === 'object' && meta != null && 'options' in meta ? meta.options : null
|
|
713
|
+
return Array.isArray(opts) ? opts.filter((x): x is string => typeof x === 'string') : []
|
|
714
|
+
}
|
|
715
|
+
|
|
716
|
+
export type Availability = { ok: boolean; missingNodes: string[]; missingFiles: WeightFile[] }
|
|
717
|
+
|
|
718
|
+
export function availability(info: ObjectInfo, m: ModelEntry): Availability {
|
|
719
|
+
const missingNodes = m.nodes.filter((n) => info[n] == null)
|
|
720
|
+
const missingFiles = m.files.filter((f) => !comboOptions(info, f.node, f.input).includes(f.file))
|
|
721
|
+
return { ok: missingNodes.length === 0 && missingFiles.length === 0, missingNodes, missingFiles }
|
|
722
|
+
}
|