Views
No views yet
[!NOTE] This is a 4-bit (NF4) quantized version of Qwen/Qwen-Image-Edit-2511. It enables running this massive pipeline on consumer GPUs (16GB-24GB VRAM) with minimal quality loss.
img_mod, proj_out) are kept in bfloat16 to prevent artifacts.bitsandbytes NF4.1import os
2import torch
3from PIL import Image
4from diffusers import QwenImageEditPlusPipeline
5
6pipeline = QwenImageEditPlusPipeline.from_pretrained("toandev/Qwen-Image-Edit-2511-4bit", torch_dtype=torch.bfloat16)
7print("pipeline loaded")
8
9# pipeline.to('cuda')
10pipe.enable_model_cpu_offload() # Automatically offloads model components to CPU. Required for GPUs < 40GB VRAM.
11pipeline.set_progress_bar_config(disable=None)
12image1 = Image.open("input1.png")
13image2 = Image.open("input2.png")
14prompt = "The magician bear is on the left, the alchemist bear is on the right, facing each other in the central park square."
15inputs = {
16 "image": [image1, image2],
17 "prompt": prompt,
18 "generator": torch.manual_seed(0),
19 "true_cfg_scale": 4.0,
20 "negative_prompt": " ",
21 "num_inference_steps": 40,
22 "guidance_scale": 1.0,
23 "num_images_per_prompt": 1,
24}
25with torch.inference_mode():
26 output = pipeline(**inputs)
27 output_image = output.images[0]
28 output_image.save("output_image_edit_2511.png")
29 print("image saved at", os.path.abspath("output_image_edit_2511.png"))
30
pip install git+https://github.com/huggingface/diffusersQwen-Image-Edit-2511:1import os
2import torch
3from PIL import Image
4from diffusers import QwenImageEditPlusPipeline
5
6pipeline = QwenImageEditPlusPipeline.from_pretrained("Qwen/Qwen-Image-Edit-2511", torch_dtype=torch.bfloat16)
7print("pipeline loaded")
8
9pipeline.to('cuda')
10pipeline.set_progress_bar_config(disable=None)
11image1 = Image.open("input1.png")
12image2 = Image.open("input2.png")
13prompt = "The magician bear is on the left, the alchemist bear is on the right, facing each other in the central park square."
14inputs = {
15 "image": [image1, image2],
16 "prompt": prompt,
17 "generator": torch.manual_seed(0),
18 "true_cfg_scale": 4.0,
19 "negative_prompt": " ",
20 "num_inference_steps": 40,
21 "guidance_scale": 1.0,
22 "num_images_per_prompt": 1,
23}
24with torch.inference_mode():
25 output = pipeline(**inputs)
26 output_image = output.images[0]
27 output_image.save("output_image_edit_2511.png")
28 print("image saved at", os.path.abspath("output_image_edit_2511.png"))
291@misc{wu2025qwenimagetechnicalreport,
2 title={Qwen-Image Technical Report},
3 author={Chenfei Wu and Jiahao Li and Jingren Zhou and Junyang Lin and Kaiyuan Gao and Kun Yan and Sheng-ming Yin and Shuai Bai and Xiao Xu and Yilei Chen and Yuxiang Chen and Zecheng Tang and Zekai Zhang and Zhengyi Wang and An Yang and Bowen Yu and Chen Cheng and Dayiheng Liu and Deqing Li and Hang Zhang and Hao Meng and Hu Wei and Jingyuan Ni and Kai Chen and Kuan Cao and Liang Peng and Lin Qu and Minggang Wu and Peng Wang and Shuting Yu and Tingkun Wen and Wensen Feng and Xiaoxiao Xu and Yi Wang and Yichang Zhang and Yongqiang Zhu and Yujia Wu and Yuxuan Cai and Zenan Liu},
4 year={2025},
5 eprint={2508.02324},
6 archivePrefix={arXiv},
7 primaryClass={cs.CV},
8 url={https://arxiv.org/abs/2508.02324},
9}