Text to image and image editing
Qwen-Image-2.1 Turbo
Makes images from a text prompt and edits them with up to 10 reference pictures, on a Mac, in 8 steps: Alibaba Qwen's Qwen-Image-2.1 Turbo, with LoRA adapters such as BFS head swap loaded as published. Qwen Research License (non-commercial).
About this model
Qwen-Image-2.1 Turbo makes a picture from a text prompt, or edits pictures you give it: change the season or light, add or remove things, combine several references into one scene. It writes legible text in images (signs, posters). One pack does both, at any output size with sides in multiples of 16.
It is Qwen's Qwen-Image-2.1, distilled to 8 denoising steps: a Qwen3-VL text encoder (8B) that reads the prompt and the reference pictures together, a 32-block diffusion transformer (7B) and a VAE. Slab runs the whole pipeline natively (C+, no Python): prompt template, positions, noise (the same as torch.randn with the same seed), the 8-step schedule and the VAE, opening each part of the pack only while its phase runs.
LoRA adapters load from their published safetensors files, untouched and kept apart from the pack (Session.add_lora before open, up to 4). The pack's weights are int8, so an adapter's update runs beside them on the GPU as a low-rank branch instead of being merged into the codes. The examples below use the BFS head-swap adapter (MIT), downloaded on its own.
What you can build
- Make illustrations, product shots and posters with text, offline on a Mac
- Edit a photo by instruction: season, weather, time of day, style
- Combine reference pictures into one image
- Run published Qwen-Image-2.1 LoRA adapters, such as head swap, without converting them
Text to image: a sign
int8A hand-painted wooden sign that reads 'Fresh Bread Daily' outside a small bakery, morning light, photo (512 x 512, seed 7)
Text to image at 1024
int8A cozy bookstore cafe on a rainy evening, warm light through the windows, people reading at small tables, photo (1024 x 1024, seed 11)
Edit: winter night
int8Leon Brooks, Public domain, https://commons.wikimedia.org/wiki/File:Red_sports_coupe_car.jpg
Turn image 1 into a winter night scene: snow on the ground and on the car, falling snowflakes, warm street lights (seed 41)
Head swap without an adapter
int8Image 1 (above, generated by this pack, seed 21) and image 2 (examples/05-reference-head.jpg, a generated portrait, seed 33), the BFS head-swap prompt, 768 x 1024, seed 51, no adapter
Head swap with the BFS LoRA adapter
int8The same two images, prompt and seed, with bfs_head_v1.1_qwen_2.1.safetensors loaded at strength 1.0 (Session.add_lora)
Variants & downloads
Choose the build for your appModel files are hosted on Google Drive. Large files may open a confirmation page before downloading.
Standard
SlabText encoder and transformer weights stored as int8, the vision tower and VAE in FP16, one file of 16 pieces. The pieces store their size-free graphs, so any output size runs without converting anything; common sizes are held ready.
Platforms: macos
qwen-image-2.1-turbo-int8.slab
16.33 GB · Hosted download
SHA-256 checksum
379498d58cec2c9370c92bf82a60d2f5b9505fa9c189c1a501c0906c1f1e1ffdNOTICE.txt
439 B
SHA-256 checksum
0031cbee0ccdbe47da107a7b48f87621bcd78e525fb9c962e1a136b99c9e8c3aLICENSE-Qwen-Research.txt
8 KB
SHA-256 checksum
8dc973f024ff95966bea25866efa443fd16776dcb1001e681e3d467ea572b28dConversion details
- command
- hf download Qwen/Qwen-Image-2.1-Turbo --revision fc13ba1986fcb905854dc8de2f52eee395f49b5b --local-dir Qwen-Image-2.1-Turbo SLAB_LOAD=slab-load sh convert/qwen-image-2.1/convert.sh Qwen-Image-2.1-Turbo work qwen-image-2.1-turbo-int8.slab
Integration examples
Python: edit a picture
python
import slab
from PIL import Image
cfg = slab.Config(cache_dir="/tmp/slab_cache", license=open("license.slablic.txt").read())
qi = slab.Session(cfg, "qwen-image-2.1-turbo-int8.slab", backend=slab.Backend.GPU)
inp = slab.Input()
inp.add_frame(slab.Frame.open("car.jpg")) # image 1
inp.set_prompt("Turn image 1 into a winter night scene: snow on the ground and on the car, falling snowflakes, warm street lights")
inp.seed = 41
out = qi.start(inp)
while qi.next_step(out): # 8 steps
print(f"step {out.step} of {out.steps}")
img = out.image() # RGBA
Image.frombytes("RGBA", (img.width, img.height), img.pixels()).save("car_winter.png")
Python: head swap with the BFS LoRA adapter
python
import slab
from PIL import Image
cfg = slab.Config(cache_dir="/tmp/slab_cache", license=open("license.slablic.txt").read())
# The adapter is its own file, downloaded as published; it is applied at open, never merged into the pack.
qi = slab.Session(cfg, backend=slab.Backend.GPU, loras=[("bfs_head_v1.1_qwen_2.1.safetensors", 1.0)])
qi.open("qwen-image-2.1-turbo-int8.slab")
inp = slab.Input()
inp.add_frame(slab.Frame.open("base.jpg")) # image 1: body, pose, scene
inp.add_frame(slab.Frame.open("head.jpg")) # image 2: the head to use
inp.set_image_size(768, 1024)
inp.set_prompt("head_swap: start with <image1> as the base image, keeping its lighting, environment, and background. remove the head from <image1> completely and replace it with the head from <image2>, strictly preserving the hair, eye color, nose structure from <image2>. copy the direction of the eye, head rotation, micro expressions from <image1>, high quality, sharp details, 4k")
inp.seed = 51
out = qi.start(inp)
while qi.next_step(out):
pass
img = out.image()
Image.frombytes("RGBA", (img.width, img.height), img.pixels()).save("swapped.png")
Device & backend compatibility
Pack default: macos / GPU. The 7B transformer and 8B text encoder run at a usable speed only on the Apple GPU (Metal, int8 weights, FP16 working memory), and LoRA adapters on int8 weights need the GPU's low-rank branch.
| Platform | Engine | Status | Precision |
|---|---|---|---|
| apple | Metal (MPSGraph) GPU | Supported Measured on macOS. The default: int8 weights decoded in the GPU program, FP16 working memory; the step pieces stream their weights from the pack. LoRA adapters run as a low-rank branch beside the int8 weights. | int8, f16 |
| apple | CPU CPU | Not supported Not measured: far too slow for a 7B transformer and an 8B text encoder, and LoRA adapters on int8 weights need the GPU. | — |
| apple | Apple Neural Engine NPU | Not supported Not tried. | — |
Performance
Results depend on the device, runtime, and test conditions. Each measurement keeps its own context.
Mac with Apple M1 Max (32 GB)
Slab · GPU
macOS 26.6.2
23.10 s
Measured time · scope below
The whole image: prompt encoded 5.7 s, 8 steps of 2.0 s, decoded 1.5 s. The first run on a device took 39.4 s while Slab compiled the GPU programs (kept in the cache folder). Peak memory footprint 8.6 GB.
Mac with Apple M1 Max (32 GB)
Slab · GPU
macOS 26.6.2
85.60 s
Measured time · scope below
The whole image: prompt encoded 4.9 s, 8 steps of about 8.5 s, decoded 2.8 s (80.8 s and 85.6 s in two runs). Peak memory footprint 6.0 GB.
Mac with Apple M1 Max (32 GB)
Slab · GPU
macOS 26.6.2
136.30 s
Measured time · scope below
The whole edit: prompt and reference encoded 24.5 s, 8 steps of about 11 s, decoded 2.7 s. The first run at this size took 148.6 s. Peak memory footprint 9.1 GB.
Mac with Apple M1 Max (32 GB)
Slab · GPU
macOS 26.6.2
152.80 s
Measured time · scope below
The whole swap: prompt and references encoded 59.4 s, 8 steps of about 10.5 s, decoded 2.5 s. The first run with the adapter took 191.2 s, and 213.9 s without it at a new size (GPU programs compiled). Peak memory footprint 15.1 GB (14.9 GB without the adapter).
Accuracy checks
macos · GPU · int8
Slab's own runs repeated with the same prompt, references and seed: text to image at 512 x 512 and 1024 x 1024, the one-reference edit, and the head swap with the BFS adapter, each run cold and warm
The same image, pixel for pixel, in all 4 pairs. Not compared with Diffusers end to end: the bf16 reference (an 8B text encoder and a 7B transformer) paged out of memory on the 32 GB Mac and did not finish. The noise is the same as torch.randn with the same seed; the pipeline was checked against a Python pipeline over the same pieces when it was written (convert/qwen-image-2.1/README.md).
Before you choose this model
- Mac only: it needs about 9 GB of memory for a 512 or 1024 image and about 15 GB for an edit with two references (measured on a 32 GB M1 Max). It is not meant for phones or the iPad.
- Slow: about 23 s for a 512 image, 85 s at 1024, 2.5 minutes for a two-reference edit at 768 x 1024. The first run at a new size also compiles its GPU programs (15-60 s more), kept in the cache folder for later runs.
- 17.5 GB to download.
- The Qwen Research License allows non-commercial use only (research or evaluation). Commercial use needs a license from Qwen.
- Text to image is sensitive to rounding: the same prompt and seed give the same image every time in Slab, but not the same image as another runtime.
- LoRA adapters need the GPU backend with this int8 pack, must be made for Qwen-Image-2.1 (one for another model is refused), and adapters for the text encoder are not read.
- Head swap: use it only on people who have given consent; the examples here are generated people.