Downloads · 30 days
28
10% of all-time downloads
OPPOer/Qwen-Image-Edit-Pruning
Qwen-Image-Edit-Pruning is a image-to-image model from OPPOer. Use it when you need one image transformed into another. It is set up for diffusers. The card lists the license as apache-2.0.
<div align="center" <h1Qwen-Image-Edit-Pruning</h1 <a href='https://github.com/OPPO-Mente-Lab/Qwen-Image-Pruning'<img src="https://img.shields.io/badge/GitHub-OPPOer-blue.svg?logo=github" alt="GitHub"</a </div
Downloads · 30 days
28
10% of all-time downloads
All-time downloads
281
Public
Parameters
13.6B
72.7 GB on disk
Likes
36
Public
Click a slice to open those files.
.safetensors44.1 GB · 100%
From the Hugging Face model README
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.
<div align="center"> <img src="bench.png"> </div>Install the latest version of diffusers and pytorch
pip install torch
pip install git+https://github.com/huggingface/diffusers
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')