Instructions to use ThirdMiddle/Qwen-Image-1.9 with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Diffusers
How to use ThirdMiddle/Qwen-Image-1.9 with Diffusers:
pip install -U diffusers transformers accelerate
import torch from diffusers import DiffusionPipeline # switch to "mps" for apple devices pipe = DiffusionPipeline.from_pretrained("ThirdMiddle/Qwen-Image-1.9", dtype=torch.bfloat16, device_map="cuda") prompt = "Astronaut in a jungle, cold color palette, muted colors, detailed, 8k" image = pipe(prompt).images[0] - llama-cpp-python
How to use ThirdMiddle/Qwen-Image-1.9 with llama-cpp-python:
# !pip install llama-cpp-python from llama_cpp import Llama llm = Llama.from_pretrained( repo_id="ThirdMiddle/Qwen-Image-1.9", filename="quantize/gguf/model-IQ4_XS.gguf", )
output = llm( "Once upon a time,", max_tokens=512, echo=True ) print(output)
- Notebooks
- Google Colab
- Kaggle
- Local Apps
- llama.cpp
How to use ThirdMiddle/Qwen-Image-1.9 with llama.cpp:
Install from brew
brew install llama.cpp # Start a local OpenAI-compatible server with a web UI: llama-server -hf ThirdMiddle/Qwen-Image-1.9:Q4_K_M # Run inference directly in the terminal: llama-cli -hf ThirdMiddle/Qwen-Image-1.9:Q4_K_M
Install from WinGet (Windows)
winget install llama.cpp # Start a local OpenAI-compatible server with a web UI: llama-server -hf ThirdMiddle/Qwen-Image-1.9:Q4_K_M # Run inference directly in the terminal: llama-cli -hf ThirdMiddle/Qwen-Image-1.9:Q4_K_M
Use pre-built binary
# Download pre-built binary from: # https://github.com/ggerganov/llama.cpp/releases # Start a local OpenAI-compatible server with a web UI: ./llama-server -hf ThirdMiddle/Qwen-Image-1.9:Q4_K_M # Run inference directly in the terminal: ./llama-cli -hf ThirdMiddle/Qwen-Image-1.9:Q4_K_M
Build from source code
git clone https://github.com/ggerganov/llama.cpp.git cd llama.cpp cmake -B build cmake --build build -j --target llama-server llama-cli # Start a local OpenAI-compatible server with a web UI: ./build/bin/llama-server -hf ThirdMiddle/Qwen-Image-1.9:Q4_K_M # Run inference directly in the terminal: ./build/bin/llama-cli -hf ThirdMiddle/Qwen-Image-1.9:Q4_K_M
Use Docker
docker model run hf.co/ThirdMiddle/Qwen-Image-1.9:Q4_K_M
- LM Studio
- Jan
- Draw Things
- DiffusionBee
- Ollama
How to use ThirdMiddle/Qwen-Image-1.9 with Ollama:
ollama run hf.co/ThirdMiddle/Qwen-Image-1.9:Q4_K_M
- Unsloth Studio new
How to use ThirdMiddle/Qwen-Image-1.9 with Unsloth Studio:
Install Unsloth Studio (macOS, Linux, WSL)
curl -fsSL https://unsloth.ai/install.sh | sh # Run unsloth studio unsloth studio -H 0.0.0.0 -p 8888 # Then open http://localhost:8888 in your browser # Search for ThirdMiddle/Qwen-Image-1.9 to start chatting
Install Unsloth Studio (Windows)
irm https://unsloth.ai/install.ps1 | iex # Run unsloth studio unsloth studio -H 0.0.0.0 -p 8888 # Then open http://localhost:8888 in your browser # Search for ThirdMiddle/Qwen-Image-1.9 to start chatting
Using HuggingFace Spaces for Unsloth
# No setup required # Open https://huggingface.co/spaces/unsloth/studio in your browser # Search for ThirdMiddle/Qwen-Image-1.9 to start chatting
- Docker Model Runner
How to use ThirdMiddle/Qwen-Image-1.9 with Docker Model Runner:
docker model run hf.co/ThirdMiddle/Qwen-Image-1.9:Q4_K_M
- Lemonade
How to use ThirdMiddle/Qwen-Image-1.9 with Lemonade:
Pull the model
# Download Lemonade from https://lemonade-server.ai/ lemonade pull ThirdMiddle/Qwen-Image-1.9:Q4_K_M
Run and chat with the model
lemonade run user.Qwen-Image-1.9-Q4_K_M
List all available models
lemonade list
Qwen-Image-1.9
A merged, abliterated, and quantized derivative of the Qwen-Image 20B MMDiT family.
Run ID:
prod-20260407Created: 2026-04-07T18:59:37+00:00
Architecture
| Property | Value |
|---|---|
| Base family | Qwen-Image (MMDiT 20B) |
| Text encoder | Qwen2.5-VL |
| VAE | RGB-VAE |
| RoPE | 2D |
| Backbone parameters | ~20B |
| License | Apache-2.0 |
Source Models
| Alias | Model | Role | License |
|---|---|---|---|
qwen-image-2512 |
Qwen/Qwen-Image-2512 | foundation | Apache-2.0 |
qwen-image-base |
Qwen/Qwen-Image | ancestry-base | Apache-2.0 |
qwen-image-edit-2511 |
Qwen/Qwen-Image-Edit-2511 | edit-donor | Apache-2.0 |
qwen-image-layered |
Qwen/Qwen-Image-Layered | layer-logic-donor | Apache-2.0 |
Research Method
1. Delta-Edit Merge
The edit capability is transferred to the foundation model via a controlled delta injection:
edit_delta = Qwen-Image-Edit-2511 โ Qwen-Image (delta base)
merged = Qwen-Image-2512 + 0.35 ร edit_delta
Only MMDiT backbone tensors are blended. Text encoder, VAE, and RoPE components are passed through from the foundation checkpoint unchanged.
- Strategy:
slerp - Blend coefficient:
0.35 - Foundation:
Qwen/Qwen-Image-2512 - Excluded subsystems: text_encoder, vae, rope
2. Abliteration (Refusal-Direction Removal)
Refusal-direction vectors are identified in the residual stream and projected out of target weight matrices using a norm-preserving orthogonal projection:
Wโฒ = W โ scale ร (W @ rฬ) โ rฬ (norm-preserving variant)
- Target layers: 18+ (attention o_proj + MLP down_proj)
- Scale: 1.0
- Mode: norm-preserving (preserves weight magnitude distribution)
- Recipe:
stage-3-abliteration.yaml
3. Quantization
| Kind | Path |
|---|---|
quant_config |
quant-config.json |
- GGUF targets: Q4_K_M, IQ4_XS (with importance-matrix)
- EXL2 target: 4.0 bpw
- Runtime: vLLM-Omni (ROCm), ExLlamaV2
Hardware
- GPU: AMD Instinct MI300X โ 192 GB HBM3 VRAM
- ROCm: 7.2.0
- Precision: bf16 (merge + abliterate), quantized (deployment)
Usage
from diffusers import DiffusionPipeline
import torch
pipe = DiffusionPipeline.from_pretrained(
"ThirdMiddle/Qwen-Image-1.9",
torch_dtype=torch.bfloat16,
trust_remote_code=True,
)
pipe = pipe.to("cuda")
image = pipe(
"a photorealistic portrait of an astronaut on Mars at sunrise",
num_inference_steps=30,
guidance_scale=4.0,
).images[0]
image.save("output.png")
License
Apache-2.0 โ inherited from all source models.
- Downloads last month
- 1,602
4-bit
16-bit
Model tree for ThirdMiddle/Qwen-Image-1.9
Base model
Qwen/Qwen-Image