Instructions to use Qwen/Qwen-Image-Edit with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Diffusers
How to use Qwen/Qwen-Image-Edit 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("Qwen/Qwen-Image-Edit", 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] - Inference
- Notebooks
- Google Colab
- Kaggle
Referencing multiple images
Has anyone tried, or does anyone have any ideas or suggestions on referencing multiple images into clip context, as is possible with flux kontext (or gpt-image-1)?
I attempted to use ComfyUI's image stitch node, which is the way flux kontext does it, but it doesn't seem to play nice in this case.
did you figure this out ?
Sorry, nothing ideally worked for me yet...
I find it really hard to reference images when editing an image.
Examples show 'Edit image 1, replace the man with the man from image 2'
Someone on reddit suggested trying 'Edit input_image, replace the man with the man from image 2'.
These both sometimes work, but other time it used the wrong image as the base.
Sometimes it's not easy to say something like 'Replace the man in with blond hair with the man with black hair' as there may not be enough difference to describe.