Nodes/ComfyUI-Qwen2/Qwen2 Run Inference
ComfyUI Node

Qwen2 Run Inference

A ComfyUI node in Qwen2 with 13 inputs and 2 outputs.

By ARZUMATA·Created 2 years ago·Updated about a year ago· 1
Qwen2 Run Inference
  • image
  • qwen2_model
  • image
  • caption
text_inputDescribe this image in great detail in one paragraph.
keep_model_loadedfalse
always_generate_captionsfalse
max_new_tokens512
temperature0.7
top_p0.9
min_p0.0
top_k0
repetition_penalty1.0
min_pixels256
max_pixels1280
CategoryQwen2

Inputs (13)

NameTypeDefaultDescription
imageIMAGE
qwen2_modelQWEN2MODEL
text_inputSTRINGDescribe this image in great detail in one paragraph.
keep_model_loadedoptBOOLEANfalse
always_generate_captionsoptBOOLEANfalse
max_new_tokensoptINT5121–1000000Max New Tokens maximum length of the newly generated generated text.If explicitly set to None it will be the model's max context length minus input length.
temperatureoptFLOAT0.70–2This setting influences the variety in the model's responses. Lower values lead to more predictable and typical responses, while higher values encourage more diverse and less common responses. At 0, the model always gives the same response for a given input.
top_poptFLOAT0.90–1This setting limits the model's choices to a percentage of likely tokens: only the top tokens whose probabilities add up to P. A lower value makes the model's responses more predictable, while the default setting allows for a full range of token choices. Think of it like a dynamic Top-K.
min_poptFLOAT0.00–1Represents the minimum probability for a token to be considered, relative to the probability of the most likely token. (The value changes depending on the confidence level of the most probable token.) If your Min-P is set to 0.1, that means it will only allow for tokens that are at least 1/10th as probable as the best possible option.
top_koptINT00–2048This limits the model's choice of tokens at each step, making it choose from a smaller set. A value of 1 means the model will always pick the most likely next token, leading to predictable results. By default this setting is disabled, making the model to consider all choices.
repetition_penaltyoptFLOAT1.00.1–5Helps to reduce the repetition of tokens from the input. A higher value makes the model less likely to repeat tokens, but too high a value can make the output less coherent (often with run-on sentences that lack small words). Token penalty scales based on original token's probability.
min_pixelsoptINT2564–1280Images will be resized to maintain their aspect ratio within the range of min_pixels and max_pixels
max_pixelsoptINT12804–16384Images will be resized to maintain their aspect ratio within the range of min_pixels and max_pixels

Outputs (2)

NameTypeDescription
imageIMAGE
captionSTRING