Browse Source

Merge branch 'sdcpp-browse-everywhere'

fszontagh 1 month ago
parent
commit
3b87179059
2 changed files with 111 additions and 9 deletions
  1. 101 8
      nodes/sdcpp/sdcpp-model-load.js
  2. 10 1
      nodes/sdcpp/sdcpp-upscaler-load.js

+ 101 - 8
nodes/sdcpp/sdcpp-model-load.js

@@ -22,7 +22,16 @@ const configSchema = {
         },
         modelName: {
             type: 'string', title: 'Model',
-            description: 'File name of the model, relative to its type directory. Usually supplied by an SD.cpp Model node rather than typed here'
+            description: 'File name of the model, relative to its type directory. Browse lists what the server has of the Model Type chosen below',
+            dynamicOptions: {
+                source: 'node',
+                node: 'sdcpp-model',
+                config: { listOnly: true },
+                itemsPath: 'models',
+                valueKey: 'name',
+                labelKey: 'name',
+                needs: ['serverUrl', 'credentialId']
+            }
         },
         modelType: {
             type: 'string', title: 'Model Type',
@@ -30,13 +39,97 @@ const configSchema = {
             default: '',
             description: 'checkpoint bundles U-Net, CLIP and VAE and suits SD1, SD2 and SDXL. diffusion holds only the U-Net or DiT and needs its components named separately, which is how Flux, SD3, Qwen, Wan and Z-Image load'
         },
-        vae: { type: 'string', title: 'VAE', description: 'Component file name' },
-        clipL: { type: 'string', title: 'CLIP-L', description: 'Component file name' },
-        clipG: { type: 'string', title: 'CLIP-G', description: 'Component file name' },
-        t5xxl: { type: 'string', title: 'T5-XXL', description: 'Component file name' },
-        llm: { type: 'string', title: 'LLM', description: 'Component file name, used by Z-Image, Qwen, Anima and Flux2' },
-        taesd: { type: 'string', title: 'TAESD', description: 'Tiny autoencoder for progress previews' },
-        controlnet: { type: 'string', title: 'ControlNet', description: 'Component file name' },
+        vae: {
+            type: 'string', title: 'VAE',
+            description: 'Component file name',
+            dynamicOptions: {
+                source: 'node',
+                node: 'sdcpp-model',
+                config: { listOnly: true, modelType: 'vae' },
+                itemsPath: 'models',
+                valueKey: 'name',
+                labelKey: 'name',
+                needs: ['serverUrl', 'credentialId']
+            }
+        },
+        clipL: {
+            type: 'string', title: 'CLIP-L',
+            description: 'Component file name',
+            dynamicOptions: {
+                source: 'node',
+                node: 'sdcpp-model',
+                config: { listOnly: true, modelType: 'clip' },
+                itemsPath: 'models',
+                valueKey: 'name',
+                labelKey: 'name',
+                needs: ['serverUrl', 'credentialId']
+            }
+        },
+        clipG: {
+            type: 'string', title: 'CLIP-G',
+            description: 'Component file name',
+            dynamicOptions: {
+                source: 'node',
+                node: 'sdcpp-model',
+                config: { listOnly: true, modelType: 'clip' },
+                itemsPath: 'models',
+                valueKey: 'name',
+                labelKey: 'name',
+                needs: ['serverUrl', 'credentialId']
+            }
+        },
+        t5xxl: {
+            type: 'string', title: 'T5-XXL',
+            description: 'Component file name',
+            dynamicOptions: {
+                source: 'node',
+                node: 'sdcpp-model',
+                config: { listOnly: true, modelType: 't5' },
+                itemsPath: 'models',
+                valueKey: 'name',
+                labelKey: 'name',
+                needs: ['serverUrl', 'credentialId']
+            }
+        },
+        llm: {
+            type: 'string', title: 'LLM',
+            description: 'Component file name, used by Z-Image, Qwen, Anima and Flux2',
+            dynamicOptions: {
+                source: 'node',
+                node: 'sdcpp-model',
+                config: { listOnly: true, modelType: 'llm' },
+                itemsPath: 'models',
+                valueKey: 'name',
+                labelKey: 'name',
+                needs: ['serverUrl', 'credentialId']
+            }
+        },
+        taesd: {
+            type: 'string', title: 'TAESD',
+            description: 'Tiny autoencoder for progress previews',
+            dynamicOptions: {
+                source: 'node',
+                node: 'sdcpp-model',
+                config: { listOnly: true, modelType: 'taesd' },
+                itemsPath: 'models',
+                valueKey: 'name',
+                labelKey: 'name',
+                needs: ['serverUrl', 'credentialId']
+            }
+        },
+        controlnet: {
+            type: 'string', title: 'ControlNet',
+            description: 'Component file name',
+            dynamicOptions: {
+                source: 'node',
+                node: 'sdcpp-model',
+                config: { listOnly: true, modelType: 'controlnet' },
+                itemsPath: 'models',
+                valueKey: 'name',
+                labelKey: 'name',
+                needs: ['serverUrl', 'credentialId']
+            }
+        },
         options: {
             type: 'object', title: 'Load Options',
             description: 'Extra load options passed through, such as flash_attn, enable_mmap, weight_type, stream_layers or max_vram'

+ 10 - 1
nodes/sdcpp/sdcpp-upscaler-load.js

@@ -22,7 +22,16 @@ const configSchema = {
         },
         modelName: {
             type: 'string', title: 'Upscaler',
-            description: 'File name of the ESRGAN-family upscaler. Usually supplied by an SD.cpp Model node set to type esrgan'
+            description: 'File name of the ESRGAN-family upscaler. Browse lists what the server has',
+            dynamicOptions: {
+                source: 'node',
+                node: 'sdcpp-model',
+                config: { listOnly: true, modelType: 'esrgan' },
+                itemsPath: 'models',
+                valueKey: 'name',
+                labelKey: 'name',
+                needs: ['serverUrl', 'credentialId']
+            }
         },
         force: {
             type: 'boolean', title: 'Force Reload',