Instructions to use prithivMLmods/Qwen-Image-2.1-PE-I2I-MLX with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- MLX
How to use prithivMLmods/Qwen-Image-2.1-PE-I2I-MLX with MLX:
# Make sure mlx-vlm is installed # pip install --upgrade mlx-vlm from mlx_vlm import load, generate from mlx_vlm.prompt_utils import apply_chat_template from mlx_vlm.utils import load_config # Load the model model, processor = load("prithivMLmods/Qwen-Image-2.1-PE-I2I-MLX") config = load_config("prithivMLmods/Qwen-Image-2.1-PE-I2I-MLX") # Prepare input image = ["http://images.cocodataset.org/val2017/000000039769.jpg"] prompt = "Describe this image." # Apply chat template formatted_prompt = apply_chat_template( processor, config, prompt, num_images=1 ) # Generate output output = generate(model, processor, formatted_prompt, image) print(output) - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- LM Studio
- Pi
How to use prithivMLmods/Qwen-Image-2.1-PE-I2I-MLX with Pi:
Start the MLX server
# Install MLX LM: uv tool install mlx-lm # Start a local OpenAI-compatible server: mlx_lm.server --model "prithivMLmods/Qwen-Image-2.1-PE-I2I-MLX"
Configure the model in Pi
# Install Pi: npm install -g @earendil-works/pi-coding-agent # Add to ~/.pi/agent/models.json: { "providers": { "mlx-lm": { "baseUrl": "http://localhost:8080/v1", "api": "openai-completions", "apiKey": "none", "models": [ { "id": "prithivMLmods/Qwen-Image-2.1-PE-I2I-MLX" } ] } } }Run Pi
# Start Pi in your project directory: pi
- Hermes Agent
How to use prithivMLmods/Qwen-Image-2.1-PE-I2I-MLX with Hermes Agent:
Start the MLX server
# Install MLX LM: uv tool install mlx-lm # Start a local OpenAI-compatible server: mlx_lm.server --model "prithivMLmods/Qwen-Image-2.1-PE-I2I-MLX"
Configure Hermes
# Install Hermes: curl -fsSL https://hermes-agent.nousresearch.com/install.sh | bash hermes setup # Point Hermes at the local server: hermes config set model.provider custom hermes config set model.base_url http://127.0.0.1:8080/v1 hermes config set model.default prithivMLmods/Qwen-Image-2.1-PE-I2I-MLX
Run Hermes
hermes
- Atomic Chat
- OpenClaw
How to use prithivMLmods/Qwen-Image-2.1-PE-I2I-MLX with OpenClaw:
Start the MLX server
# Install MLX LM: uv tool install mlx-lm # Start a local OpenAI-compatible server: mlx_lm.server --model "prithivMLmods/Qwen-Image-2.1-PE-I2I-MLX"
Configure OpenClaw
# Install OpenClaw: npm install -g openclaw@latest # Register the local server and set it as the default model: openclaw onboard --non-interactive --mode local \ --auth-choice custom-api-key \ --custom-base-url http://127.0.0.1:8080/v1 \ --custom-model-id "prithivMLmods/Qwen-Image-2.1-PE-I2I-MLX" \ --custom-provider-id mlx-lm \ --custom-compatibility openai \ --custom-text-input \ --accept-risk \ --skip-health
Run OpenClaw
openclaw agent --local --agent main --message "Hello from Hugging Face"
Qwen-Image-2.1-PE-I2I-MLX
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.
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)
Use with mlx
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.
BF16 Variant (Base Weights)
The BF16 weights reside directly in the root directory:
CLI (Terminal)
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>
Python API
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)
8-bit Variant
Target the 8bit subfolder:
CLI (Terminal)
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>
Python API
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)
4-bit Variant
Target the 4bit subfolder:
CLI (Terminal)
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>
Python API
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)
Licence and Attribution
Base Model: Qwen/Qwen-Image-2.1-PE-I2I
- License: Qwen Research License
MLX-VLM: Blaizzy/mlx-vlm
MLX: ml-explore/mlx
- Downloads last month
- 803
4-bit
Model tree for prithivMLmods/Qwen-Image-2.1-PE-I2I-MLX
Base model
Qwen/Qwen-Image-2.1-PE-I2I