Instructions to use OPPOer/Qwen-Image-Edit-Pruning with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Diffusers
How to use OPPOer/Qwen-Image-Edit-Pruning 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("OPPOer/Qwen-Image-Edit-Pruning", 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
metadata
license: apache-2.0
base_model:
- Qwen/Qwen-Image-Edit
language:
- en
- zh
library_name: diffusers
pipeline_tag: image-to-image
datasets:
- OPPOer/X2Edit-Dataset
Update
- 2025/10/09: We release Qwen-Image-Edit-2509-Pruning-13B-4steps
- 2025/09/29: We release Qwen-Image-Edit-2509-Pruning-14B
- 2025/09/28: We release Qwen-Image-Edit-Pruning-13B-4steps
Introduction
This open-source project is based on Qwen-Image-Edit and has attempted model pruning, removing 20 layers while retaining the weights of 40 layers, resulting in a model size of 13.6B parameters. The pruned version will continue to be iterated upon. Please stay tuned.
Quick Start
Install the latest version of diffusers and pytorch
pip install torch
pip install git+https://github.com/huggingface/diffusers
Qwen-Image-Edit-13B Inference
from diffusers import QwenImageEditPipeline
import os
from PIL import Image
import time
import torch
model_name = "OPPOer/Qwen-Image-Edit-Pruning"
pipe = QwenImageEditPipeline.from_pretrained(model_name, torch_dtype=torch.bfloat16)
pipe = pipe.to('cuda')
subject_img = Image.open('input.jpg').convert('RGB')
prompt = '改为数字插画风格'
t1 = time.time()
inputs = {
"image": subject_img,
"prompt": prompt,
"generator": torch.manual_seed(42),
"true_cfg_scale": 1,
"num_inference_steps": 4,
}
with torch.inference_mode():
output = pipe(**inputs)
output_image = output.images[0]
output_image.save('output.jpg')