|
|
--- |
|
|
base_model: |
|
|
- Qwen/Qwen-Image-Edit-2509 |
|
|
pipeline_tag: image-to-image |
|
|
library_name: diffusers |
|
|
--- |
|
|
🧨 diffusers compatiable transformer weights extracted from [**Phr00t/Qwen-Image-Edit-Rapid-AIO - V4**](https://huggingface.co/Phr00t/Qwen-Image-Edit-Rapid-AIO) |
|
|
For accelerated Qwen Image Edit 2509 inference in 4 steps. |
|
|
|
|
|
|
|
|
use with diffusers: |
|
|
``` |
|
|
import torch |
|
|
from diffusers.models import QwenImageTransformer2DModel |
|
|
from diffusers import QwenImageEditPlusPipeline |
|
|
from diffusers.utils import load_image |
|
|
|
|
|
transformer = QwenImageTransformer2DModel.from_pretrained("linoyts/Qwen-Image-Edit-Rapid-AIO", |
|
|
subfolder="transformer",torch_dtype=torch.bfloat16) |
|
|
|
|
|
pipeline = QwenImageEditPlusPipeline.from_pretrained( |
|
|
"Qwen/Qwen-Image-Edit-2509", |
|
|
transformer=transformer, |
|
|
torch_dtype=torch.bfloat16 |
|
|
) |
|
|
pipeline.to('cuda') |
|
|
|
|
|
image1 = load_image("grumpycat.png") |
|
|
prompt = "turn the cat into an orange cat" |
|
|
inputs = { |
|
|
"image": [image1], |
|
|
"prompt": prompt, |
|
|
"generator": torch.manual_seed(42), |
|
|
"true_cfg_scale": 1.0, |
|
|
"negative_prompt": " ", |
|
|
"num_inference_steps": 4, |
|
|
"guidance_scale": 1.0, |
|
|
"num_images_per_prompt": 1, |
|
|
} |
|
|
|
|
|
output = pipeline(**inputs) |
|
|
output_image = output.images[0] |
|
|
output_image.save("output_image_edit_plus.png") |
|
|
``` |