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
- Dev builds autonomous 2D village with Jev, eyes real-time robot decision-making next — claud_fuen · 2026-09-24
- Two days with Muse agent: auto-podcasts, book narration, portfolio analysis, two deals closed — armand_ruiz · 2026-09-24
- Prompt trick: make your agent surface API doc gaps before writing any integration code — gethackteam · 2026-09-24
- Why do LLMs always estimate task time like sequential human work? — ColleenMBrady · 2026-09-24
- GraphRAG vs. Vector RAG: When Graph Structure Is Worth the Extra Cost — adnan_hashmi · 2026-09-24
- AI2 and UW Re-Evaluate Harness Evolution: Self-Evolving Agents or Just More Attempts? — jiqizhixin · 2026-09-24