The purpose
Image Editing using Qwen-Image via Command Line (AMD GPU/CPU Support) Qwen-Image from the command line using stable-diffusion.cpp. It can be executed on both AMD GPUs and CPUs.
Build environment
stable-diffusion.cpp
Download the ZIP file that matches your environment from the following page.
If you want to run it on an AMD GPU, look for versions labeled Vulkan or ROCm.
(Generally, Vulkan should be fine. ROCm tends to support a more limited range of GPUs.)

For NVIDIA GPUs, look for versions labeled “CUDA“.
The AVX512, AVX2, AVX, and No-AVX versions are for CPU operation. Please check which AVX version your CPU supports before downloading. (I was under the impression they weren’t, but it turns out AMD CPUs also support AVX. The easiest way to check your specific version is to ask an AI.)
Once you have extracted the downloaded file to a folder of your choice, the setup is complete.
Model
Please download one model from each of the following pages, for a total of three models.
The VAE and LLM models are the same as those used in the article below. (Please note that the Diffusion model is different.)
Regarding cases where multiple files are available, larger files require more memory but offer higher accuracy. Please decide which model to use based on your system environment.
On my setup (Ryzen 7 7735HS with Radeon Graphics + 32GB RAM), the Q8_0.gguf version didn’t work, so I used Q4_K_S.gguf instead.
diffusion-model

vae

llm

Execute
Open the command line and navigate to the folder where you extracted stable-diffusion.cpp.
Run the following command. (Replace “model path” with the actual path of the model you are using. Replace “input_image_path” with the actual path of the input image you are using.)
sd-cli.exe --diffusion-model Diffusion_model_path --vae VAE_model_path --llm llm_model_path --cfg-scale 2.5 --sampling-method euler --offload-to-cpu --diffusion-fa --flow-shift 3 -r input_image_path -p "change eye color to red" --seed -1
It is successful if a cat has red eyes image is generated in ./output.png.
Input

Output

Option (Argument)
The options are summarized on the following page.
Only the most commonly used ones are listed below.
| -m | path for Model |
| -p | prompt |
| -s | Seed To generate a random image, specify -1. Note that if this is not specified, the same image will be generated every time. |
-H | Image height |
| -W | Image width |
--vae | path for VAE |
--steps | Step default 20 Be careful, as some models perform better with lower values. |
Execute time
Image generation speeds are as follows. (This excludes model loading time and post-iteration processing.)
| Creation Time(s) | |
| stable-diffusion(Vulkan) | 36 |
| Qwen Image(Vulkan) | 623 |
| Qwen Image Edit(Vulkan) | 1683 |
Reference
about Qwen Image Edit 2509
The Qwen Image Edit 2509 model can be found on the following page.
I was able to get it working by replacing the Diffusion model path in the Qwen Image Edit execution command with the path to the model downloaded below.

The official documentation includes the --llm_vision flag when running Qwen Image Edit 2509, but adding this argument caused the execution to fail. (It might be an issue specific to my environment, though.)
Result
Creation Time : 2034.03s

It might just be a coincidence, but Qwen Image Edit 2509 handled “Close eyes” quite well.



comment