Downloads · 30 days
548
38% of all-time downloads
prithivMLmods/Qwen-Image-2.1-PE-T2I-MLX
Qwen-Image-2.1-PE-T2I-MLX is a text generation model from prithivMLmods. Use it when you need the model to write or continue text. It is set up for mlx. The card lists the license as other.
Qwen-Image-2.1-PE-T2I is the text-to-image prompt-rewriting model for Qwen-Image-2.1, a fine-tuned Qwen3.5-VL-9B that turns a brief image request in any language into a detailed, expanded English prompt paired with a…
Downloads · 30 days
548
38% of all-time downloads
All-time downloads
1.5K
Public
Parameters
9.4B
35.2 GB on disk
Likes
2
Public
Click a slice to open those files.
.safetensors35.2 GB · 100%
From the Hugging Face model README
Qwen-Image-2.1-PE-T2I is the text-to-image prompt-rewriting model for Qwen-Image-2.1, a fine-tuned Qwen3.5-VL-9B that turns a brief image request in any language into a detailed, expanded English prompt paired with a recommended aspect ratio, acting as the bridge between casual multilingual user requests (e.g., a short Chinese phrase describing a corgi playing guitar in the rain) and the precise, richly-detailed instructions the downstream 7B-parameter DiT-based Qwen-Image-2.1 generator needs for best results. After a
<think>reasoning block, it outputs a structured JSON object containing therewritten_promptand awh_ratiovalue (e.g.,16:9), which maps directly to standard render resolutions when passed into the DiffusersQwenImage21Pipeline. It's usable via standard Hugging FaceAutoModelForCausalLMloading, is intended purely as a preprocessing step ahead of image generation rather than a general-purpose chat model, and is released under the Qwen Research License Agreement.
[!NOTE] System Prompt — https://huggingface.co/Qwen/Qwen-Image-2.1-PE-T2I/blob/main/system_prompt.txt
prithivMLmods/Qwen-Image-2.1-PE-T2I-MLX (main) [~32.82 GB Total]
├── 4bit/ [~5.58 GB]
│ ├── model shards: 2 safetensors (~5.56 GB)
│ └── metadata & configs (~19.1 MB)
│
├── 8bit/ [~9.72 GB]
│ ├── model shards: 2 safetensors (~9.70 GB)
│ └── metadata & configs (~19.1 MB)
│
└── [BF16 Base Files] [~17.52 GB]
├── model shards: 4 safetensors (~17.50 GB)
└── metadata & configs (~19.1 MB)
Install the required library:
pip install -U mlx-vlm
Task Note:
Qwen-Image-2.1-PE-T2Iis a Text-to-Image prompt enhancer/rewriter (based on Qwen VL). It takes a short, simple user prompt (e.g., "A cybernetic tiger in Tokyo") and outputs an expanded, high-detail English diffusion prompt along with the optimal aspect ratio (wh_ratio).
The BF16 weights reside directly in the root repository path:
python -m mlx_vlm generate \
--model prithivMLmods/Qwen-Image-2.1-PE-T2I-MLX \
--max-tokens 512 \
--temperature 0.2 \
--prompt "A neon cybernetic samurai standing under rainy Tokyo streets, cinematic lighting"
from mlx_vlm import load, generate
from mlx_vlm.prompt_utils import apply_chat_template
from mlx_vlm.utils import load_config
model_path = "prithivMLmods/Qwen-Image-2.1-PE-T2I-MLX"
model, processor = load(model_path)
config = load_config(model_path)
prompt = "A neon cybernetic samurai standing under rainy Tokyo streets, cinematic lighting"
formatted_prompt = apply_chat_template(processor, config, prompt)
output = generate(model, processor, formatted_prompt, max_tokens=512, temperature=0.2)
print(output.text)
Target the 8bit subfolder:
python -m mlx_vlm generate \
--model prithivMLmods/Qwen-Image-2.1-PE-T2I-MLX/8bit \
--max-tokens 512 \
--temperature 0.2 \
--prompt "A neon cybernetic samurai standing under rainy Tokyo streets, cinematic lighting"
from mlx_vlm import load, generate
from mlx_vlm.prompt_utils import apply_chat_template
from mlx_vlm.utils import load_config
model_path = "prithivMLmods/Qwen-Image-2.1-PE-T2I-MLX"
model, processor = load(model_path, subfolder="8bit")
config = load_config(model_path, subfolder="8bit")
prompt = "A neon cybernetic samurai standing under rainy Tokyo streets, cinematic lighting"
formatted_prompt = apply_chat_template(processor, config, prompt)
output = generate(model, processor, formatted_prompt, max_tokens=512, temperature=0.2)
print(output.text)
Target the 4bit subfolder:
python -m mlx_vlm generate \
--model prithivMLmods/Qwen-Image-2.1-PE-T2I-MLX/4bit \
--max-tokens 512 \
--temperature 0.2 \
--prompt "A neon cybernetic samurai standing under rainy Tokyo streets, cinematic lighting"
from mlx_vlm import load, generate
from mlx_vlm.prompt_utils import apply_chat_template
from mlx_vlm.utils import load_config
model_path = "prithivMLmods/Qwen-Image-2.1-PE-T2I-MLX"
model, processor = load(model_path, subfolder="4bit")
config = load_config(model_path, subfolder="4bit")
prompt = "A neon cybernetic samurai standing under rainy Tokyo streets, cinematic lighting"
formatted_prompt = apply_chat_template(processor, config, prompt)
output = generate(model, processor, formatted_prompt, max_tokens=512, temperature=0.2)
print(output.text)