ComfyUI > Nodes > ComfyUI Impact Pack > Wildcard Prompt from String

ComfyUI Node: Wildcard Prompt from String

Class Name

WildcardPromptFromString

Category
ImpactPack/Util
Author
Dr.Lt.Data (Account age: 458days)
Extension
ComfyUI Impact Pack
Latest Updated
2024-06-19
Github Stars
1.38K

How to Install ComfyUI Impact Pack

Install this extension via the ComfyUI Manager by searching for ComfyUI Impact Pack
  • 1. Click the Manager button in the main menu
  • 2. Select Custom Nodes Manager button
  • 3. Enter ComfyUI Impact Pack 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
  • High-speed GPU machines
  • 200+ preloaded models/nodes
  • Freedom to upload custom models/nodes
  • 50+ ready-to-run workflows
  • 100% private workspace with up to 200GB storage
  • Dedicated Support

Run ComfyUI Online

Wildcard Prompt from String Description

Dynamically generate text prompts using wildcards for creative and varied AI art generation.

Wildcard Prompt from String:

The WildcardPromptFromString node is designed to dynamically generate text prompts by replacing wildcard placeholders within a given string. This node is particularly useful for AI artists who want to create varied and complex prompts without manually crafting each one. By leveraging wildcards, you can introduce randomness and variability into your prompts, making them more creative and less repetitive. The node processes the input string, identifies wildcard patterns, and replaces them with appropriate values based on predefined rules or random selection. This functionality is essential for generating diverse and engaging content, especially in creative fields like AI art generation.

Wildcard Prompt from String Input Parameters:

wildcard_text

This parameter accepts a string containing wildcard placeholders that need to be replaced. The wildcards are identified by double underscores (e.g., __wildcard__). The input string can be multiline, allowing for more complex and detailed prompts. This parameter is crucial as it defines the template that will be dynamically populated.

populated_text

This parameter is another string that will be used in conjunction with the wildcard_text to generate the final output. It can also be multiline and does not support dynamic prompts. This string serves as the base text that will be modified by replacing the wildcards.

mode

This boolean parameter determines the mode of operation. When set to True (Populate), the node will replace the wildcards with actual values. When set to False (Fixed), the wildcards will remain unchanged. The default value is True, making it easier to generate varied prompts without additional configuration.

seed

This integer parameter is used to control the randomness of the wildcard replacement. By setting a specific seed value, you can ensure that the same wildcards are replaced with the same values each time, providing consistency. The default value is 0, and it can range from 0 to 0xffffffffffffffff.

Select to add Wildcard

This parameter provides a list of options for adding specific wildcards to the text. It helps in customizing the prompt by allowing you to select predefined wildcards that can be added to the input string. This feature is useful for quickly incorporating common wildcards without manually typing them.

Wildcard Prompt from String Output Parameters:

STRING

The output is a single string where all the wildcards in the wildcard_text have been replaced according to the specified rules and parameters. This string is the final prompt that can be used for various creative applications, such as AI art generation. The output is designed to be ready for immediate use, saving you time and effort in prompt creation.

Wildcard Prompt from String Usage Tips:

  • Use the seed parameter to control the randomness and ensure consistent results when needed.
  • Experiment with different wildcards to create a wide variety of prompts, enhancing the creativity of your AI-generated art.
  • Utilize the Select to add Wildcard feature to quickly add common wildcards, streamlining the prompt creation process.

Wildcard Prompt from String Common Errors and Solutions:

"Invalid wildcard pattern"

  • Explanation: This error occurs when the input string contains a wildcard pattern that does not match the expected format.
  • Solution: Ensure that all wildcards in the input string are enclosed in double underscores (e.g., __wildcard__).

"Seed value out of range"

  • Explanation: This error is triggered when the seed value provided is outside the acceptable range.
  • Solution: Make sure the seed value is between 0 and 0xffffffffffffffff.

"Empty input string"

  • Explanation: This error occurs when the input string is empty or not provided.
  • Solution: Provide a valid input string containing the wildcards you want to replace.

"Wildcard not found in dictionary"

  • Explanation: This error happens when a wildcard in the input string does not have a corresponding replacement value in the dictionary.
  • Solution: Check the wildcard dictionary to ensure all wildcards in the input string have defined replacement values.

Wildcard Prompt from String Related Nodes

Go back to the extension to check out more related nodes.
ComfyUI Impact Pack
RunComfy

© Copyright 2024 RunComfy. All Rights Reserved.

RunComfy is the premier ComfyUI platform, offering ComfyUI online environment and services, along with ComfyUI workflows featuring stunning visuals.