Skip to main content
This documentation was AI-generated. If you find any errors or have suggestions for improvement, please feel free to contribute! Edit on GitHub
The TextGenerate node uses a CLIP model to create text based on a user’s prompt. It can optionally use an image as a visual reference to guide the text generation. You can control the length of the output and choose whether to use random sampling with various settings or to generate text without sampling.

Inputs

ParameterData TypeRequiredRangeDescription
clipCLIPYesN/AThe CLIP model used for tokenizing the prompt and generating text.
promptSTRINGYesN/AThe text prompt that guides the generation. This field supports multiple lines and dynamic prompts. The default value is an empty string.
imageIMAGENoN/AAn optional image that can be used alongside the text prompt to influence the generated text.
max_lengthINTYes1 to 2048The maximum number of tokens the model will generate. The default value is 256.
sampling_modeCOMBOYes"on"
"off"
Controls whether random sampling is used during text generation. When set to “on”, additional parameters for controlling the sampling become available. The default is “on”.
temperatureFLOATNo0.01 to 2.0Controls the randomness of the output. Lower values make the output more predictable, higher values make it more creative. This parameter is only available when sampling_mode is “on”. The default value is 0.7.
top_kINTNo0 to 1000Limits the sampling pool to the top K most likely next tokens. A value of 0 disables this filter. This parameter is only available when sampling_mode is “on”. The default value is 64.
top_pFLOATNo0.0 to 1.0Uses nucleus sampling, limiting choices to tokens whose cumulative probability is less than this value. This parameter is only available when sampling_mode is “on”. The default value is 0.95.
min_pFLOATNo0.0 to 1.0Sets a minimum probability threshold for tokens to be considered. This parameter is only available when sampling_mode is “on”. The default value is 0.05.
repetition_penaltyFLOATNo0.0 to 5.0Penalizes tokens that have already been generated to reduce repetition. A value of 1.0 applies no penalty. This parameter is only available when sampling_mode is “on”. The default value is 1.05.
seedINTNo0 to 18446744073709551615A number used to initialize the random number generator for reproducible results when sampling is “on”. The default value is 0.
Note: The parameters temperature, top_k, top_p, min_p, repetition_penalty, and seed are only active and visible in the node interface when the sampling_mode is set to “on”.

Outputs

Output NameData TypeDescription
generated_textSTRINGThe text generated by the model based on the input prompt and optional image.