Having a blast with Qwen Image 2.1 on my M2 Macbook Pro with 32GB RAM, even though it takes 16 minutes to complete the recommended number of iterations with the resolution reduced to 1024x1024. And those are some hot minutes! Above are some entertaining outputs. I strongly recommend stepping through the slideshow to see how the deterministic nature of Qwen Image 2.1 reveals a deep structure shared by all of these images with related prompts, even though the prompts and results are quite different. If you look carefully even the first image, the photorealistic one, shares elements with the others. The most obvious being the object at front left which appears in various forms in every image. The prompts were all variations on "glamping cats." The first one was simply "glamping cats," the last one was "cats on a glamping trip, in a modern cartoon style", one of the previous ones was "cats on a glamping trip, in a charming illustrated style." Notice that one of the images has an odd broken-up appearance with lines across it. This is one of the times I changed num_inference_steps to 10 to try to speed it up. Other, "illustrated-style" attempts worked fine at that setting. There are apps that make this easier, but for those who want to follow the instructions on Qwen's page literally with a Mac, here are the steps: * Install homebrew if you haven't (who hasn't?) * Install python: brew install python Now, here is a working install script for Qwen Image 2.1. This is the script they suggest, plus activating the python environment, plus torchvision which was missing from their script: #!/bin/bash set -e python3 -m venv qwenenv source qwenenv/bin/activate pip install --upgrade pip pip install "torch>=2.4.0" pip install "transformers>=5.17" pip install git+https://github.com/huggingface/diffusers pip install accelerate pillow torchvision Then change their test.py to use "mps" rather than "cuda" everywhere. Finally here are the commands to run the test.py they provide correctly in this virtual python environment: python3 -m venv qwenenv source qwenenv/bin/activate python test.py Here's my most recent variant of test.py from the last image in the gallery: import torch from diffusers import QwenImage21Pipeline pipe = QwenImage21Pipeline.from_pretrained( "Qwen/Qwen-Image-2.1", torch_dtype=torch.bfloat16 ).to("mps") # normally 40 steps, 2048 by 2048 image = pipe( prompt="cats on a glamping trip, in a modern cartoon style", width=1024, height=1024, num_inference_steps=40, generator=torch.Generator("mps").manual_seed(42), ).images[0] image.save("glamping-cats-4b.png") Have fun!   submitted by   /u/boutell [link]   [comments]