2025-05-12 16:29:32 -04:00
import re
2026-04-16 21:20:16 -07:00
import json
2026-05-19 19:25:49 -07:00
import string
2025-08-22 05:03:57 +03:00
from typing_extensions import override
2025-05-12 16:29:32 -04:00
2025-08-22 05:03:57 +03:00
from comfy_api . latest import ComfyExtension , io
2025-05-12 16:29:32 -04:00
2025-08-22 05:03:57 +03:00
2026-05-19 19:25:49 -07:00
class StringFormat ( io . ComfyNode ) :
@classmethod
def define_schema ( cls ) - > io . Schema :
autogrow = io . Autogrow . TemplateNames (
input = io . AnyType . Input ( " value " ) ,
names = list ( string . ascii_lowercase ) ,
min = 0 ,
)
return io . Schema (
node_id = " StringFormat " ,
display_name = " Format Text " ,
category = " text " ,
search_aliases = [ " string " , " format " ] ,
description = " Same as Python ' s string format method. Supports all of Python ' s format options and features. " ,
inputs = [
io . Autogrow . Input ( " values " , template = autogrow ) ,
io . String . Input ( " f_string " , default = " {a} " , multiline = True ) ,
] ,
outputs = [
io . String . Output ( ) ,
] ,
)
@classmethod
def execute (
cls , values : io . Autogrow . Type , f_string : str
) - > io . NodeOutput :
return io . NodeOutput ( f_string . format ( * * values ) )
2025-08-22 05:03:57 +03:00
class StringConcatenate ( io . ComfyNode ) :
2025-05-12 16:29:32 -04:00
@classmethod
2025-08-22 05:03:57 +03:00
def define_schema ( cls ) :
return io . Schema (
node_id = " StringConcatenate " ,
2026-05-05 22:31:24 +08:00
search_aliases = [ " concatenate " , " text concat " , " join text " , " merge text " , " combine strings " , " string concat " , " append text " , " combine text " ] ,
display_name = " Concatenate Text " ,
category = " text " ,
2025-08-22 05:03:57 +03:00
inputs = [
io . String . Input ( " string_a " , multiline = True ) ,
io . String . Input ( " string_b " , multiline = True ) ,
io . String . Input ( " delimiter " , multiline = False , default = " " ) ,
] ,
outputs = [
io . String . Output ( ) ,
]
)
2025-05-12 16:29:32 -04:00
@classmethod
2025-08-22 05:03:57 +03:00
def execute ( cls , string_a , string_b , delimiter ) :
return io . NodeOutput ( delimiter . join ( ( string_a , string_b ) ) )
class StringSubstring ( io . ComfyNode ) :
2025-05-12 16:29:32 -04:00
@classmethod
2025-08-22 05:03:57 +03:00
def define_schema ( cls ) :
return io . Schema (
node_id = " StringSubstring " ,
2026-05-05 22:31:24 +08:00
search_aliases = [ " substring " , " extract text " , " text portion " ] ,
display_name = " Substring " ,
category = " text " ,
2025-08-22 05:03:57 +03:00
inputs = [
io . String . Input ( " string " , multiline = True ) ,
io . Int . Input ( " start " ) ,
io . Int . Input ( " end " ) ,
] ,
outputs = [
io . String . Output ( ) ,
]
)
2025-05-12 16:29:32 -04:00
2025-08-22 05:03:57 +03:00
@classmethod
def execute ( cls , string , start , end ) :
return io . NodeOutput ( string [ start : end ] )
2025-05-12 16:29:32 -04:00
2025-08-22 05:03:57 +03:00
class StringLength ( io . ComfyNode ) :
@classmethod
def define_schema ( cls ) :
return io . Schema (
node_id = " StringLength " ,
2026-03-29 21:02:44 -07:00
search_aliases = [ " character count " , " text size " , " string length " ] ,
display_name = " Text Length " ,
2026-05-05 22:31:24 +08:00
category = " text " ,
2025-08-22 05:03:57 +03:00
inputs = [
io . String . Input ( " string " , multiline = True ) ,
] ,
outputs = [
io . Int . Output ( display_name = " length " ) ,
]
)
2025-05-12 16:29:32 -04:00
@classmethod
2025-08-22 05:03:57 +03:00
def execute ( cls , string ) :
return io . NodeOutput ( len ( string ) )
class CaseConverter ( io . ComfyNode ) :
@classmethod
def define_schema ( cls ) :
return io . Schema (
node_id = " CaseConverter " ,
2026-05-05 22:31:24 +08:00
search_aliases = [ " case converter " , " text case " , " uppercase " , " lowercase " , " capitalize " ] ,
display_name = " Convert Text Case " ,
category = " text " ,
2025-08-22 05:03:57 +03:00
inputs = [
io . String . Input ( " string " , multiline = True ) ,
io . Combo . Input ( " mode " , options = [ " UPPERCASE " , " lowercase " , " Capitalize " , " Title Case " ] ) ,
] ,
outputs = [
io . String . Output ( ) ,
]
)
@classmethod
def execute ( cls , string , mode ) :
2025-05-12 16:29:32 -04:00
if mode == " UPPERCASE " :
result = string . upper ( )
elif mode == " lowercase " :
result = string . lower ( )
elif mode == " Capitalize " :
result = string . capitalize ( )
elif mode == " Title Case " :
result = string . title ( )
else :
result = string
2025-08-22 05:03:57 +03:00
return io . NodeOutput ( result )
2025-05-12 16:29:32 -04:00
2025-08-22 05:03:57 +03:00
class StringTrim ( io . ComfyNode ) :
@classmethod
def define_schema ( cls ) :
return io . Schema (
node_id = " StringTrim " ,
2026-05-05 22:31:24 +08:00
search_aliases = [ " trim " , " clean whitespace " , " remove whitespace " , " remove spaces " , " strip " ] ,
display_name = " Trim Text " ,
category = " text " ,
2025-08-22 05:03:57 +03:00
inputs = [
io . String . Input ( " string " , multiline = True ) ,
io . Combo . Input ( " mode " , options = [ " Both " , " Left " , " Right " ] ) ,
] ,
outputs = [
io . String . Output ( ) ,
]
)
2025-05-12 16:29:32 -04:00
@classmethod
2025-08-22 05:03:57 +03:00
def execute ( cls , string , mode ) :
2025-05-12 16:29:32 -04:00
if mode == " Both " :
result = string . strip ( )
elif mode == " Left " :
result = string . lstrip ( )
elif mode == " Right " :
result = string . rstrip ( )
else :
result = string
2025-08-22 05:03:57 +03:00
return io . NodeOutput ( result )
2025-05-12 16:29:32 -04:00
2025-08-22 05:03:57 +03:00
class StringReplace ( io . ComfyNode ) :
2025-05-12 16:29:32 -04:00
@classmethod
2025-08-22 05:03:57 +03:00
def define_schema ( cls ) :
return io . Schema (
node_id = " StringReplace " ,
2026-05-05 22:31:24 +08:00
search_aliases = [ " replace " , " find and replace " , " substitute " , " swap text " ] ,
display_name = " Replace Text " ,
category = " text " ,
2025-08-22 05:03:57 +03:00
inputs = [
io . String . Input ( " string " , multiline = True ) ,
io . String . Input ( " find " , multiline = True ) ,
io . String . Input ( " replace " , multiline = True ) ,
] ,
outputs = [
io . String . Output ( ) ,
]
)
2025-05-12 16:29:32 -04:00
2025-08-22 05:03:57 +03:00
@classmethod
def execute ( cls , string , find , replace ) :
return io . NodeOutput ( string . replace ( find , replace ) )
2025-05-12 16:29:32 -04:00
2025-08-22 05:03:57 +03:00
class StringContains ( io . ComfyNode ) :
@classmethod
def define_schema ( cls ) :
return io . Schema (
node_id = " StringContains " ,
2026-05-05 22:31:24 +08:00
search_aliases = [ " contains " , " text includes " , " string includes " ] ,
display_name = " Contains Text " ,
category = " text " ,
2025-08-22 05:03:57 +03:00
inputs = [
io . String . Input ( " string " , multiline = True ) ,
io . String . Input ( " substring " , multiline = True ) ,
feat: mark 429 widgets as advanced for collapsible UI (#12197)
* feat: mark 429 widgets as advanced for collapsible UI
Mark widgets as advanced across core, comfy_extras, and comfy_api_nodes
to support the new collapsible advanced inputs section in the frontend.
Changes:
- 267 advanced markers in comfy_extras/
- 162 advanced markers in comfy_api_nodes/
- All files pass python3 -m py_compile verification
Widgets marked advanced (hidden by default):
- Scheduler internals: sigma_max, sigma_min, rho, mu, beta, alpha
- Sampler internals: eta, s_noise, order, rtol, atol, h_init, pcoeff, etc.
- Memory optimization: tile_size, overlap, temporal_size, temporal_overlap
- Pipeline controls: add_noise, start_at_step, end_at_step
- Timing controls: start_percent, end_percent
- Layer selection: stop_at_clip_layer, layers, block_number
- Video encoding: codec, crf, format
- Device/dtype: device, noise_device, dtype, weight_dtype
Widgets kept basic (always visible):
- Core params: strength, steps, cfg, denoise, seed, width, height
- Model selectors: ckpt_name, lora_name, vae_name, sampler_name
- Common controls: upscale_method, crop, batch_size, fps, opacity
Related: frontend PR #11939
Amp-Thread-ID: https://ampcode.com/threads/T-019c1734-6b61-702e-b333-f02c399963fc
* fix: remove advanced=True from DynamicCombo.Input (unsupported)
Amp-Thread-ID: https://ampcode.com/threads/T-019c1734-6b61-702e-b333-f02c399963fc
* fix: address review - un-mark model merge, video, image, and training node widgets as advanced
Per comfyanonymous review:
- Model merge arguments should not be advanced (all 14 model-specific merge classes)
- SaveAnimatedWEBP lossless/quality/method should not be advanced
- SaveWEBM/SaveVideo codec/crf/format should not be advanced
- TrainLoraNode options should not be advanced (7 inputs)
Amp-Thread-ID: https://ampcode.com/threads/T-019c322b-a3a8-71b7-9962-d44573ca6352
* fix: un-mark batch_size and webcam width/height as advanced (should stay basic)
Amp-Thread-ID: https://ampcode.com/threads/T-019c3236-1417-74aa-82a3-bcb365fbe9d1
---------
Co-authored-by: Jedrzej Kosinski <kosinkadink1@gmail.com>
2026-02-19 19:20:02 -08:00
io . Boolean . Input ( " case_sensitive " , default = True , advanced = True ) ,
2025-08-22 05:03:57 +03:00
] ,
outputs = [
io . Boolean . Output ( display_name = " contains " ) ,
]
)
2025-05-12 16:29:32 -04:00
@classmethod
2025-08-22 05:03:57 +03:00
def execute ( cls , string , substring , case_sensitive ) :
2025-05-12 16:29:32 -04:00
if case_sensitive :
contains = substring in string
else :
contains = substring . lower ( ) in string . lower ( )
2025-08-22 05:03:57 +03:00
return io . NodeOutput ( contains )
2025-05-12 16:29:32 -04:00
2025-08-22 05:03:57 +03:00
class StringCompare ( io . ComfyNode ) :
2025-05-12 16:29:32 -04:00
@classmethod
2025-08-22 05:03:57 +03:00
def define_schema ( cls ) :
return io . Schema (
node_id = " StringCompare " ,
2026-05-05 22:31:24 +08:00
search_aliases = [ " compare " , " text match " , " string equals " , " starts with " , " ends with " ] ,
display_name = " Compare Text " ,
category = " text " ,
2025-08-22 05:03:57 +03:00
inputs = [
io . String . Input ( " string_a " , multiline = True ) ,
io . String . Input ( " string_b " , multiline = True ) ,
io . Combo . Input ( " mode " , options = [ " Starts With " , " Ends With " , " Equal " ] ) ,
feat: mark 429 widgets as advanced for collapsible UI (#12197)
* feat: mark 429 widgets as advanced for collapsible UI
Mark widgets as advanced across core, comfy_extras, and comfy_api_nodes
to support the new collapsible advanced inputs section in the frontend.
Changes:
- 267 advanced markers in comfy_extras/
- 162 advanced markers in comfy_api_nodes/
- All files pass python3 -m py_compile verification
Widgets marked advanced (hidden by default):
- Scheduler internals: sigma_max, sigma_min, rho, mu, beta, alpha
- Sampler internals: eta, s_noise, order, rtol, atol, h_init, pcoeff, etc.
- Memory optimization: tile_size, overlap, temporal_size, temporal_overlap
- Pipeline controls: add_noise, start_at_step, end_at_step
- Timing controls: start_percent, end_percent
- Layer selection: stop_at_clip_layer, layers, block_number
- Video encoding: codec, crf, format
- Device/dtype: device, noise_device, dtype, weight_dtype
Widgets kept basic (always visible):
- Core params: strength, steps, cfg, denoise, seed, width, height
- Model selectors: ckpt_name, lora_name, vae_name, sampler_name
- Common controls: upscale_method, crop, batch_size, fps, opacity
Related: frontend PR #11939
Amp-Thread-ID: https://ampcode.com/threads/T-019c1734-6b61-702e-b333-f02c399963fc
* fix: remove advanced=True from DynamicCombo.Input (unsupported)
Amp-Thread-ID: https://ampcode.com/threads/T-019c1734-6b61-702e-b333-f02c399963fc
* fix: address review - un-mark model merge, video, image, and training node widgets as advanced
Per comfyanonymous review:
- Model merge arguments should not be advanced (all 14 model-specific merge classes)
- SaveAnimatedWEBP lossless/quality/method should not be advanced
- SaveWEBM/SaveVideo codec/crf/format should not be advanced
- TrainLoraNode options should not be advanced (7 inputs)
Amp-Thread-ID: https://ampcode.com/threads/T-019c322b-a3a8-71b7-9962-d44573ca6352
* fix: un-mark batch_size and webcam width/height as advanced (should stay basic)
Amp-Thread-ID: https://ampcode.com/threads/T-019c3236-1417-74aa-82a3-bcb365fbe9d1
---------
Co-authored-by: Jedrzej Kosinski <kosinkadink1@gmail.com>
2026-02-19 19:20:02 -08:00
io . Boolean . Input ( " case_sensitive " , default = True , advanced = True ) ,
2025-08-22 05:03:57 +03:00
] ,
outputs = [
io . Boolean . Output ( ) ,
]
)
@classmethod
def execute ( cls , string_a , string_b , mode , case_sensitive ) :
2025-05-12 16:29:32 -04:00
if case_sensitive :
a = string_a
b = string_b
else :
a = string_a . lower ( )
b = string_b . lower ( )
if mode == " Equal " :
2025-08-22 05:03:57 +03:00
return io . NodeOutput ( a == b )
2025-05-12 16:29:32 -04:00
elif mode == " Starts With " :
2025-08-22 05:03:57 +03:00
return io . NodeOutput ( a . startswith ( b ) )
2025-05-12 16:29:32 -04:00
elif mode == " Ends With " :
2025-08-22 05:03:57 +03:00
return io . NodeOutput ( a . endswith ( b ) )
2025-05-12 16:29:32 -04:00
2025-08-22 05:03:57 +03:00
class RegexMatch ( io . ComfyNode ) :
2025-05-12 16:29:32 -04:00
@classmethod
2025-08-22 05:03:57 +03:00
def define_schema ( cls ) :
return io . Schema (
node_id = " RegexMatch " ,
2026-05-05 22:31:24 +08:00
search_aliases = [ " regex match " , " regex " , " pattern match " , " text contains " , " string match " ] ,
display_name = " Match Text " ,
category = " text " ,
2025-08-22 05:03:57 +03:00
inputs = [
io . String . Input ( " string " , multiline = True ) ,
io . String . Input ( " regex_pattern " , multiline = True ) ,
feat: mark 429 widgets as advanced for collapsible UI (#12197)
* feat: mark 429 widgets as advanced for collapsible UI
Mark widgets as advanced across core, comfy_extras, and comfy_api_nodes
to support the new collapsible advanced inputs section in the frontend.
Changes:
- 267 advanced markers in comfy_extras/
- 162 advanced markers in comfy_api_nodes/
- All files pass python3 -m py_compile verification
Widgets marked advanced (hidden by default):
- Scheduler internals: sigma_max, sigma_min, rho, mu, beta, alpha
- Sampler internals: eta, s_noise, order, rtol, atol, h_init, pcoeff, etc.
- Memory optimization: tile_size, overlap, temporal_size, temporal_overlap
- Pipeline controls: add_noise, start_at_step, end_at_step
- Timing controls: start_percent, end_percent
- Layer selection: stop_at_clip_layer, layers, block_number
- Video encoding: codec, crf, format
- Device/dtype: device, noise_device, dtype, weight_dtype
Widgets kept basic (always visible):
- Core params: strength, steps, cfg, denoise, seed, width, height
- Model selectors: ckpt_name, lora_name, vae_name, sampler_name
- Common controls: upscale_method, crop, batch_size, fps, opacity
Related: frontend PR #11939
Amp-Thread-ID: https://ampcode.com/threads/T-019c1734-6b61-702e-b333-f02c399963fc
* fix: remove advanced=True from DynamicCombo.Input (unsupported)
Amp-Thread-ID: https://ampcode.com/threads/T-019c1734-6b61-702e-b333-f02c399963fc
* fix: address review - un-mark model merge, video, image, and training node widgets as advanced
Per comfyanonymous review:
- Model merge arguments should not be advanced (all 14 model-specific merge classes)
- SaveAnimatedWEBP lossless/quality/method should not be advanced
- SaveWEBM/SaveVideo codec/crf/format should not be advanced
- TrainLoraNode options should not be advanced (7 inputs)
Amp-Thread-ID: https://ampcode.com/threads/T-019c322b-a3a8-71b7-9962-d44573ca6352
* fix: un-mark batch_size and webcam width/height as advanced (should stay basic)
Amp-Thread-ID: https://ampcode.com/threads/T-019c3236-1417-74aa-82a3-bcb365fbe9d1
---------
Co-authored-by: Jedrzej Kosinski <kosinkadink1@gmail.com>
2026-02-19 19:20:02 -08:00
io . Boolean . Input ( " case_insensitive " , default = True , advanced = True ) ,
io . Boolean . Input ( " multiline " , default = False , advanced = True ) ,
io . Boolean . Input ( " dotall " , default = False , advanced = True ) ,
2025-08-22 05:03:57 +03:00
] ,
outputs = [
io . Boolean . Output ( display_name = " matches " ) ,
]
)
@classmethod
def execute ( cls , string , regex_pattern , case_insensitive , multiline , dotall ) :
2025-05-12 16:29:32 -04:00
flags = 0
if case_insensitive :
flags | = re . IGNORECASE
if multiline :
flags | = re . MULTILINE
if dotall :
flags | = re . DOTALL
try :
match = re . search ( regex_pattern , string , flags )
result = match is not None
except re . error :
result = False
2025-08-22 05:03:57 +03:00
return io . NodeOutput ( result )
2025-05-12 16:29:32 -04:00
2025-08-22 05:03:57 +03:00
class RegexExtract ( io . ComfyNode ) :
@classmethod
def define_schema ( cls ) :
return io . Schema (
node_id = " RegexExtract " ,
2026-05-05 22:31:24 +08:00
search_aliases = [ " regex extract " , " regex " , " pattern extract " , " text parser " , " parse text " ] ,
display_name = " Extract Text " ,
category = " text " ,
2025-08-22 05:03:57 +03:00
inputs = [
io . String . Input ( " string " , multiline = True ) ,
io . String . Input ( " regex_pattern " , multiline = True ) ,
io . Combo . Input ( " mode " , options = [ " First Match " , " All Matches " , " First Group " , " All Groups " ] ) ,
feat: mark 429 widgets as advanced for collapsible UI (#12197)
* feat: mark 429 widgets as advanced for collapsible UI
Mark widgets as advanced across core, comfy_extras, and comfy_api_nodes
to support the new collapsible advanced inputs section in the frontend.
Changes:
- 267 advanced markers in comfy_extras/
- 162 advanced markers in comfy_api_nodes/
- All files pass python3 -m py_compile verification
Widgets marked advanced (hidden by default):
- Scheduler internals: sigma_max, sigma_min, rho, mu, beta, alpha
- Sampler internals: eta, s_noise, order, rtol, atol, h_init, pcoeff, etc.
- Memory optimization: tile_size, overlap, temporal_size, temporal_overlap
- Pipeline controls: add_noise, start_at_step, end_at_step
- Timing controls: start_percent, end_percent
- Layer selection: stop_at_clip_layer, layers, block_number
- Video encoding: codec, crf, format
- Device/dtype: device, noise_device, dtype, weight_dtype
Widgets kept basic (always visible):
- Core params: strength, steps, cfg, denoise, seed, width, height
- Model selectors: ckpt_name, lora_name, vae_name, sampler_name
- Common controls: upscale_method, crop, batch_size, fps, opacity
Related: frontend PR #11939
Amp-Thread-ID: https://ampcode.com/threads/T-019c1734-6b61-702e-b333-f02c399963fc
* fix: remove advanced=True from DynamicCombo.Input (unsupported)
Amp-Thread-ID: https://ampcode.com/threads/T-019c1734-6b61-702e-b333-f02c399963fc
* fix: address review - un-mark model merge, video, image, and training node widgets as advanced
Per comfyanonymous review:
- Model merge arguments should not be advanced (all 14 model-specific merge classes)
- SaveAnimatedWEBP lossless/quality/method should not be advanced
- SaveWEBM/SaveVideo codec/crf/format should not be advanced
- TrainLoraNode options should not be advanced (7 inputs)
Amp-Thread-ID: https://ampcode.com/threads/T-019c322b-a3a8-71b7-9962-d44573ca6352
* fix: un-mark batch_size and webcam width/height as advanced (should stay basic)
Amp-Thread-ID: https://ampcode.com/threads/T-019c3236-1417-74aa-82a3-bcb365fbe9d1
---------
Co-authored-by: Jedrzej Kosinski <kosinkadink1@gmail.com>
2026-02-19 19:20:02 -08:00
io . Boolean . Input ( " case_insensitive " , default = True , advanced = True ) ,
io . Boolean . Input ( " multiline " , default = False , advanced = True ) ,
io . Boolean . Input ( " dotall " , default = False , advanced = True ) ,
io . Int . Input ( " group_index " , default = 1 , min = 0 , max = 100 , advanced = True ) ,
2025-08-22 05:03:57 +03:00
] ,
outputs = [
io . String . Output ( ) ,
]
)
2025-05-12 16:29:32 -04:00
@classmethod
2025-08-22 05:03:57 +03:00
def execute ( cls , string , regex_pattern , mode , case_insensitive , multiline , dotall , group_index ) :
2025-05-12 16:29:32 -04:00
join_delimiter = " \n "
flags = 0
if case_insensitive :
flags | = re . IGNORECASE
if multiline :
flags | = re . MULTILINE
if dotall :
flags | = re . DOTALL
try :
if mode == " First Match " :
match = re . search ( regex_pattern , string , flags )
if match :
result = match . group ( 0 )
else :
result = " "
elif mode == " All Matches " :
matches = re . findall ( regex_pattern , string , flags )
if matches :
if isinstance ( matches [ 0 ] , tuple ) :
result = join_delimiter . join ( [ m [ 0 ] for m in matches ] )
else :
result = join_delimiter . join ( matches )
else :
result = " "
elif mode == " First Group " :
match = re . search ( regex_pattern , string , flags )
if match and len ( match . groups ( ) ) > = group_index :
result = match . group ( group_index )
else :
result = " "
elif mode == " All Groups " :
matches = re . finditer ( regex_pattern , string , flags )
results = [ ]
for match in matches :
if match . groups ( ) and len ( match . groups ( ) ) > = group_index :
results . append ( match . group ( group_index ) )
result = join_delimiter . join ( results )
else :
result = " "
except re . error :
result = " "
2025-08-22 05:03:57 +03:00
return io . NodeOutput ( result )
2025-05-12 16:29:32 -04:00
2025-08-22 05:03:57 +03:00
class RegexReplace ( io . ComfyNode ) :
@classmethod
def define_schema ( cls ) :
return io . Schema (
node_id = " RegexReplace " ,
2026-05-05 22:31:24 +08:00
search_aliases = [ " regex replace " , " regex " , " pattern replace " , " substitution " ] ,
display_name = " Replace Text (Regex) " ,
category = " text " ,
2025-08-22 05:03:57 +03:00
description = " Find and replace text using regex patterns. " ,
inputs = [
io . String . Input ( " string " , multiline = True ) ,
io . String . Input ( " regex_pattern " , multiline = True ) ,
io . String . Input ( " replace " , multiline = True ) ,
feat: mark 429 widgets as advanced for collapsible UI (#12197)
* feat: mark 429 widgets as advanced for collapsible UI
Mark widgets as advanced across core, comfy_extras, and comfy_api_nodes
to support the new collapsible advanced inputs section in the frontend.
Changes:
- 267 advanced markers in comfy_extras/
- 162 advanced markers in comfy_api_nodes/
- All files pass python3 -m py_compile verification
Widgets marked advanced (hidden by default):
- Scheduler internals: sigma_max, sigma_min, rho, mu, beta, alpha
- Sampler internals: eta, s_noise, order, rtol, atol, h_init, pcoeff, etc.
- Memory optimization: tile_size, overlap, temporal_size, temporal_overlap
- Pipeline controls: add_noise, start_at_step, end_at_step
- Timing controls: start_percent, end_percent
- Layer selection: stop_at_clip_layer, layers, block_number
- Video encoding: codec, crf, format
- Device/dtype: device, noise_device, dtype, weight_dtype
Widgets kept basic (always visible):
- Core params: strength, steps, cfg, denoise, seed, width, height
- Model selectors: ckpt_name, lora_name, vae_name, sampler_name
- Common controls: upscale_method, crop, batch_size, fps, opacity
Related: frontend PR #11939
Amp-Thread-ID: https://ampcode.com/threads/T-019c1734-6b61-702e-b333-f02c399963fc
* fix: remove advanced=True from DynamicCombo.Input (unsupported)
Amp-Thread-ID: https://ampcode.com/threads/T-019c1734-6b61-702e-b333-f02c399963fc
* fix: address review - un-mark model merge, video, image, and training node widgets as advanced
Per comfyanonymous review:
- Model merge arguments should not be advanced (all 14 model-specific merge classes)
- SaveAnimatedWEBP lossless/quality/method should not be advanced
- SaveWEBM/SaveVideo codec/crf/format should not be advanced
- TrainLoraNode options should not be advanced (7 inputs)
Amp-Thread-ID: https://ampcode.com/threads/T-019c322b-a3a8-71b7-9962-d44573ca6352
* fix: un-mark batch_size and webcam width/height as advanced (should stay basic)
Amp-Thread-ID: https://ampcode.com/threads/T-019c3236-1417-74aa-82a3-bcb365fbe9d1
---------
Co-authored-by: Jedrzej Kosinski <kosinkadink1@gmail.com>
2026-02-19 19:20:02 -08:00
io . Boolean . Input ( " case_insensitive " , default = True , optional = True , advanced = True ) ,
io . Boolean . Input ( " multiline " , default = False , optional = True , advanced = True ) ,
io . Boolean . Input ( " dotall " , default = False , optional = True , advanced = True , tooltip = " When enabled, the dot (.) character will match any character including newline characters. When disabled, dots won ' t match newlines. " ) ,
io . Int . Input ( " count " , default = 0 , min = 0 , max = 100 , optional = True , advanced = True , tooltip = " Maximum number of replacements to make. Set to 0 to replace all occurrences (default). Set to 1 to replace only the first match, 2 for the first two matches, etc. " ) ,
2025-08-22 05:03:57 +03:00
] ,
outputs = [
io . String . Output ( ) ,
]
)
2025-05-31 03:08:59 +08:00
@classmethod
2025-08-22 05:03:57 +03:00
def execute ( cls , string , regex_pattern , replace , case_insensitive = True , multiline = False , dotall = False , count = 0 ) :
2025-05-31 03:08:59 +08:00
flags = 0
if case_insensitive :
flags | = re . IGNORECASE
if multiline :
flags | = re . MULTILINE
if dotall :
flags | = re . DOTALL
result = re . sub ( regex_pattern , replace , string , count = count , flags = flags )
2025-08-22 05:03:57 +03:00
return io . NodeOutput ( result )
2026-04-16 21:20:16 -07:00
class JsonExtractString ( io . ComfyNode ) :
@classmethod
def define_schema ( cls ) :
return io . Schema (
node_id = " JsonExtractString " ,
2026-05-05 22:31:24 +08:00
display_name = " Extract Text from JSON " ,
category = " text " ,
2026-04-16 21:20:16 -07:00
search_aliases = [ " json " , " extract json " , " parse json " , " json value " , " read json " ] ,
inputs = [
io . String . Input ( " json_string " , multiline = True ) ,
io . String . Input ( " key " , multiline = False ) ,
] ,
outputs = [
io . String . Output ( ) ,
]
)
@classmethod
def execute ( cls , json_string , key ) :
try :
data = json . loads ( json_string )
if isinstance ( data , dict ) and key in data :
value = data [ key ]
if value is None :
return io . NodeOutput ( " " )
return io . NodeOutput ( str ( value ) )
return io . NodeOutput ( " " )
except ( json . JSONDecodeError , TypeError ) :
return io . NodeOutput ( " " )
2026-06-25 10:34:09 -04:00
def _dump_json ( value , indent ) :
return json . dumps ( value , ensure_ascii = False , indent = indent or None )
class ConvertDictionaryToString ( io . ComfyNode ) :
@classmethod
def define_schema ( cls ) :
return io . Schema (
node_id = " ConvertDictionaryToString " ,
display_name = " Convert Dictionary to String " ,
category = " text " ,
search_aliases = [ " json " , " dict to json " , " stringify " , " serialize " , " dict to string " ] ,
inputs = [
io . Dict . Input ( " dictionary " ) ,
io . Int . Input ( " indent " , default = 2 , min = 0 , max = 8 ,
tooltip = " Spaces per indent level. 0 produces compact single-line string. " ) ,
] ,
outputs = [
io . String . Output ( ) ,
] ,
)
@classmethod
def execute ( cls , dictionary , indent = 2 ) :
return io . NodeOutput ( _dump_json ( dictionary , indent ) )
class ConvertArrayToString ( io . ComfyNode ) :
@classmethod
def define_schema ( cls ) :
return io . Schema (
node_id = " ConvertArrayToString " ,
display_name = " Convert Array to String " ,
category = " text " ,
search_aliases = [ " json " , " list to json " , " stringify " , " serialize " , " list to string " , " array to json " ] ,
inputs = [
io . Array . Input ( " array " ) ,
io . Int . Input ( " indent " , default = 2 , min = 0 , max = 8 ,
tooltip = " Spaces per indent level. 0 produces compact single-line string. " ) ,
] ,
outputs = [
io . String . Output ( ) ,
] ,
)
@classmethod
def execute ( cls , array , indent = 2 ) :
return io . NodeOutput ( _dump_json ( array , indent ) )
2025-08-22 05:03:57 +03:00
class StringExtension ( ComfyExtension ) :
@override
async def get_node_list ( self ) - > list [ type [ io . ComfyNode ] ] :
return [
2026-05-19 19:25:49 -07:00
StringFormat ,
2025-08-22 05:03:57 +03:00
StringConcatenate ,
StringSubstring ,
StringLength ,
CaseConverter ,
StringTrim ,
StringReplace ,
StringContains ,
StringCompare ,
RegexMatch ,
RegexExtract ,
RegexReplace ,
2026-04-16 21:20:16 -07:00
JsonExtractString ,
2026-06-25 10:34:09 -04:00
ConvertDictionaryToString ,
ConvertArrayToString ,
2025-08-22 05:03:57 +03:00
]
async def comfy_entrypoint ( ) - > StringExtension :
return StringExtension ( )