KJNodes/textgenerated

Superprompt

This node is based on the `roborovski/superprompt-v1` model, which is a T5 model fine-tuned on the SuperPrompt dataset.

Superprompt

STRING
instruction_prompt
Expand the following prompt to add more detail
prompt
STRING
max_new_tokens
128
KJNodes

The Superprompt node is based on the roborovski/superprompt-v1 model, which is a T5 model fine-tuned on the SuperPrompt dataset.

The SuperPrompt node is a text enhancement tool that can automatically expand short, simple text prompts into more detailed and descriptive versions. Its core function is to utilize a fine-tuned T5 language model to provide richer input descriptions for subsequent text-to-image generation tasks.

Node Functionality

This node is based on the roborovski/superprompt-v1 model, a T5 model fine-tuned on the SuperPrompt dataset. It receives a base prompt and an instruction prompt, combines them, and feeds them into the model. The model then generates a more detailed text output of the specified length based on the instruction. On first use, the node will automatically download the required model files from Hugging Face.

Node Parameter Description - Superprompt

Control Parameters (Parameters)

Parameter NameData TypeRequiredDefault ValueRange/OptionsDescription
instruction_promptSTRINGYesExpand the following prompt to add more detail-The instruction text guiding the model on how to expand the prompt. The default instruction is "Expand the following prompt to add more detail".
promptSTRINGYes--The original text prompt that needs to be expanded and enhanced. This parameter typically receives text input from other nodes.
max_new_tokensINTYes1281 - 4096 (Step: 1)Controls the maximum length of new text generated by the model. The valid range is 1 to 4096, with a step size of 1.

Output

Parameter NameData TypeDescription
STRINGSTRINGThe expanded and enhanced detailed text prompt.

Usage Scenarios

In a typical AI image generation workflow, you can input a short, initial prompt (e.g., "a cat") into this node. It will output a more detailed description (e.g., "a fluffy orange cat lazily lying on a windowsill in the sunlight"). This enhanced prompt can be directly connected to the prompt input port of a text-to-image model to generate images with richer details that better match expectations.

Notes

Please note that the level of detail and quality of the generated text is influenced by the max_new_tokens parameter and the input prompt itself. Excessively long generation may lead to redundant or incoherent content. This node requires an internet connection to download the model, and the generation process consumes computational resources.

The Superprompt node is from the ComfyUI-KJNodes node package.

Comments

Sign in with GitHub to join the discussion.

Loading comments…