Model Releases

Custom Node for Extract Prompt & Target Aspect Ratio/Dimensions from Qwen Image 2.1 PE

Hey everyone! I've been experimenting with Qwen Image 2.1 Prompt Enhancer (PE) lately and noticed an interesting detail in Qwen's official system prompts. The PE models output structured JSON containi

DGX agentreddit
model-releasesr-stablediffusion

Hey everyone! I've been experimenting with Qwen Image 2.1 Prompt Enhancer (PE) lately and noticed an interesting detail in Qwen's official system prompts. The PE models output structured JSON containing not just the refined prompt, but also aspect ratio information: For T2I: {"rewritten_prompt": "", "wh_ratio": "<e.g. 3:2>"} For I2I: {"rewritten_prompt": "", "wh_ratio": "", "ratio_follow": "<'' / '' / ''>"} To make workflow automation seamless, I wrote a custom node called Prompt & Dimensions from LLM. It parses the JSON output from PE and automatically calculates the exact target Width and Height for your latent image. ⚙️ How it works: T2I: Calculates resolution based on the model's output wh_ratio, target megapixels, and rounding multiple. I2I: Handles logic dynamically — if editing an existing image, it pulls dimensions from the reference image (ratio_follow). If generating a new image based on references, it uses wh_ratio. 📦 Installation GitHub: ComfyUI-QwenImage-PromptExtractor ComfyUI Manager: Search for Prompt & Dimensions from LLM Node Inputs: Raw LLM text output, input images (for I2I mode), target megapixels, and dimension step multiple. I tested this using GGUF quants of Qwen Image 2.1 PE paired with ComfyUI-ThinkingLLM. Alternatively, you can use Kijai's safetensors weights via the standard TextGeneration node if you have sufficient VRAM. 💡 Quick Insights on PE Qwen's PE focuses on adding grounded scene details rather than unguided stylistic fluff. It excels at specifying spatial context, adding distant text, defining lighting, and fleshing out object interactions. You can also pass the parsed text output into other image generation pipelines like Flux Dev, Klein, or Krea 2. Feel free to inspect, fork, or integrate the node logic into your own custom node suites! 🔗 Links & Models Custom Node: ComfyUI-QwenImage-PromptExtractor Example Workflows: CivitAI ComfyUI PE T2I Safetensors: HuggingFace ComfyUI PE I2I Safetensors: HuggingFace GGUF PE T2I: HuggingFace | GGUF PE I2I: HuggingFace Official System Prompts: T2I | I2I submitted by /u/BleynSpecnaz [link] [comments]

Source: r/StableDiffusion | 2026-09-23

Loading related sources…