ComfyUI  >  Nodes  >  KJNodes for ComfyUI >  Superprompt

ComfyUI Node: Superprompt

Class Name

Superprompt

Category
KJNodes/text
Author
kijai (Account age: 2192 days)
Extension
KJNodes for ComfyUI
Latest Updated
6/25/2024
Github Stars
0.3K

How to Install KJNodes for ComfyUI

Install this extension via the ComfyUI Manager by searching for  KJNodes for ComfyUI
  • 1. Click the Manager button in the main menu
  • 2. Select Custom Nodes Manager button
  • 3. Enter KJNodes for ComfyUI 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

Superprompt Description

Enhances text prompts with detailed descriptions using a T5 model for improved text-to-image model pre-generation.

Superprompt:

Superprompt is a node designed to enhance text prompts by expanding them into more detailed descriptions. It leverages a T5 model fine-tuned on the SuperPrompt dataset to upsample text prompts, making them richer and more descriptive. This node is particularly useful as a pre-generation step for text-to-image models, which often benefit from more detailed and nuanced prompts. By providing a more elaborate prompt, Superprompt helps in generating higher quality and more accurate images. The model used is available at https://huggingface.co/roborovski/superprompt-v1.

Superprompt Input Parameters:

instruction_prompt

This parameter is a string that provides the initial instruction for expanding the prompt. It sets the context for how the prompt should be elaborated. The default value is Expand the following prompt to add more detail, and it supports multiline input. This parameter is crucial as it guides the model on how to transform the given prompt into a more detailed description.

prompt

This is the main text prompt that you want to expand. It is a required string input and supports multiline text. The prompt serves as the base text that the model will elaborate on, adding more details and nuances as specified by the instruction_prompt. This parameter must be provided for the node to function.

max_new_tokens

This integer parameter specifies the maximum number of new tokens that the model can generate. It controls the length of the expanded prompt. The default value is 128, with a minimum of 1 and a maximum of 4096. Adjusting this parameter allows you to control the verbosity of the output, with higher values resulting in more detailed descriptions.

Superprompt Output Parameters:

STRING

The output is a single string that contains the expanded and more detailed version of the input prompt. This enhanced prompt can then be used in subsequent text-to-image generation models to produce higher quality and more accurate images. The output string is cleaned to remove any padding or end-of-sequence tokens, ensuring it is ready for immediate use.

Superprompt Usage Tips:

  • Use a clear and specific instruction_prompt to guide the model on how to expand the prompt. For example, if you want a more descriptive scene, you might use Describe the following scene in detail.
  • Adjust the max_new_tokens parameter based on the level of detail you need. For more complex and detailed prompts, increase the value, but be mindful of the maximum limit.
  • Ensure your initial prompt is concise but informative. The quality of the expanded prompt depends on the clarity and specificity of the input prompt.

Superprompt Common Errors and Solutions:

Cannot execute because a node is missing the class_type property.

  • Explanation: This error occurs when a node in the prompt is missing the class_type property, which is essential for execution.
  • Solution: Ensure that all nodes in your prompt have the class_type property defined. Check your prompt configuration and add the missing property where necessary.

Cannot execute because node <class_type> does not exist.

  • Explanation: This error indicates that a node specified in the prompt does not exist in the node class mappings.
  • Solution: Verify that all nodes referenced in your prompt are correctly defined and exist in the node class mappings. Correct any typos or missing nodes in your configuration.

Prompt has no outputs

  • Explanation: This error means that the prompt does not produce any outputs, which is required for execution.
  • Solution: Ensure that your prompt configuration includes nodes that generate outputs. Review the prompt setup and add necessary output-generating nodes.

Failed to validate prompt for output <output_id>

  • Explanation: This error occurs when the prompt validation fails for a specific output.
  • Solution: Check the validation reasons provided in the error message. Address any issues in the prompt configuration that are causing the validation to fail, such as missing or incorrect parameters.

Superprompt Related Nodes

Go back to the extension to check out more related nodes.
KJNodes for ComfyUI
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.