DEDUPED Hot AI repos. Real use cases. What people build. Get the Monday 5

How to rewrite short requests into detailed image prompts with Awesome Qwen Image

Use the official PE-T2I rewriter to expand a brief idea and get an aspect ratio.

Short answer: Download the full Qwen/Qwen-Image-2.1-PE-T2I repo, since it splits into shards with an index and has no single-file build; then load it with AutoModelForCausalLM and AutoTokenizer and use its system_prompt.txt; send the short request and read the output, which is JSON after a reasoning block. All steps.

  • Content
  • Intermediate
  • 1 hour
  • From the README
  • Any agent

Authorization notice. Awesome Qwen Image is dual-use. Only use it on software, sites and systems you own or have explicit permission to test.

Who it is forA content creator who writes short requests in any language and wants a detailed English prompt.

The problemBrief prompts often produce weak images, and manual rewriting takes time.

The outcomeA detailed English prompt and a recommended aspect ratio you can map to an image size.

What you need first

  • A runtime that matches the chosen entry point: Diffusers, ComfyUI, llama.cpp, or MLX on Apple Silicon
  • Enough disk space: the base text encoder alone is about 17.5 GB in BF16
  • A GPU with 8 to 12 GB VRAM for the INT4 ConvRot pack, or a Mac with Apple Silicon for MLX-4bit
  • Acceptance of the Qwen Research License that covers the base weights

Steps

  1. Download the full Qwen/Qwen-Image-2.1-PE-T2I repo, since it splits into shards with an index and has no single-file build.
  2. Load it with AutoModelForCausalLM and AutoTokenizer and use its system_prompt.txt.
  3. Send the short request and read the output, which is JSON after a reasoning block.
  4. Split the output on the think-tag before parsing the JSON.
  5. Use the returned wh_ratio to pick the image size, then pass the rewritten prompt to your image model.

Prompt for your agent

Using wildminder/awesome-qwen-image, load the Qwen/Qwen-Image-2.1-PE-T2I rewriter with AutoModelForCausalLM and AutoTokenizer, rewrite the request <request> using its system_prompt.txt, and return the English prompt and wh_ratio as JSON. Verify that you split the output on the think-tag before parsing JSON.

Caveat. The official rewriter is a 9B model at about 18.8 GB, so the lighter Pocket 2B or 0.8B builds are the option for smaller machines.

Use this in your AI agent

Ask your agent

Using the Deduped MCP, get the setup steps for wildminder/awesome-qwen-image and "Rewrite short requests into detailed image prompts"

Add Deduped to Claude Code once

claude mcp add --transport http deduped https://dedupedai.com/mcp

Cursor, ChatGPT, others

Share: X LinkedIn Hacker News Email Copy link

Third-party repos we don't own. AI-written use cases can be wrong. Disclaimer