Instructions to use prithivMLmods/Qwen-Image-Edit-Rapid-AIO-V21 with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Diffusers
How to use prithivMLmods/Qwen-Image-Edit-Rapid-AIO-V21 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("prithivMLmods/Qwen-Image-Edit-Rapid-AIO-V21", 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
| license: apache-2.0 | |
| language: | |
| - en | |
| base_model: | |
| - Phr00t/Qwen-Image-Edit-Rapid-AIO | |
| pipeline_tag: image-to-image | |
| library_name: diffusers | |
| tags: | |
| - qwen-edit | |
| - t2i | |
| - i2i | |
| - art | |
| Diffusers-compatible transformer weights extracted from [Phr00t/Qwen-Image-Edit-Rapid-AIO-NSFW-V21](https://huggingface.co/Phr00t/Qwen-Image-Edit-Rapid-AIO/blob/main/v21/Qwen-Rapid-AIO-NSFW-v21.safetensors) for 4-step accelerated Qwen Image Edit inference. | |
| > Tested some sample inferences for Phr00t/Qwen-Image-Edit-Rapid-AIO `v21` @ 4 steps. Still, `v19` is the best in overall performance. `v21` performs better @ 6–8 steps or even higher. | |
| ## **Quick Start with Diffusers🧨** | |
| ``` | |
| pip install -U torch transformers diffusers | |
| ``` | |
| ```py | |
| import torch | |
| from diffusers.models import QwenImageTransformer2DModel | |
| from diffusers import QwenImageEditPlusPipeline | |
| from diffusers.utils import load_image | |
| transformer = QwenImageTransformer2DModel.from_pretrained( | |
| "prithivMLmods/Qwen-Image-Edit-Rapid-AIO-V21", | |
| torch_dtype=torch.bfloat16 | |
| ) | |
| pipeline = QwenImageEditPlusPipeline.from_pretrained( | |
| "Qwen/Qwen-Image-Edit-2511", | |
| 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") | |
| ``` |