Multiline Prompt 📝

MultilinePromptNode

多行提示词节点 - 处理和格式化多行提示词文本 功能特性: • 支持多行提示词输入和输出 • 自动统计并输出总行数 • 多种分隔符选择(换行符、逗号、分号等) • 可选的行号添加功能 • 自动去除空行和首尾空白 • 提供原始文本和格式化文本输出 • 🆕 索引功能:可直接获取指定行的单条数据 分隔符选项: • 换行符: 保持原有的多行格式 • 逗号: 用逗号连接所有行 • 分号: 用分号连接所有行 • 空格: 用空格连接所有行 • 自定义: 使用自定义分隔符 索引功能: • enable_index: 启用后可获取指定行的数据 • line_index: 指定要获取的行号(从0开始) • 支持索引范围检查和错误提示 • 可与其他格式化功能组合使用 输入参数: • prompt_text: 多行提示词文本 • line_separator: 输出分隔符类型 • custom_separator: 自定义分隔符内容 • remove_empty_lines: 是否移除空行 • trim_lines: 是否去除行首尾空白 • add_line_numbers: 是否添加行号 • line_number_format: 行号格式 • enable_index: 是否启用索引功能 • line_index: 要获取的行索引(从0开始) 输出: • formatted_prompt: 格式化后的提示词文本 • total_lines: 总行数(整数) • line_count_info: 行数统计信息(文本) • original_prompt: 原始提示词文本 • indexed_line: 指定索引的行内容 • index_info: 索引操作的详细信息 • lines_combo: 所有行的列表(COMBO类型,可用于下拉选择)

Pack: ZMG PLUGIN

custom_nodes.ComfyUI-ZMG-Nodes

Inputs (9)

NameTypeRequired
prompt_textSTRINGrequired
line_separatorCOMBOrequired
custom_separatorSTRINGrequired
remove_empty_linesBOOLEANrequired
trim_linesBOOLEANrequired
add_line_numbersBOOLEANrequired
line_number_formatCOMBOrequired
enable_indexBOOLEANrequired
line_indexINTrequired

Outputs (7)

NameType
formatted_promptSTRING
total_linesINT
line_count_infoSTRING
original_promptSTRING
indexed_lineSTRING
index_infoSTRING
lines_combo*