ComfyUI > Nodes > Comfyui-QwenPromptRewriter > Qwen Prompt Rewriter

ComfyUI Node: Qwen Prompt Rewriter

Class Name

QwenPromptRewriter

Category
qwenimage/prompt
Author
lihaoyun6 (Account age: 3650days)
Extension
Comfyui-QwenPromptRewriter
Latest Updated
2025-10-07
Github Stars
0.07K

How to Install Comfyui-QwenPromptRewriter

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

Qwen Prompt Rewriter Description

Enhance and refine text prompts for AI image generation with advanced language models for improved output quality.

Qwen Prompt Rewriter:

QwenPromptRewriter is a specialized node designed to enhance and refine text prompts for AI-driven image generation tasks. Its primary function is to polish and rewrite prompts to better align with the desired style and output quality, leveraging advanced language models. This node is particularly beneficial for artists and creators who wish to optimize their prompts for more accurate and aesthetically pleasing results. By utilizing the QwenPromptRewriter, you can ensure that your prompts are not only syntactically correct but also semantically rich, thereby improving the overall quality of the generated images. The node integrates seamlessly with other components, allowing for a smooth workflow in creative projects.

Qwen Prompt Rewriter Input Parameters:

prompt

The prompt parameter is the initial text input that you wish to refine or rewrite. It serves as the foundation for the node's operations, and its content directly influences the quality and style of the output. There are no strict minimum or maximum values for this parameter, but it should be a coherent and contextually relevant sentence or phrase to achieve the best results.

prompt_style

The prompt_style parameter determines the stylistic approach the node will take when rewriting the prompt. It can significantly impact the tone and structure of the output, allowing you to tailor the prompt to specific artistic or thematic requirements. Common options include "Qwen-Image" for image-focused prompts, among others.

llm_model

The llm_model parameter specifies the language model to be used for rewriting the prompt. This choice affects the sophistication and depth of the language processing, with different models offering varying levels of complexity and nuance. Selecting the appropriate model is crucial for achieving the desired prompt refinement.

max_retries

The max_retries parameter sets the number of attempts the node will make to successfully rewrite the prompt. This is useful in scenarios where network issues or model limitations might cause initial attempts to fail. A higher number of retries can increase the likelihood of success but may also extend processing time.

API_KEY

The API_KEY parameter is a security credential required to access the language model's API. It ensures that only authorized users can utilize the node's capabilities. This key must be valid and correctly configured for the node to function properly.

save_tokens

The save_tokens parameter indicates whether the tokens generated during the prompt rewriting process should be saved. This can be useful for debugging or for further analysis of the prompt transformation process. It is typically a boolean value, with options to enable or disable token saving.

skip_rewrite

The skip_rewrite parameter allows you to bypass the rewriting process entirely, returning the original prompt as is. This can be useful if you want to test other parts of your workflow without altering the prompt. It is a boolean value, with the default setting usually being false.

Qwen Prompt Rewriter Output Parameters:

conditioning

The conditioning output parameter represents the encoded version of the rewritten prompt, ready for use in subsequent image generation processes. It encapsulates the semantic and stylistic adjustments made by the node, ensuring that the prompt is optimized for the desired output.

conditioningN

The conditioningN output parameter is similar to conditioning but is specifically tailored for negative prompts. It provides an encoded version of prompts that are intended to guide the model away from certain styles or content, offering greater control over the final image.

samples

The samples output parameter contains the latent representations of the images associated with the prompt. These samples are crucial for understanding how the prompt influences the generated images and can be used for further refinement or analysis.

Qwen Prompt Rewriter Usage Tips:

  • Ensure that your API_KEY is correctly configured and valid to avoid interruptions in the prompt rewriting process.
  • Experiment with different prompt_style options to find the one that best suits your artistic vision and the specific requirements of your project.
  • Use the max_retries parameter to handle potential network or model-related issues, ensuring that your prompt is successfully rewritten.

Qwen Prompt Rewriter Common Errors and Solutions:

'API_KEY' is not set! Enter your Aliyun api_key in "API_KEY".

  • Explanation: This error occurs when the API key required for accessing the language model is missing or incorrectly configured.
  • Solution: Ensure that you have entered a valid API key in the API_KEY parameter. You can also save it to the specified file path for easier access.

'{key_path}' is not exit!

  • Explanation: This error indicates that the file path specified for storing the API key does not exist.
  • Solution: Verify that the file path is correct and that the file exists. If not, create the file and ensure it contains the correct API key.

Qwen Prompt Rewriter Related Nodes

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