Dev reverse-engineers Qwen Image 2.1 PE, ships ComfyUI node that auto-computes dimensions
BleynSpecnaz · reddit · 2026-09-24
While experimenting with Qwen Image 2.1 Prompt Enhancer (PE), the author found its official system prompts make the model output structured JSON: T2I returns rewrittenprompt plus whratio (e.g. 3:2), while I2I adds a ratiofollow field indicating which reference image's dimensions to follow.
He built a ComfyUI custom node, Prompt & Dimensions from LLM, that parses this JSON and auto-computes exact latent width/height:
- T2I: derives resolution from whratio, target megapixels, and a rounding multiple
- I2I: pulls dimensions from the reference image when editing, or uses whratio when generating from references
He tested with GGUF quants of PE paired with ComfyUI-ThinkingLLM; Kijai's safetensors weights via the standard TextGeneration node also work. The node is on ComfyUI Manager and GitHub.
He also notes PE adds grounded scene details (spatial context, distant text, lighting, object interactions) rather than stylistic fluff, and the parsed text can feed other pipelines like Flux Dev, Klein, or Krea 2.
More from coding & agent
- YouArt Desktop launches: AI agent edits video in CapCut, DaVinci and Premiere from client feedback — mhdfaran · 2026-11-11
- Boubou: one-command local voice AI that serves your phone and robots over Wi-Fi — LuozhuZhang · 2026-11-11
- Python 3.15 makes AttributeError actionable: suggests .append for .push mix-ups — KhuyenTran16 · 2026-11-11
- sentence-transformers maintainer releases new embedding pooling training method, code & checkpoints — tomaarsen · 2026-11-11
- droid-mcp turns your Android phone into an MCP server with 160+ tools for Claude Code — zvone1122 · 2026-11-11
- The decade of agents: simulate real customers to test your agent before launch — EXM7777 · 2026-11-11