ComfyUI > Nodes > comfyui-adaptiveprompts > Prompt Alias Swap 📚

ComfyUI Node: Prompt Alias Swap 📚

Class Name

PromptAliasSwap

Category
adaptiveprompts/generation
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 Alias Swap 📚 Description

Enhance creative prompts by dynamically swapping tags with aliases for AI artists seeking variability and creativity.

Prompt Alias Swap 📚:

The PromptAliasSwap node is designed to enhance your creative process by dynamically swapping specific tags or tokens in your input prompts with aliases from predefined groups. This node is particularly useful for AI artists who want to introduce variability and creativity into their prompts without manually editing each one. By leveraging alias groups, the node ensures that your prompts remain fresh and diverse, while preserving the original structure and non-tag elements such as punctuation, whitespace, and weights. The node operates by identifying candidate tokens based on specific rules and replacing them with alternatives from the alias group, which can be refreshed live if needed. This functionality allows for a seamless integration of variability into your creative workflow, making it an invaluable tool for generating unique and adaptive prompts.

Prompt Alias Swap 📚 Input Parameters:

string

This parameter represents the input prompt that you want to process. It is a multiline string, allowing you to input complex prompts that may span multiple lines. The node will analyze this string to identify and swap tags based on the alias groups.

seed

The seed parameter is an integer that influences the randomness of the alias swapping process. By setting a specific seed, you can ensure consistent results across multiple runs. The default value is 0, with a minimum of 0 and a maximum of 2,147,483,647.

alias_file

This parameter allows you to select a .txt file containing alias groups from the tag_alias folder. The default file is tags.txt. This file dictates which aliases are available for swapping, and it is crucial for defining the variability in your prompts. Note that .csv format is not supported.

mode

The mode parameter determines the behavior of the alias swapping process. It offers two options: "ALWAYS" and "RANDOM". In "ALWAYS" mode, the node will always swap to a different alias from the same group, ensuring variability. In "RANDOM" mode, the node may re-select the same alias, meaning the tag might remain unchanged. The default setting is "ALWAYS".

chance

This parameter defines the probability that a tag will be swapped. It is a float value ranging from 0.0 to 1.0, with a default of 1.0. A higher value increases the likelihood of a swap occurring, while a lower value reduces it, allowing for controlled variability in your prompts.

refresh_file

The refresh_file parameter is a boolean that determines whether the alias file should be re-read and the cache refreshed. If set to True, the node will update its alias groups based on the latest file contents, ensuring that any changes to the alias file are reflected in the swapping process. The default value is False.

Prompt Alias Swap 📚 Output Parameters:

Aliased String

The output of the PromptAliasSwap node is a single string, referred to as the "Aliased String". This string is the result of processing the input prompt with the alias swapping logic. It retains the original structure and non-tag elements of the input while incorporating the variability introduced by the alias groups. This output is crucial for generating diverse and adaptive prompts that can inspire new creative directions.

Prompt Alias Swap 📚 Usage Tips:

  • To ensure consistent results across different runs, use a specific seed value. This is particularly useful when you want to reproduce a specific set of alias swaps.
  • Experiment with the chance parameter to control the level of variability in your prompts. A lower chance value can be useful when you want to maintain more of the original prompt structure.
  • Regularly update your alias files to introduce new creative possibilities and keep your prompts fresh and engaging.

Prompt Alias Swap 📚 Common Errors and Solutions:

Alias file not found

  • Explanation: This error occurs when the specified alias file cannot be located in the tag_alias folder.
  • Solution: Ensure that the alias file exists in the correct directory and that the file name is spelled correctly. If necessary, create a new alias file and place it in the tag_alias folder.

Invalid alias file format

  • Explanation: The node expects alias files to be in .txt format, and any deviation from this can cause errors.
  • Solution: Verify that your alias file is in the correct .txt format and does not contain unsupported characters or structures. Avoid using .csv or other formats.

Cache not updated

  • Explanation: If the refresh_file parameter is set to False, changes to the alias file may not be reflected in the swapping process.
  • Solution: Set the refresh_file parameter to True to ensure that the node reads the latest version of the alias file and updates the cache accordingly.

Prompt Alias Swap 📚 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.