ComfyUI > Nodes > ComfyUI > Generate Text

ComfyUI Node: Generate Text

Class Name

TextGenerate

Category
text
Author
ComfyAnonymous (Account age: 763days)
Extension
ComfyUI
Latest Updated
2026-05-13
Github Stars
112.77K

How to Install ComfyUI

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

Generate Text Description

AI text generation node for creating coherent and contextually relevant text using advanced language models.

Generate Text:

The TextGenerate node is designed to facilitate the creation of text using advanced language models. It serves as a powerful tool for generating coherent and contextually relevant text based on a given prompt. This node is particularly beneficial for AI artists and creators who wish to leverage AI-driven text generation in their projects. By integrating various input types such as text prompts, images, videos, and audio, the node can produce text that is not only relevant to the input data but also creatively expansive. The node's ability to handle dynamic prompts and its support for different sampling modes make it versatile for a wide range of applications, from storytelling to content creation.

Generate Text Input Parameters:

clip

The clip parameter is essential for tokenizing the input prompt and any associated media. It acts as the backbone for processing the input data, ensuring that the text generation is aligned with the provided context.

prompt

The prompt parameter is a multiline text input that serves as the primary source of inspiration for the text generation process. It allows for dynamic prompts, enabling users to input complex and varied text scenarios. The default value is an empty string, allowing for flexibility in input.

image

The image parameter is an optional input that allows users to include an image as part of the context for text generation. This can enhance the relevance and creativity of the generated text by providing visual context.

video

The video parameter is an optional input that accepts video frames as an image batch. It assumes a frame rate of 24 FPS and internally subsamples to 1 FPS. This parameter is useful for generating text that is contextually aware of video content.

audio

The audio parameter is an optional input that allows users to include audio data as part of the context. This can be particularly useful for generating text that is influenced by audio cues or themes.

max_length

The max_length parameter defines the maximum number of tokens for the generated text. It has a default value of 256, with a minimum of 1 and a maximum of 2048. This parameter controls the length of the output text, allowing users to tailor the verbosity of the generated content.

sampling_mode

The sampling_mode parameter is a dynamic combo input that offers various options for sampling during text generation. It includes settings such as temperature, top-k, and top-p, which influence the randomness and creativity of the generated text. Users can select the mode that best suits their creative needs.

thinking

The thinking parameter is an optional boolean input that, when enabled, allows the model to operate in a "thinking mode" if supported. This can enhance the depth and complexity of the generated text, making it more reflective and nuanced.

use_default_template

The use_default_template parameter is an optional boolean input that, when enabled, uses the built-in system prompt/template if available. This advanced setting can streamline the text generation process by leveraging pre-defined templates for consistency and quality.

Generate Text Output Parameters:

generated_text

The generated_text parameter is the output of the node, providing the text generated based on the input parameters. This output is the culmination of the node's processing, offering a coherent and contextually relevant text that can be used in various creative applications.

Generate Text Usage Tips:

  • Experiment with different sampling_mode settings to achieve the desired level of creativity and randomness in your text generation. Adjusting parameters like temperature and top-k can significantly impact the style and tone of the output.
  • Utilize the image, video, and audio inputs to provide rich context for the text generation. This can lead to more engaging and contextually aware text outputs that align with multimedia content.
  • Consider using the thinking mode for projects that require deeper and more reflective text generation. This can be particularly useful for narrative-driven content where depth and nuance are important.

Generate Text Common Errors and Solutions:

"Invalid token length"

  • Explanation: This error occurs when the max_length parameter is set to a value outside the allowed range.
  • Solution: Ensure that the max_length is set between 1 and 2048 to avoid this error.

"Unsupported media type"

  • Explanation: This error arises when an unsupported media type is provided in the image, video, or audio inputs.
  • Solution: Verify that the media types used are supported by the node and are correctly formatted.

"Sampling mode configuration error"

  • Explanation: This error indicates an issue with the configuration of the sampling_mode parameter.
  • Solution: Double-check the settings for sampling_mode, ensuring that all required options are correctly specified and valid.

Generate Text Related Nodes

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

Generate Text