ComfyUI > Nodes > comfyui-adaptiveprompts > Prompt Splitter ✂️

ComfyUI Node: Prompt Splitter ✂️

Class Name

PromptSplitter

Category
adaptiveprompts/processing
Author
Alectriciti (Account age: 5005days)
Extension
comfyui-adaptiveprompts
Latest Updated
2025-11-05
Github Stars
0.05K

How to Install comfyui-adaptiveprompts

Install this extension via the ComfyUI Manager by searching for comfyui-adaptiveprompts
  • 1. Click the Manager button in the main menu
  • 2. Select Custom Nodes Manager button
  • 3. Enter comfyui-adaptiveprompts in the search bar
After installation, click the Restart button to restart ComfyUI. Then, manually refresh your browser to clear the cache and access the updated list of nodes.

Visit ComfyUI Online for ready-to-use ComfyUI environment

  • Free trial available
  • 16GB VRAM to 80GB VRAM GPU machines
  • 400+ preloaded models/nodes
  • Freedom to upload custom models/nodes
  • 200+ ready-to-run workflows
  • 100% private workspace with up to 200GB storage
  • Dedicated Support

Run ComfyUI Online

Prompt Splitter ✂️ Description

Versatile prompt string manipulation node for ComfyUI, enabling trimming and retention based on probabilistic and deterministic strategies.

Prompt Splitter ✂️:

The PromptSplitter is a versatile node designed for ComfyUI that allows you to manipulate prompt strings by trimming or retaining specific sections based on various probabilistic and deterministic strategies. This node is particularly useful for AI artists who want to experiment with different parts of a prompt to see how it affects the output of their AI models. By using this node, you can control which parts of a prompt are kept or removed, providing a powerful tool for refining and optimizing your creative process. The PromptSplitter can handle prompts in a flexible manner, allowing you to protect certain sections from being trimmed and to apply different strategies for section removal, such as random or position-based trimming. This makes it an essential tool for those looking to fine-tune their AI-generated art by experimenting with different prompt configurations.

Prompt Splitter ✂️ Input Parameters:

string

This parameter represents the input prompt string that you want to process. It can be a multiline string, allowing you to work with complex prompts that span multiple lines. The string parameter is the core input that the node will split and manipulate based on the other parameters.

quantity

The quantity parameter determines the number of sections to either keep or remove from the prompt, depending on the quantity_mode. It has a default value of 1, with a minimum of 0 and a maximum of 100. This parameter directly influences how much of the prompt is retained or discarded, allowing you to control the extent of the trimming process.

quantity_mode

This parameter specifies how the quantity is interpreted, with options "REMOVE" and "KEEP". In "REMOVE" mode, the node will remove the specified number of sections based on the selected mode. In "KEEP" mode, the node ensures that the final prompt contains exactly the specified number of sections, trimming the rest. The default setting is "REMOVE", and this parameter is crucial for determining the overall strategy of the prompt manipulation.

keep_first_sections

The keep_first_sections parameter allows you to protect a certain number of sections at the beginning of the prompt from being trimmed. It has a default value of 0, with a minimum of 0 and a maximum of 100. This parameter is useful for ensuring that important introductory sections of your prompt remain intact, regardless of the trimming strategy applied to the rest of the prompt.

mode

This parameter defines the strategy used for selecting which sections to remove. Options include "RANDOM", "RANDOM_GRADUAL", "RANDOM_EXPONENTIAL", "RANDOM_SQRT", "RANDOM_MIDDLE", "TRIM_BEGINNING", and "TRIM_END". Each mode offers a different approach to section removal, from random selection to position-based trimming. The default mode is "RANDOM", and this parameter allows you to experiment with different trimming strategies to achieve the desired effect in your AI-generated art.

delimiter

The delimiter parameter specifies the character or string used to split the prompt into sections. The default delimiter is a comma (,), but you can customize it to suit the structure of your prompt. This parameter is essential for correctly parsing the prompt into manageable sections for processing.

seed

The seed parameter is an integer used for random number generation, ensuring reproducibility of results. It has a default value of 0, with a minimum of 0 and a maximum of 2,147,483,647. A seed value of 0 means a new random seed is used each run, while any other value will produce consistent results across runs. This parameter is important for achieving consistent and repeatable outcomes when using random-based trimming strategies.

Prompt Splitter ✂️ Output Parameters:

Trimmed

The Trimmed output is a string that contains the sections of the prompt that have been retained after processing. This output represents the final version of the prompt that you can use for further AI model input or analysis. It reflects the application of the selected trimming strategy and any protected sections specified by the input parameters.

Scraps

The Scraps output is a string that contains the sections of the prompt that were removed during processing. This output allows you to see which parts of the original prompt were discarded, providing insight into the effects of the trimming strategy and helping you refine your prompt manipulation techniques.

Prompt Splitter ✂️ Usage Tips:

  • Experiment with different mode settings to see how they affect the final prompt. For example, use "RANDOM_MIDDLE" to focus trimming on the middle sections of your prompt.
  • Use the keep_first_sections parameter to protect important introductory sections of your prompt, ensuring they remain intact regardless of the trimming strategy.
  • Set a specific seed value to achieve consistent results across multiple runs, which is useful for comparing the effects of different parameter settings.

Prompt Splitter ✂️ Common Errors and Solutions:

Empty prompt sections

  • Explanation: This error occurs when the prompt string is split into sections, but all sections are empty or whitespace.
  • Solution: Ensure that your prompt string contains valid sections separated by the specified delimiter. Check for any unintended whitespace or empty sections in your input prompt.

Invalid quantity value

  • Explanation: This error arises when the quantity parameter is set to a value that exceeds the number of available sections in the prompt.
  • Solution: Adjust the quantity parameter to a value that is within the range of available sections in your prompt. Consider using the "KEEP" mode to ensure the final prompt has the desired number of sections.

Seed value out of range

  • Explanation: This error occurs when the seed parameter is set to a value outside the allowed range.
  • Solution: Ensure that the seed value is within the valid range of 0 to 2,147,483,647. Adjust the seed value accordingly to avoid this error.

Prompt Splitter ✂️ Related Nodes

Go back to the extension to check out more related nodes.
comfyui-adaptiveprompts
RunComfy
Copyright 2025 RunComfy. All Rights Reserved.

RunComfy is the premier ComfyUI platform, offering ComfyUI online environment and services, along with ComfyUI workflows featuring stunning visuals. RunComfy also provides AI Models, enabling artists to harness the latest AI tools to create incredible art.