DEDUPED Hot AI repos, turned into use cases Get 5 a day

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.

  • 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.

Share: X LinkedIn Hacker News Email Copy link

Disclaimer

Deduped lists open-source repositories that belong to other people. We do not own, maintain, audit, or vouch for any of them, and a repo appearing here is not an endorsement or a safety check. The use cases, steps, and prompts are written by AI and may be incomplete, outdated, or just wrong. Where a use case is marked "Seen in the wild", we link to public posts where someone described something similar, but we have not verified those posts and the use case itself is still our AI's own write-up. Use all of this at your own risk. Only run code, commands, or agents on systems and accounts you are authorized to use, and read the code and every command before you run it, especially anything that touches credentials, files, or the network. Nothing here is professional, security, legal, or financial advice. All trademarks and project names belong to their respective owners, and their use here does not imply affiliation. Content is provided as is, without warranties of any kind. Found a mistake, a safety problem, or something you want removed? Email [email protected] and we will look at it promptly. Full disclaimer page