Downloads · 30 days
461
33% of all-time downloads
prithivMLmods/Qwen-Image-2.1-PE-I2I-MLX
Qwen-Image-2.1-PE-I2I-MLX is a image-text-to-text model from prithivMLmods. Use it for the image-text-to-text task on the model card, and read the license before you ship it in a product. It is set up for mlx. The card lists the license as other.
Qwen-Image-2.1-PE-I2I is an image-editing prompt rewriting model for Qwen-Image-2.1, a fine-tuned Qwen3.5-VL-9B that takes a vague editing instruction plus one or more input images and expands it into a precise, actio…
Downloads · 30 days
461
33% of all-time downloads
All-time downloads
1.4K
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-I2I is an image-editing prompt rewriting model for Qwen-Image-2.1, a fine-tuned Qwen3.5-VL-9B that takes a vague editing instruction plus one or more input images and expands it into a precise, actionable prompt suitable for downstream image editing. It supports multi-image inputs (referenced as
<image1>,<image2>, etc.) for tasks like compositing a subject from one image into another's scene, reasons through a<think>block before outputting a structured JSON result containing the rewritten prompt plus either awh_ratio(new aspect ratio for compositions) orratio_follow(inherited aspect ratio for in-place edits) — the two fields being mutually exclusive. The rewritten prompt is designed to feed directly into the Qwen-Image-2.1 diffusion pipeline via Diffusers for the actual image edit, and the model is loaded through standard Transformers (AutoModelForImageTextToText) with a system prompt shipped alongside the checkpoint; it's released under the Qwen Research License Agreement.
[!NOTE] System Prompt — https://huggingface.co/Qwen/Qwen-Image-2.1-PE-I2I/blob/main/system_prompt.txt
prithivMLmods/Qwen-Image-2.1-PE-I2I-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-I2Iis an Image-to-Image prompt enhancer/rewriter (fine-tuned from Qwen 9B VL). It takes an input image along with an edit instruction (e.g. "Change the background to a sunset beach") and expands it into a detailed prompt suitable for downstream diffusion generation.
The BF16 weights reside directly in the root directory:
python -m mlx_vlm generate \
--model prithivMLmods/Qwen-Image-2.1-PE-I2I-MLX \
--max-tokens 256 \
--temperature 0.2 \
--prompt "Change the lighting to golden hour and add cinematic fog." \
--image <path_to_image>
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-I2I-MLX"
model, processor = load(model_path)
config = load_config(model_path)
image = ["<path_to_image>"]
prompt = "Change the lighting to golden hour and add cinematic fog."
formatted_prompt = apply_chat_template(processor, config, prompt, num_images=len(image))
output = generate(model, processor, formatted_prompt, image=image, max_tokens=256, temperature=0.2)
print(output.text)
Target the 8bit subfolder:
python -m mlx_vlm generate \
--model prithivMLmods/Qwen-Image-2.1-PE-I2I-MLX/8bit \
--max-tokens 256 \
--temperature 0.2 \
--prompt "Change the lighting to golden hour and add cinematic fog." \
--image <path_to_image>
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-I2I-MLX"
model, processor = load(model_path, subfolder="8bit")
config = load_config(model_path, subfolder="8bit")
image = ["<path_to_image>"]
prompt = "Change the lighting to golden hour and add cinematic fog."
formatted_prompt = apply_chat_template(processor, config, prompt, num_images=len(image))
output = generate(model, processor, formatted_prompt, image=image, max_tokens=256, temperature=0.2)
print(output.text)
Target the 4bit subfolder:
python -m mlx_vlm generate \
--model prithivMLmods/Qwen-Image-2.1-PE-I2I-MLX/4bit \
--max-tokens 256 \
--temperature 0.2 \
--prompt "Change the lighting to golden hour and add cinematic fog." \
--image <path_to_image>
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-I2I-MLX"
model, processor = load(model_path, subfolder="4bit")
config = load_config(model_path, subfolder="4bit")
image = ["<path_to_image>"]
prompt = "Change the lighting to golden hour and add cinematic fog."
formatted_prompt = apply_chat_template(processor, config, prompt, num_images=len(image))
output = generate(model, processor, formatted_prompt, image=image, max_tokens=256, temperature=0.2)
print(output.text)
Base Model: Qwen/Qwen-Image-2.1-PE-I2I
MLX-VLM: Blaizzy/mlx-vlm
MLX: ml-explore/mlx