Image-to-Image
Diffusers
QwenImageEditPipeline
qwen-image
image-editing
quantized
fp8
e4m3
lora
lightning
Instructions to use wavespeed/Qwen-Image-Edit-l8v1.1-e4m3 with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Diffusers
How to use wavespeed/Qwen-Image-Edit-l8v1.1-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("Qwen/Qwen-Image-Edit,lightx2v/Qwen-Image-Lightning", dtype=torch.bfloat16, device_map="cuda") pipe.load_lora_weights("wavespeed/Qwen-Image-Edit-l8v1.1-e4m3") 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
- Local Apps Settings
- Draw Things
Qwen-Image-Edit-l8v1.1-e4m3
Qwen-Image-Edit with the
Qwen-Image-Lightning 8-step V1.1
LoRA fused into the transformer, then quantized to FP8 (e4m3). Saved as a
complete QwenImageEditPipeline.
l8v1.1 in the repo name is Lightning, 8 steps, V1.1.
What was changed
Qwen-Image-Lightning-8steps-V1.1.safetensorsis loaded as a LoRA, fused into the base transformer, and unloaded โ so the published weights carry the step distillation directly and no LoRA is needed at inference.- All 60 transformer blocks are then quantized to
e4m3_e4m3_dynamic(float8_e4m3fnweights, dynamically scaledfloat8_e4m3fnactivations).
The Qwen2.5-VL text encoder, the processor and the VAE are untouched and stay
in bf16. Weights are pickled .bin shards, so loading requires
use_safetensors=False.
Usage
Run it at roughly 8 steps with CFG off โ that is what the fused LoRA was distilled for. Running it at 40 steps like the undistilled model wastes compute and does not improve the result.
import torch
from diffusers import QwenImageEditPipeline
from diffusers.utils import load_image
pipe = QwenImageEditPipeline.from_pretrained(
"wavespeed/Qwen-Image-Edit-l8v1.1-e4m3",
torch_dtype=torch.bfloat16,
use_safetensors=False,
).to("cuda")
out = pipe(
image=load_image("input.png"),
prompt="replace the sky with a clear night sky",
num_inference_steps=8,
true_cfg_scale=1.0,
).images[0]
License
Apache-2.0. Both Qwen-Image-Edit and Qwen-Image-Lightning are Apache-2.0.
- Downloads last month
- 10
Model tree for wavespeed/Qwen-Image-Edit-l8v1.1-e4m3
Base model
Qwen/Qwen-Image-Edit