Instructions to use wavespeed/Qwen-Image-Edit-e4m3 with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Diffusers
How to use wavespeed/Qwen-Image-Edit-e4m3 with Diffusers:
pip install -U diffusers transformers accelerate
import torch from diffusers import DiffusionPipeline from diffusers.utils import load_image # switch to "mps" for apple devices pipe = DiffusionPipeline.from_pretrained("wavespeed/Qwen-Image-Edit-e4m3", dtype=torch.bfloat16, device_map="cuda") prompt = "Turn this cat into a dog" input_image = load_image("https://huggingface.co/datasets/huggingface/documentation-images/resolve/main/diffusers/cat.png") image = pipe(image=input_image, prompt=prompt).images[0] - Notebooks
- Google Colab
- Kaggle
|
Download README.md from wavespeed/Qwen-Image-Edit-e4m3: direct link, hf CLI and curl.
- Browser
- Download file 1.62 kB
-
https://huggingface.co/wavespeed/Qwen-Image-Edit-e4m3/resolve/main/README.md
- Command line
-
hf download hf://wavespeed/Qwen-Image-Edit-e4m3/README.md
-
curl -L -o README.md https://huggingface.co/wavespeed/Qwen-Image-Edit-e4m3/resolve/main/README.md
1.62 kB
metadata
base_model: Qwen/Qwen-Image-Edit
library_name: diffusers
license: apache-2.0
pipeline_tag: image-to-image
tags:
- qwen-image
- image-to-image
- image-editing
- quantized
- fp8
- e4m3
- diffusers
base_model_relation: quantized
Qwen-Image-Edit-e4m3
FP8 (e4m3) dynamically-quantized Qwen-Image-Edit,
saved as a complete QwenImageEditPipeline.
What was changed
All 60 blocks of the QwenImageTransformer2DModel are quantized to
e4m3_e4m3_dynamic — float8_e4m3fn weights with dynamically scaled
float8_e4m3fn activations. The Qwen2.5-VL text encoder, the processor, the
VAE and the transformer's non-block tensors are untouched and stay in bf16. The
transformer drops from ~40.9 GB to ~20.5 GB.
Quantization was done with WaveSpeed's xelerate.ao.quantize. Weights are
stored as pickled .bin shards, so loading requires use_safetensors=False.
FP8 matmul needs Hopper (H100/H200) or newer to actually be faster than bf16.
Usage
import torch
from diffusers import QwenImageEditPipeline
from diffusers.utils import load_image
pipe = QwenImageEditPipeline.from_pretrained(
"wavespeed/Qwen-Image-Edit-e4m3",
torch_dtype=torch.bfloat16,
use_safetensors=False,
).to("cuda")
image = load_image("input.png")
out = pipe(image=image, prompt="make it a winter scene").images[0]
Related
wavespeed/Qwen-Image-Edit-l8v1.1-e4m3— the same quantization with an 8-step Lightning LoRA fused in.
License
Apache-2.0, inherited from Qwen-Image-Edit.